[qca-nss-drv] NSS API changes for multicast acceleration.

Change-Id: I4a9929ecc4345af51936d5f160e044491cdd9322
Signed-off-by: Kiran Kumar C.  S. K <kkumarcs@codeaurora.org>
diff --git a/exports/nss_api_if.h b/exports/nss_api_if.h
index ab23aa4..cd5685c 100644
--- a/exports/nss_api_if.h
+++ b/exports/nss_api_if.h
@@ -36,6 +36,7 @@
 #include <linux/if_ether.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
+#include "nss_def.h"
 #include "nss_cmn.h"
 #include "nss_tun6rd.h"
 #include "nss_tunipip6.h"
@@ -314,7 +315,7 @@
 					/**< Sync is to destroy a cache entry which belongs to a particular PPPoE session */
 
 /**
- * Structure to be used while sending an IPv6 flow/connection destroy rule.
+ * Structure to be used while sending an IPv6 flow/connection create rule.
  *
  * Caution: All fields must be passed in host endian order
  */
diff --git a/exports/nss_def.h b/exports/nss_def.h
new file mode 100644
index 0000000..6afa295
--- /dev/null
+++ b/exports/nss_def.h
@@ -0,0 +1,39 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ **************************************************************************
+ */
+
+#ifndef __NSS_DEF_H
+#define __NSS_DEF_H
+
+#define NSS_ETH_NORMAL_FRAME_MTU 1500
+#define NSS_ETH_MINI_JUMBO_FRAME_MTU 1978
+#define NSS_ETH_FULL_JUMBO_FRAME_MTU 9600
+
+/**
+ * VLAN C-TAG TPID
+ */
+#define VLAN_CTAG_TPID 0x8100
+
+/**
+ * Number of ingress/egress VLANS suppored in a connection entry
+ */
+#define MAX_VLAN_DEPTH 2
+
+/**
+ * Number of egress interfaces suppored in a multicast connection entry
+ */
+#define NSS_MC_IF_MAX 16
+
+#endif /** __NSS_DEF_H */
diff --git a/exports/nss_ipv4.h b/exports/nss_ipv4.h
index 049b436..a555ce5 100644
--- a/exports/nss_ipv4.h
+++ b/exports/nss_ipv4.h
@@ -37,6 +37,7 @@
 	NSS_IPV4_RX_CONN_STATS_SYNC_MSG,	/**< IPv4 connection stats sync message */
 	NSS_IPV4_RX_NODE_STATS_SYNC_MSG,	/**< IPv4 generic statistics sync message */
 	NSS_IPV4_TX_CONN_CFG_RULE_MSG,		/**< IPv4 number of connections supported rule message */
+	NSS_IPV4_TX_CREATE_MC_RULE_MSG,		/**< IPv4 multicast create rule message */
 	NSS_IPV4_MAX_MSG_TYPES,			/**< IPv4 message max type number */
 };
 
@@ -72,6 +73,34 @@
 #define NSS_IPV4_RULE_CREATE_VLAN_MARKING_VALID 0x40	/**< VLAN marking fields are valid */
 
 /**
+ * IPv4 multicast command rule flags
+ */
+#define NSS_IPV4_MC_RULE_CREATE_FLAG_MC_UPDATE 0x01		/**< Multicast Rule update */
+
+/**
+ * IPv4 multicast command validity flags
+ */
+#define NSS_IPV4_MC_RULE_CREATE_FLAG_QOS_VALID 0x01		/**< QoS fields are valid */
+#define NSS_IPV4_MC_RULE_CREATE_FLAG_DSCP_MARKING_VALID 0x02	/**< DSCP fields are valid */
+#define NSS_IPV4_MC_RULE_CREATE_FLAG_INGRESS_VLAN_VALID 0x04	/**< Ingress VLAN fields are valid */
+#define NSS_IPV4_MC_RULE_CREATE_FLAG_INGRESS_PPPOE 0x08		/**< Ingress PPPoE fields are valid */
+
+/**
+ * IPv4 multicast connection per-interface rule flags (to be used with rule_flags field of nss_ipv4_mc_if_rule structure)
+ */
+#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_BRIDGE_FLOW 0x01	/**< Bridge Flow */
+#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_ROUTED_FLOW 0x02	/**< Routed flow */
+#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_JOIN 0x04		/**< Interface has joined the flow */
+#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_LEAVE 0x08		/**< Interface has left the flow */
+
+/**
+ * IPv4 multicast connection per-interface valid flags (to be used with valid_flags field of nss_ipv4_mc_if_rule structure)
+ */
+#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_VLAN_VALID 0x01		/**< VLAN fields are valid */
+#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_PPPOE_VALID 0x02	/**< PPPoE fields are valid */
+#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_NAT_VALID 0x4		/**< Interface is configured with Source-NAT */
+
+/**
  * Common 5 tuple structure
  */
 struct nss_ipv4_5tuple {
@@ -153,7 +182,8 @@
  * Error types for ipv4 messages
  */
 enum nss_ipv4_error_response_types {
-	NSS_IPV4_CR_INVALID_PNODE_ERROR = 1,			/**< NSS Error: Invalid interface number */
+	NSS_IPV4_UNKNOWN_MSG_TYPE = 1,				/**< NSS Error: Unknown error */
+	NSS_IPV4_CR_INVALID_PNODE_ERROR,			/**< NSS Error: Invalid interface number */
 	NSS_IPV4_CR_MISSING_CONNECTION_RULE_ERROR, 		/**< NSS Error: Missing connection rule */
 	NSS_IPV4_CR_BUFFER_ALLOC_FAIL_ERROR,			/**< NSS Error: Buffer allocation failure */
 	NSS_IPV4_CR_PPPOE_SESSION_CREATION_ERROR,		/**< NSS Error: Unable to create PPPoE session */
@@ -162,7 +192,9 @@
 	NSS_IPV4_CR_CONN_CFG_NOT_MULTIPLE_OF_QUANTA_ERROR,	/**< NSS Error: Conn cfg input is not multiple of quanta */
 	NSS_IPV4_CR_CONN_CFG_EXCEEDS_LIMIT_ERROR,		/**< NSS Error: Conn cfg input exceeds max supported connections*/
 	NSS_IPV4_CR_CONN_CFG_MEM_ALLOC_FAIL_ERROR,		/**< NSS Error: Conn cfg mem alloc fail at NSS FW */
-	NSS_IPV4_UNKNOWN_MSG_TYPE,				/**< NSS Error: Unknown error */
+	NSS_IPV4_CR_MULTICAST_INVALID_PROTOCOL,			/**< NSS Error: Invalid L4 protocol for multicast rule create */
+	NSS_IPV4_CR_MULTICAST_UPDATE_INVALID_FLAGS,		/**< NSS Error: Invalid multicast flags for multicast update */
+	NSS_IPV4_CR_MULTICAST_UPDATE_INVALID_IF,		/**< NSS Error: Invalid interface for multicast update */
 	NSS_IPV4_LAST						/**< NSS IPv4 max error response type */
 };
 
@@ -189,6 +221,44 @@
 };
 
 /**
+ * The IPv4 multicast rule create per-interface information
+ */
+struct nss_ipv4_mc_if_rule {
+	uint16_t rule_flags;				/**< Bit flags associated with the rule */
+	uint16_t valid_flags;				/**< Bit flags associated with the validity of parameters */
+	uint32_t xlate_src_ip;				/**< Translated flow IP address */
+	uint32_t xlate_src_ident;			/**< Translated flow ident (e.g. port) */
+	uint32_t egress_vlan_tag[MAX_VLAN_DEPTH];	/**< VLAN Tag stack for the egress packets */
+	uint16_t pppoe_session_id;			/**< PPPoE session ID. */
+	uint16_t pppoe_remote_mac[3];			/**< PPPoE Server MAC address */
+	uint32_t if_num;				/**< Interface number */
+	uint32_t if_mtu;				/**< Interface MTU */
+	uint16_t if_mac[3];				/**< Interface MAC address */
+	uint8_t reserved[2];
+};
+
+/**
+ * The IPv4 multicast rule create sub-message structure.
+ */
+struct nss_ipv4_mc_rule_create_msg {
+	struct nss_ipv4_5tuple tuple;			/**< Holds values of the 5 tuple */
+
+	uint32_t rule_flags;				/**< Multicast command rule flags */
+	uint32_t valid_flags;				/**< Multicast command validity flags */
+	uint32_t src_interface_num;			/**< Source i/f number (virtual/physical) */
+	uint32_t ingress_vlan_tag[MAX_VLAN_DEPTH];	/**< VLAN Tag stack for the ingress packets */
+	uint16_t ingress_pppoe_session_id;		/**< PPPoE session ID at ingress */
+	uint16_t ingress_pppoe_remote_mac[3];		/**< PPPoE Server MAC address */
+	uint32_t qos_tag;				/**< Qos Tag for the rule */
+	uint16_t dest_mac[3];				/**< Destination Multicast MAC address */
+	uint16_t if_count;				/**< Number of destination interfaces */
+	uint8_t egress_dscp;				/**< Egress DSCP value for flow */
+	uint8_t reserved[3];
+
+	struct nss_ipv4_mc_if_rule if_rule[NSS_MC_IF_MAX];	/**< Per if information */
+};
+
+/**
  * The IPv4 rule destroy sub-message structure.
  */
 struct nss_ipv4_rule_destroy_msg {
@@ -319,7 +389,7 @@
 	NSS_EXCEPTION_EVENT_IPV4_TCP_ACK_EXCEEDS_RIGHT_EDGE,		/**<  NSS Exception event: TCP protocol ack exceeds right edge */
 	NSS_EXCEPTION_EVENT_IPV4_TCP_ACK_BEFORE_LEFT_EDGE,		/**<  NSS Exception event: TCP protocol ack before left edge */
 	NSS_EXCEPTION_EVENT_IPV4_UDP_HEADER_INCOMPLETE,			/**<  NSS Exception event: UDP protocol header incomplete */
-	NSS_EXCEPTION_EVENT_IPV4_UDP_NO_ICME,				/**<  NSS Exception event: UDP protocol no IPv6 connection match entry */
+	NSS_EXCEPTION_EVENT_IPV4_UDP_NO_ICME,				/**<  NSS Exception event: UDP protocol no IPv4 connection match entry */
 	NSS_EXCEPTION_EVENT_IPV4_UDP_IP_OPTION,				/**<  NSS Exception event: UDP protocol no ip option */
 	NSS_EXCEPTION_EVENT_IPV4_UDP_IP_FRAGMENT,			/**<  NSS Exception event: UDP protocol no ip fragment */
 	NSS_EXCEPTION_EVENT_IPV4_UDP_SMALL_TTL,				/**<  NSS Exception event: UDP protocol small ttl */
@@ -363,6 +433,10 @@
 	NSS_EXCEPTION_EVENT_IPV4_UDPLITE_IP_FRAGMENT,			/**<  NSS Exception event: UDPLite protocol no ip fragment */
 	NSS_EXCEPTION_EVENT_IPV4_UDPLITE_SMALL_TTL,			/**<  NSS Exception event: UDPLite protocol small ttl */
 	NSS_EXCEPTION_EVENT_IPV4_UDPLITE_NEEDS_FRAGMENTATION,		/**<  NSS Exception event: UDPLite protocol needs fragmentation */
+	NSS_EXCEPTION_EVENT_IPV4_MC_UDP_NO_ICME,			/**<  NSS Exception event: UDP protocol no multicast IPv4 connection match entry */
+	NSS_EXCEPTION_EVENT_IPV4_MC_MEM_ALLOC_FAILURE,			/**<  NSS Exception event: IPv4 Multicast Memory allocation failure */
+	NSS_EXCEPTION_EVENT_IPV4_MC_UPDATE_FAILURE,			/**<  NSS Exception event: IPv4 Multicast rule update failure */
+	NSS_EXCEPTION_EVENT_IPV4_MC_PBUF_ALLOC_FAILURE,			/**<  NSS Exception event: IPv4 Multicast buffer allocation failure */
 	NSS_EXCEPTION_EVENT_IPV4_MAX					/**<  IPv4 exception events max type number */
 };
 
@@ -392,6 +466,18 @@
 				/**< Number of IPv4 connection evictions */
 	uint32_t ipv4_fragmentations;
 				/**< Number of successful IPv4 fragmentations performed*/
+	uint32_t ipv4_mc_connection_create_requests;
+				/**< Number of IPv4 Multicast connection create requests */
+	uint32_t ipv4_mc_connection_update_requests;
+				/**< Number of IPv4 Multicast connection update requests */
+	uint32_t ipv4_mc_connection_create_invalid_interface;
+				/**< Number of IPv4 Multicast connection create requests that had invalid interface */
+	uint32_t ipv4_mc_connection_destroy_requests;
+				/**< Number of IPv4 Multicast connection destroy requests */
+	uint32_t ipv4_mc_connection_destroy_misses;
+				/**< Number of IPv4 Multicast connection destroy requests that missed the cache */
+	uint32_t ipv4_mc_connection_flushes;
+				/**< Number of IPv4 Multicast connection flushes */
 	uint32_t exception_events[NSS_EXCEPTION_EVENT_IPV4_MAX];
 				/**< Number of IPv4 exception events */
 };
@@ -408,6 +494,7 @@
 		struct nss_ipv4_conn_sync conn_stats;	/**< Message: connection stats sync */
 		struct nss_ipv4_node_sync node_stats;	/**< Message: node stats sync */
 		struct nss_ipv4_rule_conn_cfg_msg rule_conn_cfg;	/**< Message: rule connections supported */
+		struct nss_ipv4_mc_rule_create_msg mc_rule_create; /**<Message: Multicast rule create */
 	} msg;
 };
 
diff --git a/exports/nss_ipv6.h b/exports/nss_ipv6.h
index 2d10d1a..b56adc3 100644
--- a/exports/nss_ipv6.h
+++ b/exports/nss_ipv6.h
@@ -37,6 +37,7 @@
 	NSS_IPV6_RX_CONN_STATS_SYNC_MSG,	/**< IPv6 connection stats sync message */
 	NSS_IPV6_RX_NODE_STATS_SYNC_MSG,	/**< IPv6 generic statistics sync message */
 	NSS_IPV6_TX_CONN_CFG_RULE_MSG,		/**< IPv6 connection cfg rule message */
+	NSS_IPV6_TX_CREATE_MC_RULE_MSG,		/**< IPv6 create multicast rule message */
 	NSS_IPV6_MAX_MSG_TYPES,
 };
 
@@ -72,6 +73,33 @@
 #define NSS_IPV6_RULE_CREATE_VLAN_MARKING_VALID 0x40	/**< VLAN marking fields are valid */
 
 /**
+ * IPv6 multicast command rule flags
+ */
+#define NSS_IPV6_MC_RULE_CREATE_FLAG_MC_UPDATE 0x01	/**< Multicast Rule update */
+
+/**
+ * IPv6 multicast command validity flags
+ */
+#define NSS_IPV6_MC_RULE_CREATE_FLAG_QOS_VALID 0x01		/**< QoS fields are valid */
+#define NSS_IPV6_MC_RULE_CREATE_FLAG_DSCP_MARKING_VALID 0x02	/**< DSCP fields are valid */
+#define NSS_IPV6_MC_RULE_CREATE_FLAG_INGRESS_VLAN_VALID 0x04	/**< Ingress VLAN fields are valid */
+#define NSS_IPV6_MC_RULE_CREATE_FLAG_INGRESS_PPPOE 0x08		/**< Ingress PPPoE fields are valid */
+
+/**
+ * IPv6 multicast connection per-interface rule flags (to be used with rule_flags field of nss_ipv4_mc_if_rule structure)
+ */
+#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_BRIDGE_FLOW 0x01	/**< Bridge Flow */
+#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_ROUTED_FLOW 0x02	/**< Routed flow */
+#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_JOIN 0x04		/**< Interface has joined the flow */
+#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_LEAVE 0x08		/**< Interface has left the flow */
+
+/**
+ * IPv6 multicast connection per-interface valid flags (to be used with valid_flags field of nss_ipv4_mc_if_rule structure)
+ */
+#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_VLAN_VALID 0x01		/**< VLAN fields are valid */
+#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_PPPOE_VALID 0x02	/**< PPPoE fields are valid */
+
+/**
  * Exception events from IPv6 bridge/route handler
  */
 enum exception_events_ipv6 {
@@ -116,6 +144,10 @@
 	NSS_EXCEPTION_EVENT_IPV6_UDPLITE_NO_ICME,			/**<  NSS Exception event: UDPLite protocol no IPv6 connection match entry */
 	NSS_EXCEPTION_EVENT_IPV6_UDPLITE_SMALL_HOP_LIMIT,		/**<  NSS Exception event: UDPLite protocol small hop limit reached */
 	NSS_EXCEPTION_EVENT_IPV6_UDPLITE_NEEDS_FRAGMENTATION,		/**<  NSS Exception event: UDPLite protocol needs fragmentation */
+	NSS_EXCEPTION_EVENT_IPV6_MC_UDP_NO_ICME,			/**<  NSS Exception event: UDP protocol no multicast IPv6 connection match entry */
+	NSS_EXCEPTION_EVENT_IPV6_MC_MEM_ALLOC_FAILURE,			/**<  NSS Exception event: IPv6 Multicast Memory allocation failure */
+	NSS_EXCEPTION_EVENT_IPV6_MC_UPDATE_FAILURE,			/**<  NSS Exception event: IPv6 Multicast rule update failure */
+	NSS_EXCEPTION_EVENT_IPV6_MC_PBUF_ALLOC_FAILURE,			/**<  NSS Exception event: IPv6 Multicast buffer allocation failure */
 	NSS_EXCEPTION_EVENT_IPV6_MAX					/**<  IPv6 exception events max type number */
 };
 
@@ -200,7 +232,8 @@
  * Error types for ipv6 messages
  */
 enum nss_ipv6_error_response_types {
-	NSS_IPV6_CR_INVALID_PNODE_ERROR = 1,			/**< NSS Error: Invalid interface number */
+	NSS_IPV6_UNKNOWN_MSG_TYPE = 1,				/**< NSS Error: Unknown error */
+	NSS_IPV6_CR_INVALID_PNODE_ERROR,			/**< NSS Error: Invalid interface number */
 	NSS_IPV6_CR_MISSING_CONNECTION_RULE_ERROR,		/**< NSS Error: Missing connection rule */
 	NSS_IPV6_CR_BUFFER_ALLOC_FAIL_ERROR,			/**< NSS Error: Buffer allocation failure */
 	NSS_IPV6_CR_PPPOE_SESSION_CREATION_ERROR,		/**< NSS Error: Unable to create PPPoE session */
@@ -209,7 +242,9 @@
 	NSS_IPV6_CR_CONN_CFG_NOT_MULTIPLE_OF_QUANTA_ERROR,	/**< NSS Error: Conn cfg input is not multiple of quanta */
 	NSS_IPV6_CR_CONN_CFG_EXCEEDS_LIMIT_ERROR,		/**< NSS Error: Conn cfg input exceeds max supported connections*/
 	NSS_IPV6_CR_CONN_CFG_MEM_ALLOC_FAIL_ERROR,		/**< NSS Error: Conn cfg mem alloc fail at NSS FW */
-	NSS_IPV6_UNKNOWN_MSG_TYPE,				/**< NSS Error: Unknown error */
+	NSS_IPV6_CR_MULTICAST_INVALID_PROTOCOL,			/**< NSS Error: Invalid L4 protocol for multicast rule create */
+	NSS_IPV6_CR_MULTICAST_UPDATE_INVALID_FLAGS,		/**< NSS Error: Invalid multicast flags for multicast update */
+	NSS_IPV6_CR_MULTICAST_UPDATE_INVALID_IF,		/**< NSS Error: Invalid interface for multicast update */
 };
 
 /**
@@ -237,6 +272,42 @@
 };
 
 /**
+ * The IPv6 multicast rule create per-interface information
+ */
+struct nss_ipv6_mc_if_rule {
+	uint16_t rule_flags;				/**< Bit flags associated with the rule for this if */
+	uint16_t valid_flags;				/**< Bit flags associated with the validity of parameters for this if */
+	uint32_t egress_vlan_tag[MAX_VLAN_DEPTH];	/**< VLAN Tag stack for the egress packets */
+	uint16_t pppoe_session_id;			/**< PPPoE session ID. */
+	uint16_t pppoe_remote_mac[3];			/**< PPPoE Server MAC address */
+	uint32_t if_num;				/**< Interface number */
+	uint32_t if_mtu;				/**< Interface`s MTU */
+	uint16_t if_mac[3];				/**< Interface MAC address */
+	uint8_t reserved[2];
+};
+
+/**
+ * The IPv6 multicast rule create sub-message structure.
+ */
+struct nss_ipv6_mc_rule_create_msg {
+	struct nss_ipv6_5tuple tuple;			/**< Holds values of the 5 tuple */
+
+	uint32_t rule_flags;				/**< Multicast command rule flags */
+	uint32_t valid_flags;				/**< Multicast command validity flags */
+	uint32_t src_interface_num;			/**< Source i/f number (virtual/physical) */
+	uint32_t ingress_vlan_tag[MAX_VLAN_DEPTH];	/**< VLAN Tag stack for the ingress packets */
+	uint16_t ingress_pppoe_session_id;		/**< PPPoE session ID at ingress */
+	uint16_t ingress_pppoe_remote_mac[3];		/**< PPPoE Server MAC address */
+	uint32_t qos_tag;				/**< QoS Tag for the flow */
+	uint16_t dest_mac[3];				/**< Destination Multicast MAC address */
+	uint16_t if_count;				/**< Number of destination interfaces */
+	uint8_t egress_dscp;				/**< Egress DSCP value for flow */
+	uint8_t reserved[3];
+
+	struct nss_ipv6_mc_if_rule if_rule[NSS_MC_IF_MAX];	/**< Per interface information */
+};
+
+/**
  * The IPv6 rule destroy sub-message structure.
  */
 struct nss_ipv6_rule_destroy_msg {
@@ -359,6 +430,18 @@
 				/**< Number of successful IPv6 fragmentations */
 	uint32_t ipv6_frag_fails;
 				/**< Number of IPv6 fragmentation fails */
+	uint32_t ipv6_mc_connection_create_requests;
+				/**< Number of IPv6 Multicast connection create requests */
+	uint32_t ipv6_mc_connection_update_requests;
+				/**< Number of IPv6 Multicast connection update requests */
+	uint32_t ipv6_mc_connection_create_invalid_interface;
+				/**< Number of IPv6 Multicast connection create requests that had invalid interface */
+	uint32_t ipv6_mc_connection_destroy_requests;
+				/**< Number of IPv6 Multicast connection destroy requests */
+	uint32_t ipv6_mc_connection_destroy_misses;
+				/**< Number of IPv6 Multicast connection destroy requests that missed the cache */
+	uint32_t ipv6_mc_connection_flushes;
+				/**< Number of IPv6 Multicast connection flushes */
 	uint32_t exception_events[NSS_EXCEPTION_EVENT_IPV6_MAX];
 				/**< Number of IPv6 exception events */
 };
@@ -375,6 +458,7 @@
 		struct nss_ipv6_conn_sync conn_stats;		/**< Message: stats sync */
 		struct nss_ipv6_node_sync node_stats;		/**< Message: node stats sync */
 		struct nss_ipv6_rule_conn_cfg_msg rule_conn_cfg;/**< Message: rule conn cfg */
+		struct nss_ipv6_mc_rule_create_msg mc_rule_create; /**<Message: Multicast rule create */
 	} msg;
 };
 
diff --git a/nss_core.h b/nss_core.h
index 3eb3581..1d9cffe 100755
--- a/nss_core.h
+++ b/nss_core.h
@@ -239,6 +239,18 @@
 					/* Number of IPv4 connection evictions */
 	NSS_STATS_IPV4_FRAGMENTATIONS,
 					/* Number of successful IPv4 fragmentations performed */
+	NSS_STATS_IPV4_MC_CONNECTION_CREATE_REQUESTS,
+					/* Number of successful IPv4 Multicast create requests */
+	NSS_STATS_IPV4_MC_CONNECTION_UPDATE_REQUESTS,
+					/* Number of successful IPv4 Multicast update requests */
+	NSS_STATS_IPV4_MC_CONNECTION_CREATE_INVALID_INTERFACE,
+					/* Number of IPv4 Multicast connection create requests that had invalid interface */
+	NSS_STATS_IPV4_MC_CONNECTION_DESTROY_REQUESTS,
+					/* Number of IPv4 Multicast connection destroy requests */
+	NSS_STATS_IPV4_MC_CONNECTION_DESTROY_MISSES,
+					/* Number of IPv4 Multicast connection destroy requests that missed the cache */
+	NSS_STATS_IPV4_MC_CONNECTION_FLUSHES,
+					/* Number of IPv4 Multicast connection flushes */
 	NSS_STATS_IPV4_MAX,
 };
 
@@ -295,6 +307,18 @@
 					/* Number of successful IPv6 fragmentations performed */
 	NSS_STATS_IPV6_FRAG_FAILS,
 					/* Number of IPv6 fragmentation fails */
+	NSS_STATS_IPV6_MC_CONNECTION_CREATE_REQUESTS,
+					/* Number of successful IPv6 Multicast create requests */
+	NSS_STATS_IPV6_MC_CONNECTION_UPDATE_REQUESTS,
+					/* Number of successful IPv6 Multicast update requests */
+	NSS_STATS_IPV6_MC_CONNECTION_CREATE_INVALID_INTERFACE,
+					/* Number of IPv6 Multicast connection create requests that had invalid interface */
+	NSS_STATS_IPV6_MC_CONNECTION_DESTROY_REQUESTS,
+					/* Number of IPv6 Multicast connection destroy requests */
+	NSS_STATS_IPV6_MC_CONNECTION_DESTROY_MISSES,
+					/* Number of IPv6 Multicast connection destroy requests that missed the cache */
+	NSS_STATS_IPV6_MC_CONNECTION_FLUSHES,
+					/* Number of IPv6 Multicast connection flushes */
 	NSS_STATS_IPV6_MAX,
 };
 
diff --git a/nss_stats.c b/nss_stats.c
index 9800641..30783a3 100644
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -66,7 +66,13 @@
 	"hash_reorders",
 	"flushes",
 	"evictions",
-	"fragmentations"
+	"fragmentations",
+	"mc_create_requests",
+	"mc_update_requests",
+	"mc_create_invalid_interface",
+	"mc_destroy_requests",
+	"mc_destroy_misses",
+	"mc_flushes",
 };
 
 /*
@@ -99,6 +105,12 @@
 	"evictions",
 	"fragmentations",
 	"frag_fails",
+	"mc_create_requests",
+	"mc_update_requests",
+	"mc_create_invalid_interface",
+	"mc_destroy_requests",
+	"mc_destroy_misses",
+	"mc_flushes",
 };
 
 /*
@@ -291,7 +303,11 @@
 	"IPV4_UDPLITE_IP_OPTION",
 	"IPV4_UDPLITE_IP_FRAGMENT",
 	"IPV4_UDPLITE_SMALL_TTL",
-	"IPV4_UDPLITE_NEEDS_FRAGMENTATION"
+	"IPV4_UDPLITE_NEEDS_FRAGMENTATION",
+	"IPV4_MC_UDP_NO_ICME",
+	"IPV4_MC_MEM_ALLOC_FAILURE",
+	"IPV4_MC_UPDATE_FAILURE",
+	"IPV4_MC_PBUF_ALLOC_FAILURE"
 };
 
 /*
@@ -339,7 +355,11 @@
 	"IPV6_UDPLITE_HEADER_INCOMPLETE",
 	"IPV6_UDPLITE_NO_ICME",
 	"IPV6_UDPLITE_SMALL_HOP_LIMIT",
-	"IPV6_UDPLITE_NEEDS_FRAGMENTATION"
+	"IPV6_UDPLITE_NEEDS_FRAGMENTATION",
+	"IPV6_MC_UDP_NO_ICME",
+	"IPV6_MC_MEM_ALLOC_FAILURE",
+	"IPV6_MC_UPDATE_FAILURE",
+	"IPV6_MC_PBUF_ALLOC_FAILURE"
 };
 
 /*