Merge "[qca-nss-drv] OAM Logging"
diff --git a/Makefile b/Makefile
index ec1a3de..441ceb9 100644
--- a/Makefile
+++ b/Makefile
@@ -30,8 +30,10 @@
nss_gre_stats.o \
nss_gre_redir.o \
nss_gre_redir_lag_ds.o \
+ nss_gre_redir_lag_ds_log.o \
nss_gre_redir_lag_ds_stats.o \
nss_gre_redir_lag_us.o \
+ nss_gre_redir_lag_us_log.o \
nss_gre_redir_lag_us_stats.o \
nss_gre_redir_stats.o \
nss_gre_tunnel.o \
@@ -56,6 +58,7 @@
nss_lso_rx.o \
nss_lso_rx_stats.o \
nss_map_t.o \
+ nss_map_t_log.o \
nss_map_t_stats.o \
nss_meminfo.o \
nss_n2h.o \
@@ -67,6 +70,7 @@
nss_profiler.o \
nss_project.o \
nss_portid.o \
+ nss_portid_log.o \
nss_portid_stats.o \
nss_ppe.o \
nss_ppe_stats.o \
@@ -84,6 +88,7 @@
nss_tstamp.o \
nss_tun6rd.o \
nss_trustsec_tx.o \
+ nss_trustsec_tx_log.o \
nss_trustsec_tx_stats.o \
nss_tunipip6.o \
nss_virt_if.o \
diff --git a/Makefile.fsm b/Makefile.fsm
index 36b50b4..4077293 100644
--- a/Makefile.fsm
+++ b/Makefile.fsm
@@ -50,6 +50,7 @@
nss_lso_rx.o \
nss_lso_rx_stats.o \
nss_map_t.o \
+ nss_map_t_log.o \
nss_map_t_stats.o \
nss_n2h.o \
nss_n2h_stats.o \
@@ -59,6 +60,7 @@
nss_pm.o \
nss_profiler.o \
nss_portid.o \
+ nss_portid_log.o \
nss_portid_stats.o \
nss_ppe.o \
nss_ppe_stats.o \
@@ -74,6 +76,7 @@
nss_tstamp.o \
nss_tun6rd.o \
nss_trustsec_tx.o \
+ nss_trustsec_tx_log.o \
nss_trustsec_tx_stats.o \
nss_tunipip6.o \
nss_virt_if.o \
diff --git a/exports/nss_dynamic_interface.h b/exports/nss_dynamic_interface.h
index 21bf200..3a23af6 100644
--- a/exports/nss_dynamic_interface.h
+++ b/exports/nss_dynamic_interface.h
@@ -52,10 +52,10 @@
NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_2,
NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE,
NSS_DYNAMIC_INTERFACE_TYPE_VLAN,
- NSS_DYNAMIC_INTERFACE_TYPE_GRE,
- NSS_DYNAMIC_INTERFACE_TYPE_WIFILI,
NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_3,
+ NSS_DYNAMIC_INTERFACE_TYPE_WIFILI,
NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_4,
+ NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_5,
NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER,
NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER,
NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER,
@@ -75,6 +75,8 @@
NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER_EXCEPTION,
NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US,
NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS,
+ NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER,
+ NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER,
NSS_DYNAMIC_INTERFACE_TYPE_MAX
};
diff --git a/exports/nss_gre.h b/exports/nss_gre.h
index 9ff8de8..1e49c48 100644
--- a/exports/nss_gre.h
+++ b/exports/nss_gre.h
@@ -71,8 +71,10 @@
* Message types for GRE requests and responses.
*/
enum nss_gre_msg_types {
- NSS_GRE_MSG_CONFIGURE = NSS_IF_MAX_MSG_TYPES + 1,
- NSS_GRE_MSG_DECONFIGURE,
+ NSS_GRE_MSG_ENCAP_CONFIGURE = NSS_IF_MAX_MSG_TYPES + 1,
+ NSS_GRE_MSG_DECAP_CONFIGURE,
+ NSS_GRE_MSG_ENCAP_DECONFIGURE,
+ NSS_GRE_MSG_DECAP_DECONFIGURE,
NSS_GRE_MSG_SESSION_STATS,
NSS_GRE_MSG_BASE_STATS,
NSS_GRE_MSG_MAX
@@ -152,6 +154,7 @@
uint32_t mode; /**< GRE TUN or TAP. */
uint32_t ip_type; /**< IPv4 or IPv6 type. */
uint32_t next_node_if_num; /**< To whom to forward packets. */
+ uint32_t sibling_if_num; /**< Sibling interface number. */
uint16_t src_mac[3]; /**< Source MAC address. */
uint16_t dest_mac[3]; /**< Destination MAC address. */
uint8_t ttl; /**< TTL or HOPLIMIT. */
@@ -308,6 +311,7 @@
* net_device
*
* @param[in] if_num NSS interface number.
+ * @param[in] type NSS interface type.
* @param[in] gre_callback Callback for the data.
* @param[in] msg_callback Callback for the message.
* @param[in] netdev Pointer to the associated network device.
@@ -316,7 +320,7 @@
* @return
* Pointer to the NSS core context.
*/
-extern struct nss_ctx_instance *nss_gre_register_if(uint32_t if_num, nss_gre_data_callback_t gre_callback,
+extern struct nss_ctx_instance *nss_gre_register_if(uint32_t if_num, uint32_t type, nss_gre_data_callback_t gre_callback,
nss_gre_msg_callback_t msg_callback, struct net_device *netdev, uint32_t features);
/**
diff --git a/exports/nss_if.h b/exports/nss_if.h
index cd9b26e..853f9bd 100644
--- a/exports/nss_if.h
+++ b/exports/nss_if.h
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018, 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.
@@ -47,6 +47,7 @@
NSS_IF_PAUSE_ON_OFF,
NSS_IF_VSI_ASSIGN,
NSS_IF_VSI_UNASSIGN,
+ NSS_IF_SET_NEXTHOP,
NSS_IF_MAX_MSG_TYPES = 9999,
};
@@ -176,6 +177,14 @@
};
/**
+ * nss_if_set_nexthop
+ * Message to set nexthop for an interface.
+ */
+struct nss_if_set_nexthop {
+ uint32_t nexthop; /**< Nexthop interface number. */
+};
+
+/**
* nss_if_msgs
* Information for physical NSS interface command messages.
*/
@@ -204,6 +213,8 @@
/**< Assign the VSI. */
struct nss_if_vsi_unassign vsi_unassign;
/**< Remove the VSI assignment. */
+ struct nss_if_set_nexthop set_nexthop;
+ /**< Set nexthop of interface. */
};
/**
@@ -299,6 +310,22 @@
nss_tx_status_t nss_if_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_if_msg *nim);
/**
+ * nss_phys_if_set_nexthop
+ * Configure nexthop for an interface.
+ *
+ * @datatypes
+ * nss_ctx_instance
+ *
+ * @param[in] nss_ctx Pointer to the NSS context.
+ * @param[in] if_num Network physical or virtual interface number.
+ * @param[in] nexthop Network physical or virtual interface number.
+ *
+ * @return
+ * Status of the Tx operation.
+ */
+nss_tx_status_t nss_phys_if_set_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint32_t nexthop);
+
+/**
* @}
*/
diff --git a/exports/nss_wifili_if.h b/exports/nss_wifili_if.h
index 449fe26..5ce8daa 100644
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -745,6 +745,7 @@
uint32_t tx_success_bytes; /**< Total number of bytes sent successfully. */
uint32_t tx_nawds_mcast_cnt; /**< Total number of NAWDS multicast packets sent. */
uint32_t tx_nawds_mcast_bytes; /**< Total number of NAWDS multicast bytes sent. */
+ uint32_t transmit_cnt; /**< Total number of frames transmitted. */
};
/**
diff --git a/nss_core.c b/nss_core.c
index a83bc22..530703d 100644
--- a/nss_core.c
+++ b/nss_core.c
@@ -1462,7 +1462,7 @@
*/
nss_assert(if_map->magic == DEV_MAGIC);
- nss_ctx->c2c_start = if_map->c2c_start;
+ nss_ctx->c2c_start = nss_ctx->meminfo_ctx.c2c_start_dma;
nss_top = nss_ctx->nss_top;
spin_lock_bh(&nss_top->lock);
diff --git a/nss_core.h b/nss_core.h
index 70471c7..1d3e170 100644
--- a/nss_core.h
+++ b/nss_core.h
@@ -623,8 +623,10 @@
/* map-t interface event callback function */
nss_gre_msg_callback_t gre_msg_callback;
/* gre interface event callback function */
- nss_gre_data_callback_t gre_data_callback;
- /* gre data callback function */
+ nss_gre_data_callback_t gre_inner_data_callback;
+ /* gre inner data callback function */
+ nss_gre_data_callback_t gre_outer_data_callback;
+ /* gre outer data callback function */
nss_tunipip6_msg_callback_t tunipip6_msg_callback;
/* ipip6 tunnel interface event callback function */
nss_pptp_msg_callback_t pptp_msg_callback;
diff --git a/nss_gre.c b/nss_gre.c
index e262154..fb510e0 100644
--- a/nss_gre.c
+++ b/nss_gre.c
@@ -33,10 +33,10 @@
static atomic64_t pkt_cb_addr = ATOMIC64_INIT(0);
/*
- * nss_gre_rx_handler()
- * GRE rx handler.
+ * nss_gre_inner_rx_handler()
+ * GRE inner rx handler.
*/
-static void nss_gre_rx_handler(struct net_device *dev, struct sk_buff *skb,
+static void nss_gre_inner_rx_handler(struct net_device *dev, struct sk_buff *skb,
__attribute__((unused)) struct napi_struct *napi)
{
nss_gre_data_callback_t cb;
@@ -49,7 +49,28 @@
}
}
- cb = nss_top_main.gre_data_callback;
+ cb = nss_top_main.gre_inner_data_callback;
+ cb(dev, skb, 0);
+}
+
+/*
+ * nss_gre_outer_rx_handler()
+ * GRE outer rx handler.
+ */
+static void nss_gre_outer_rx_handler(struct net_device *dev, struct sk_buff *skb,
+ __attribute__((unused)) struct napi_struct *napi)
+{
+ nss_gre_data_callback_t cb;
+
+ nss_gre_pkt_callback_t scb = (nss_gre_pkt_callback_t)(unsigned long)atomic64_read(&pkt_cb_addr);
+ if (unlikely(scb)) {
+ struct nss_gre_info *info = (struct nss_gre_info *)netdev_priv(dev);
+ if (likely(info->next_dev)) {
+ scb(info->next_dev, skb);
+ }
+ }
+
+ cb = nss_top_main.gre_outer_data_callback;
cb(dev, skb, 0);
}
@@ -255,7 +276,7 @@
* nss_gre_register_if()
* Register data and message handlers for GRE.
*/
-struct nss_ctx_instance *nss_gre_register_if(uint32_t if_num, nss_gre_data_callback_t data_callback,
+struct nss_ctx_instance *nss_gre_register_if(uint32_t if_num, uint32_t type, nss_gre_data_callback_t data_callback,
nss_gre_msg_callback_t event_callback, struct net_device *netdev, uint32_t features)
{
struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_handler_id];
@@ -263,10 +284,25 @@
nss_assert(nss_ctx);
nss_assert(nss_is_dynamic_interface(if_num));
- nss_core_register_subsys_dp(nss_ctx, if_num, nss_gre_rx_handler, NULL, netdev, netdev, features);
+ switch (type) {
+ case NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER:
+ nss_core_register_subsys_dp(nss_ctx, if_num, nss_gre_inner_rx_handler, NULL, netdev, netdev, features);
+ nss_top_main.gre_inner_data_callback = data_callback;
+ break;
+
+ case NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER:
+ nss_core_register_subsys_dp(nss_ctx, if_num, nss_gre_outer_rx_handler, NULL, netdev, netdev, features);
+ nss_top_main.gre_outer_data_callback = data_callback;
+ break;
+
+ default:
+ nss_warning("%p: Unable to register. Wrong interface type %d\n", nss_ctx, type);
+ return NULL;
+ }
+
+ nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type);
nss_top_main.gre_msg_callback = event_callback;
- nss_top_main.gre_data_callback = data_callback;
nss_core_register_handler(nss_ctx, if_num, nss_gre_msg_handler, NULL);
@@ -283,12 +319,19 @@
void nss_gre_unregister_if(uint32_t if_num)
{
struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_handler_id];
+ struct net_device *dev;
nss_assert(nss_ctx);
nss_assert(nss_is_dynamic_interface(if_num));
- nss_core_unregister_subsys_dp(nss_ctx, if_num);
+ dev = nss_cmn_get_interface_dev(nss_ctx, if_num);
+ if (!dev) {
+ nss_warning("%p: Unable to find net device for the interface %d\n", nss_ctx, if_num);
+ return;
+ }
+ nss_core_unregister_subsys_dp(nss_ctx, if_num);
+ nss_core_set_subsys_dp_type(nss_ctx, dev, if_num, NSS_DYNAMIC_INTERFACE_TYPE_NONE);
nss_top_main.gre_msg_callback = NULL;
nss_core_unregister_handler(nss_ctx, if_num);
diff --git a/nss_gre_redir_lag_ds.c b/nss_gre_redir_lag_ds.c
index 5bed7ba..f8c5b65 100644
--- a/nss_gre_redir_lag_ds.c
+++ b/nss_gre_redir_lag_ds.c
@@ -16,6 +16,7 @@
#include "nss_tx_rx_common.h"
#include "nss_gre_redir_lag_ds_stats.h"
+#include "nss_gre_redir_lag_ds_log.h"
#define NSS_GRE_REDIR_LAG_DS_TX_TIMEOUT 3000 /* 3 Seconds */
@@ -148,6 +149,11 @@
}
/*
+ * Trace messages.
+ */
+ nss_gre_redir_lag_ds_log_rx_msg(ngrm);
+
+ /*
* Log failures
*/
nss_core_log_msg_failures(nss_ctx, ncm);
@@ -287,6 +293,11 @@
struct nss_cmn_msg *ncm = &msg->cm;
/*
+ * Trace messages.
+ */
+ nss_gre_redir_lag_ds_log_tx_msg(msg);
+
+ /*
* Sanity check the message. Interface should be a dynamic interface
* of type NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS.
*/
diff --git a/nss_gre_redir_lag_ds_log.c b/nss_gre_redir_lag_ds_log.c
new file mode 100644
index 0000000..41908c0
--- /dev/null
+++ b/nss_gre_redir_lag_ds_log.c
@@ -0,0 +1,164 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2018, 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.
+ **************************************************************************
+ */
+
+/*
+ * nss_gre_redir_lag_ds_log.c
+ * NSS GRE REDIR LAG DS logger file.
+ */
+
+#include "nss_core.h"
+
+/*
+ * nss_gre_redir_lag_ds_log_message_types_str
+ * GRE REDIR LAG DS message strings
+ */
+static int8_t *nss_gre_redir_lag_ds_log_message_types_str[NSS_GRE_REDIR_LAG_DS_MAX_MSG_TYPES] __maybe_unused = {
+ "GRE REDIR LAG DS add station Message",
+ "GRE REDIR LAG DS delete station message",
+ "GRE REDIR LAG DS update station message",
+ "GRE REDIR LAG DS stats sync message",
+};
+
+/*
+ * nss_gre_redir_lag_ds_log_error_response_types_str
+ * Strings for error types for GRE REDIR LAG DS messages
+ */
+static int8_t *nss_gre_redir_lag_ds_log_error_response_types_str[NSS_GRE_REDIR_LAG_ERR_MAX] __maybe_unused = {
+ "GRE REDIR LAG Success",
+ "GRE REDIR LAG Incorrect Interface",
+ "GRE REDIR LAG DS Core Unregister Failed",
+ "GRE REDIR LAG DS STats Index Not Found",
+ "GRE REDIR LAG Dealloc Failed",
+};
+
+/*
+ * nss_gre_redir_lag_ds_log_add_sta_msg()
+ * Log NSS GRE REDIR LAG DS add STA message.
+ */
+static void nss_gre_redir_lag_ds_log_add_sta_msg(struct nss_gre_redir_lag_ds_msg *ngm)
+{
+ struct nss_gre_redir_lag_ds_add_sta_msg *ngasm __maybe_unused = &ngm->msg.add_sta;
+ nss_trace("%p: NSS GRE REDIR LAG DS Add STA Message:\n"
+ "GRE REDIR LAG DS Station MAC Address: %p\n"
+ "GRE REDIR LAG DS Reorder Type: %d\n",
+ ngasm, ngasm->mac, ngasm->reorder_type);
+}
+
+/*
+ * nss_gre_redir_lag_ds_log_del_sta_msg()
+ * Log NSS GRE REDIR LAG DS del STA message.
+ */
+static void nss_gre_redir_lag_ds_log_del_sta_msg(struct nss_gre_redir_lag_ds_msg *ngm)
+{
+ struct nss_gre_redir_lag_ds_delete_sta_msg *ngdsm __maybe_unused = &ngm->msg.del_sta;
+ nss_trace("%p: NSS GRE REDIR LAG DS Del STA Message:\n"
+ "GRE REDIR LAG DS Station MAC Address: %p\n",
+ ngdsm, ngdsm->mac);
+}
+
+/*
+ * nss_gre_redir_lag_ds_log_add_sta_msg()
+ * Log NSS GRE REDIR LAG DS add STA message.
+ */
+static void nss_gre_redir_lag_ds_log_update_sta_msg(struct nss_gre_redir_lag_ds_msg *ngm)
+{
+ struct nss_gre_redir_lag_ds_update_sta_msg *ngusm __maybe_unused = &ngm->msg.update_sta;
+ nss_trace("%p: NSS GRE REDIR LAG DS Update STA Message:\n"
+ "GRE REDIR LAG DS Station MAC Address: %p\n"
+ "GRE REDIR LAG DS Reorder Type: %d\n",
+ ngusm, ngusm->mac, ngusm->reorder_type);
+}
+
+/*
+ * nss_gre_redir_lag_ds_log_verbose()
+ * Log message contents.
+ */
+static void nss_gre_redir_lag_ds_log_verbose(struct nss_gre_redir_lag_ds_msg *ngm)
+{
+ switch (ngm->cm.type) {
+ case NSS_GRE_REDIR_LAG_DS_ADD_STA_MSG:
+ nss_gre_redir_lag_ds_log_add_sta_msg(ngm);
+ break;
+
+ case NSS_GRE_REDIR_LAG_DS_DEL_STA_MSG:
+ nss_gre_redir_lag_ds_log_del_sta_msg(ngm);
+ break;
+
+ case NSS_GRE_REDIR_LAG_DS_UPDATE_STA_MSG:
+ nss_gre_redir_lag_ds_log_update_sta_msg(ngm);
+ break;
+
+ case NSS_GRE_REDIR_LAG_DS_STATS_SYNC_MSG:
+ /*
+ * No log for valid stats message.
+ */
+ break;
+
+ default:
+ nss_warning("%p: Invalid message type\n", ngm);
+ break;
+ }
+}
+
+/*
+ * nss_gre_redir_lag_ds_log_tx_msg()
+ * Log messages transmitted to FW.
+ */
+void nss_gre_redir_lag_ds_log_tx_msg(struct nss_gre_redir_lag_ds_msg *ngm)
+{
+ if (ngm->cm.type >= NSS_GRE_REDIR_LAG_DS_MAX_MSG_TYPES) {
+ nss_warning("%p: Invalid message type\n", ngm);
+ return;
+ }
+
+ nss_info("%p: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type]);
+ nss_gre_redir_lag_ds_log_verbose(ngm);
+}
+
+/*
+ * nss_gre_redir_lag_ds_log_rx_msg()
+ * Log messages received from FW.
+ */
+void nss_gre_redir_lag_ds_log_rx_msg(struct nss_gre_redir_lag_ds_msg *ngm)
+{
+ if (ngm->cm.response >= NSS_CMN_RESPONSE_LAST) {
+ nss_warning("%p: Invalid response\n", ngm);
+ return;
+ }
+
+ if (ngm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ngm->cm.response == NSS_CMN_RESPONSE_ACK)) {
+ nss_info("%p: type[%d]:%s, response[%d]:%s\n", ngm, ngm->cm.type,
+ nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type],
+ ngm->cm.response, nss_cmn_response_str[ngm->cm.response]);
+ goto verbose;
+ }
+
+ if (ngm->cm.error >= NSS_GRE_REDIR_LAG_ERR_MAX) {
+ nss_warning("%p: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n",
+ ngm, ngm->cm.type, nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type],
+ ngm->cm.response, nss_cmn_response_str[ngm->cm.response],
+ ngm->cm.error);
+ goto verbose;
+ }
+
+ nss_info("%p: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n",
+ ngm, ngm->cm.type, nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type],
+ ngm->cm.response, nss_cmn_response_str[ngm->cm.response],
+ ngm->cm.error, nss_gre_redir_lag_ds_log_error_response_types_str[ngm->cm.error]);
+
+verbose:
+ nss_gre_redir_lag_ds_log_verbose(ngm);
+}
diff --git a/nss_gre_redir_lag_ds_log.h b/nss_gre_redir_lag_ds_log.h
new file mode 100644
index 0000000..b091876
--- /dev/null
+++ b/nss_gre_redir_lag_ds_log.h
@@ -0,0 +1,37 @@
+/*
+ ******************************************************************************
+ * Copyright (c) 2018, 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_GRE_REDIR_LAG_DS_LOG_H__
+#define __NSS_GRE_REDIR_LAG_DS_LOG_H__
+
+/*
+ * nss_gre_redir_lag_ds_log.h
+ * NSS GRE REDIR LAG DS Log Header File
+ */
+
+/*
+ * nss_gre_redir_lag_ds_log_tx_msg
+ * Logs a gre redir lag ds message that is sent to the NSS firmware.
+ */
+void nss_gre_redir_lag_ds_log_tx_msg(struct nss_gre_redir_lag_ds_msg *ngm);
+
+/*
+ * nss_gre_redir_lag_ds_log_rx_msg
+ * Logs a gre redir lag ds message that is received from the NSS firmware.
+ */
+void nss_gre_redir_lag_ds_log_rx_msg(struct nss_gre_redir_lag_ds_msg *ngm);
+
+#endif /* __NSS_GRE_REDIR_LAG_DS_LOG_H__ */
diff --git a/nss_gre_redir_lag_us.c b/nss_gre_redir_lag_us.c
index 18690a4..67fa13d 100644
--- a/nss_gre_redir_lag_us.c
+++ b/nss_gre_redir_lag_us.c
@@ -16,6 +16,7 @@
#include "nss_tx_rx_common.h"
#include "nss_gre_redir_lag_us_stats.h"
+#include "nss_gre_redir_lag_us_log.h"
#define NSS_GRE_REDIR_LAG_US_TX_TIMEOUT 3000 /* 3 Seconds */
#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD msecs_to_jiffies(4000)
@@ -200,6 +201,11 @@
BUG_ON(!nss_gre_redir_lag_us_verify_ifnum(ncm->interface));
/*
+ * Trace messages.
+ */
+ nss_gre_redir_lag_us_log_rx_msg(ngrm);
+
+ /*
* Is this a valid request/response packet?
*/
if (ncm->type >= NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES) {
@@ -609,6 +615,11 @@
*/
nss_tx_status_t nss_gre_redir_lag_us_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_msg *ngrm)
{
+ /*
+ * Trace messages.
+ */
+ nss_gre_redir_lag_us_log_tx_msg(ngrm);
+
return nss_gre_redir_lag_us_tx_msg_with_size(nss_ctx, ngrm, NSS_NBUF_PAYLOAD_SIZE);
}
EXPORT_SYMBOL(nss_gre_redir_lag_us_tx_msg);
diff --git a/nss_gre_redir_lag_us_log.c b/nss_gre_redir_lag_us_log.c
new file mode 100644
index 0000000..aeca74d
--- /dev/null
+++ b/nss_gre_redir_lag_us_log.c
@@ -0,0 +1,191 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2018, 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.
+ **************************************************************************
+ */
+
+/*
+ * nss_gre_redir_lag_us_log.c
+ * NSS GRE REDIR LAG US logger file.
+ */
+
+#include "nss_core.h"
+
+/*
+ * nss_gre_redir_lag_us_log_message_types_str
+ * GRE REDIR LAG US message strings
+ */
+static int8_t *nss_gre_redir_lag_us_log_message_types_str[NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES] __maybe_unused = {
+ "GRE REDIR LAG US config Message",
+ "GRE REDIR LAG US add hash node message",
+ "GRE REDIR LAG US delete hash node message",
+ "GRE REDIR LAG US query hash node message",
+ "GRE REDIR LAG US stats sync message",
+ "GRE REDIR LAG US DB hash node message",
+};
+
+/*
+ * nss_gre_redir_lag_us_log_error_response_types_str
+ * Strings for error types for GRE REDIR LAG US messages
+ */
+static int8_t *nss_gre_redir_lag_us_log_error_response_types_str[NSS_GRE_REDIR_LAG_ERR_MAX] __maybe_unused = {
+ "GRE REDIR LAG Success",
+ "GRE REDIR LAG Incorrect Interface",
+ "GRE REDIR LAG US Core Unregister Failed",
+ "GRE REDIR LAG US STats Index Not Found",
+ "GRE REDIR LAG Dealloc Failed",
+};
+
+/*
+ * nss_gre_redir_lag_us_log_config_msg()
+ * Log NSS GRE REDIR LAG US config message.
+ */
+static void nss_gre_redir_lag_us_log_config_msg(struct nss_gre_redir_lag_us_msg *ngm)
+{
+ struct nss_gre_redir_lag_us_config_msg *ngcm __maybe_unused = &ngm->msg.config_us;
+ nss_trace("%p: NSS GRE REDIR LAG Config Message:\n"
+ "GRE REDIR LAG US Hash Mode: %d\n"
+ "GRE REDIR LAG US Number of Slaves: %d\n"
+ "GRE REDIR LAG US Interface Number: %p\n",
+ ngcm, ngcm->hash_mode, ngcm->num_slaves,
+ ngcm->if_num);
+}
+
+/*
+ * nss_gre_redir_lag_us_log_add_hash_node_msg()
+ * Log NSS GRE REDIR LAG US add hash node message.
+ */
+static void nss_gre_redir_lag_us_log_add_hash_node_msg(struct nss_gre_redir_lag_us_msg *ngm)
+{
+ struct nss_gre_redir_lag_us_add_hash_node_msg *ngam __maybe_unused = &ngm->msg.add_hash;
+ nss_trace("%p: NSS GRE REDIR LAG Add Hash Node Message:\n"
+ "GRE REDIR LAG US Interface Number: %d\n"
+ "GRE REDIR LAG US Source MAC: %p\n"
+ "GRE REDIR LAG US Destination MAC: %p\n",
+ ngam, ngam->if_num, ngam->src_mac,
+ ngam->dest_mac);
+}
+
+/*
+ * nss_gre_redir_lag_us_log_del_hash_node_msg()
+ * Log NSS GRE REDIR LAG US del hash node message.
+ */
+static void nss_gre_redir_lag_us_log_del_hash_node_msg(struct nss_gre_redir_lag_us_msg *ngm)
+{
+ struct nss_gre_redir_lag_us_del_hash_node_msg *ngdm __maybe_unused = &ngm->msg.del_hash;
+ nss_trace("%p: NSS GRE REDIR LAG Del Hash Node Message:\n"
+ "GRE REDIR LAG US Source MAC: %p\n"
+ "GRE REDIR LAG US Destination MAC: %p\n",
+ ngdm, ngdm->src_mac,ngdm->dest_mac);
+}
+
+/*
+ * nss_gre_redir_lag_us_log_query_hash_node_msg()
+ * Log NSS GRE REDIR LAG US query hash node message.
+ */
+static void nss_gre_redir_lag_us_log_query_hash_node_msg(struct nss_gre_redir_lag_us_msg *ngm)
+{
+ struct nss_gre_redir_lag_us_query_hash_node_msg *ngqm __maybe_unused = &ngm->msg.query_hash;
+ nss_trace("%p: NSS GRE REDIR LAG Query Hash Node Message:\n"
+ "GRE REDIR LAG US Source MAC: %p\n"
+ "GRE REDIR LAG US Destination MAC: %p\n"
+ "GRE REDIR LAG US Interface Number: %d\n",
+ ngqm, ngqm->src_mac, ngqm->dest_mac,
+ ngqm->ifnum);
+}
+
+/*
+ * nss_gre_redir_lag_us_log_verbose()
+ * Log message contents.
+ */
+static void nss_gre_redir_lag_us_log_verbose(struct nss_gre_redir_lag_us_msg *ngm)
+{
+ switch (ngm->cm.type) {
+ case NSS_GRE_REDIR_LAG_US_CONFIG_MSG:
+ nss_gre_redir_lag_us_log_config_msg(ngm);
+ break;
+
+ case NSS_GRE_REDIR_LAG_US_ADD_HASH_NODE_MSG:
+ nss_gre_redir_lag_us_log_add_hash_node_msg(ngm);
+ break;
+
+ case NSS_GRE_REDIR_LAG_US_DEL_HASH_NODE_MSG:
+ nss_gre_redir_lag_us_log_del_hash_node_msg(ngm);
+ break;
+
+ case NSS_GRE_REDIR_LAG_US_QUERY_HASH_NODE_MSG:
+ nss_gre_redir_lag_us_log_query_hash_node_msg(ngm);
+ break;
+
+ case NSS_GRE_REDIR_LAG_US_CMN_STATS_SYNC_MSG:
+ case NSS_GRE_REDIR_LAG_US_DB_HASH_NODE_MSG:
+ /*
+ * No log for valid stats message.
+ */
+ break;
+
+ default:
+ nss_warning("%p: Invalid message type\n", ngm);
+ break;
+ }
+}
+
+/*
+ * nss_gre_redir_lag_us_log_tx_msg()
+ * Log messages transmitted to FW.
+ */
+void nss_gre_redir_lag_us_log_tx_msg(struct nss_gre_redir_lag_us_msg *ngm)
+{
+ if (ngm->cm.type >= NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES) {
+ nss_warning("%p: Invalid message type\n", ngm);
+ return;
+ }
+
+ nss_info("%p: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type]);
+ nss_gre_redir_lag_us_log_verbose(ngm);
+}
+
+/*
+ * nss_gre_redir_lag_us_log_rx_msg()
+ * Log messages received from FW.
+ */
+void nss_gre_redir_lag_us_log_rx_msg(struct nss_gre_redir_lag_us_msg *ngm)
+{
+ if (ngm->cm.response >= NSS_CMN_RESPONSE_LAST) {
+ nss_warning("%p: Invalid response\n", ngm);
+ return;
+ }
+
+ if (ngm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ngm->cm.response == NSS_CMN_RESPONSE_ACK)) {
+ nss_info("%p: type[%d]:%s, response[%d]:%s\n", ngm, ngm->cm.type,
+ nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type],
+ ngm->cm.response, nss_cmn_response_str[ngm->cm.response]);
+ goto verbose;
+ }
+
+ if (ngm->cm.error >= NSS_GRE_REDIR_LAG_ERR_MAX) {
+ nss_warning("%p: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n",
+ ngm, ngm->cm.type, nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type],
+ ngm->cm.response, nss_cmn_response_str[ngm->cm.response],
+ ngm->cm.error);
+ goto verbose;
+ }
+
+ nss_info("%p: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n",
+ ngm, ngm->cm.type, nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type],
+ ngm->cm.response, nss_cmn_response_str[ngm->cm.response],
+ ngm->cm.error, nss_gre_redir_lag_us_log_error_response_types_str[ngm->cm.error]);
+
+verbose:
+ nss_gre_redir_lag_us_log_verbose(ngm);
+}
diff --git a/nss_gre_redir_lag_us_log.h b/nss_gre_redir_lag_us_log.h
new file mode 100644
index 0000000..cbda8d9
--- /dev/null
+++ b/nss_gre_redir_lag_us_log.h
@@ -0,0 +1,37 @@
+/*
+ ******************************************************************************
+ * Copyright (c) 2018, 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_GRE_REDIR_LAG_US_LOG_H__
+#define __NSS_GRE_REDIR_LAG_US_LOG_H__
+
+/*
+ * nss_gre_redir_lag_us_log.h
+ * NSS GRE REDIR LAG US Log Header File
+ */
+
+/*
+ * nss_gre_redir_lag_us_log_tx_msg
+ * Logs a gre redir lag us message that is sent to the NSS firmware.
+ */
+void nss_gre_redir_lag_us_log_tx_msg(struct nss_gre_redir_lag_us_msg *ngm);
+
+/*
+ * nss_gre_redir_lag_us_log_rx_msg
+ * Logs a gre redir lag us message that is received from the NSS firmware.
+ */
+void nss_gre_redir_lag_us_log_rx_msg(struct nss_gre_redir_lag_us_msg *ngm);
+
+#endif /* __NSS_GRE_REDIR_LAG_US_LOG_H__ */
diff --git a/nss_gre_stats.c b/nss_gre_stats.c
index 7bead7b..e5226be 100644
--- a/nss_gre_stats.c
+++ b/nss_gre_stats.c
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, 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.
@@ -124,6 +124,7 @@
void nss_gre_stats_session_debug_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_session_stats_msg *sstats, uint16_t if_num)
{
int i, j;
+ enum nss_dynamic_interface_type interface_type = nss_dynamic_interface_get_type(nss_ctx, if_num);
spin_lock_bh(&nss_gre_stats_lock);
for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) {
@@ -131,6 +132,12 @@
for (j = 0; j < NSS_GRE_STATS_SESSION_DEBUG_MAX; j++) {
session_debug_stats[i].stats[j] += sstats->stats[j];
}
+
+ if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER) {
+ session_debug_stats[i].stats[NSS_GRE_STATS_SESSION_ENCAP_RX_RECEIVED] += sstats->node_stats.rx_packets;
+ } else if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER) {
+ session_debug_stats[i].stats[NSS_GRE_STATS_SESSION_DECAP_TX_FORWARDED] += sstats->node_stats.tx_packets;
+ }
break;
}
}
diff --git a/nss_hlos_if.h b/nss_hlos_if.h
index bcef4aa..6c64160 100644
--- a/nss_hlos_if.h
+++ b/nss_hlos_if.h
@@ -347,6 +347,6 @@
/* Index number for the next descriptor that will be written by the HLOS in the H2N0 descriptor ring (HLOS owned) */
volatile uint32_t n2h_hlos_index[15];
/* Index number for the next descriptor that will be read by the HLOS in the N2H0 descriptor ring (HLOS owned) */
- uint32_t c2c_start; /* Reserved for future use */
+ uint32_t reserved; /* Reserved for future use */
};
#endif /* __NSS_HLOS_IF_H */
diff --git a/nss_map_t.c b/nss_map_t.c
index 30ecf2a..d165ed3 100644
--- a/nss_map_t.c
+++ b/nss_map_t.c
@@ -16,6 +16,7 @@
#include "nss_tx_rx_common.h"
#include "nss_map_t_stats.h"
+#include "nss_map_t_log.h"
#define NSS_MAP_T_TX_TIMEOUT 3000 /* 3 Seconds */
@@ -123,6 +124,11 @@
BUG_ON(!nss_map_t_verify_if_num(ncm->interface));
/*
+ * Trace Messages
+ */
+ nss_map_t_log_rx_msg(ntm);
+
+ /*
* Is this a valid request/response packet?
*/
if (ncm->type >= NSS_MAP_T_MSG_MAX) {
@@ -211,6 +217,11 @@
struct nss_cmn_msg *ncm = &msg->cm;
/*
+ * Trace Messages
+ */
+ nss_map_t_log_tx_msg(msg);
+
+ /*
* Sanity check the message
*/
if (!nss_is_dynamic_interface(ncm->interface)) {
diff --git a/nss_map_t_log.c b/nss_map_t_log.c
new file mode 100644
index 0000000..27ea92d
--- /dev/null
+++ b/nss_map_t_log.c
@@ -0,0 +1,151 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2018, 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.
+ **************************************************************************
+ */
+
+/*
+ * nss_map_t_log.c
+ * NSS MAP_T logger file.
+ */
+
+#include "nss_core.h"
+
+/*
+ * nss_map_t_log_message_types_str
+ * NSS MAP_T message strings
+ */
+static int8_t *nss_map_t_log_message_types_str[NSS_MAP_T_MSG_MAX] __maybe_unused = {
+ "MAP_T Rule Configure",
+ "MAP_T Rule Deconfigure",
+ "MAP_T Stats",
+};
+
+/*
+ * nss_map_t_log_rule_configure_msg()
+ * Log NSS MAP_T Rule Configure.
+ */
+static void nss_map_t_log_rule_configure_msg(struct nss_map_t_msg *ntm)
+{
+ struct nss_map_t_instance_rule_config_msg *ntcm __maybe_unused = &ntm->msg.create_msg;
+ nss_trace("%p: NSS MAP_T Rule Configure message \n"
+ "MAP_T Rule Seq Number: %d\n"
+ "MAP_T Total Number of Rules: %d\n"
+ "MAP_T Local IPv6 Prefix Length: %d\n"
+ "MAP_T Local IPv4 Prefix: %d\n"
+ "MAP_T Local IPv4 Prefix Length: %d\n"
+ "MAP_T Local EA Bits Length: %d\n"
+ "MAP_T Local PSID Offset: %d\n"
+ "MAP_T Reserved A: %d\n"
+ "MAP_T Remote IPv6 Prefix Length: %d\n"
+ "MAP_T Remote IPv4 Prefix: %d\n"
+ "MAP_T Remote IPv4 Prefix Length: %d\n"
+ "MAP_T Remote EA Bits Length: %d\n"
+ "MAP_T Remote PSID Offset: %d\n"
+ "MAP_T Local MAP Style: %d\n"
+ "MAP_T Remote Map Style: %d\n"
+ "MAP_T Local IPv6 Prefix: %p\n"
+ "MAP_T Reserved B: %p\n"
+ "MAP_T Remote IPv6 Prefix: %p\n"
+ "MAP_T Valid Rule: %d\n",
+ ntcm, ntcm->rule_num, ntcm->total_rules,
+ ntcm->local_ipv6_prefix_len, ntcm->local_ipv4_prefix,
+ ntcm->local_ipv4_prefix_len, ntcm->local_ea_len,
+ ntcm->local_psid_offset, ntcm->reserve_a,
+ ntcm->remote_ipv6_prefix_len,
+ ntcm->remote_ipv4_prefix, ntcm->remote_ipv4_prefix_len,
+ ntcm->remote_ea_len, ntcm->remote_psid_offset,
+ ntcm->local_map_style, ntcm->remote_map_style,
+ ntcm->local_ipv6_prefix, ntcm->reserve_b,
+ ntcm->remote_ipv6_prefix, ntcm->valid_rule);
+}
+
+/*
+ * nss_map_t_log_rule_deconfig_msg()
+ * Log NSS MAP_T Rule Deconfigure.
+ */
+static void nss_map_t_log_rule_deconfig_msg(struct nss_map_t_msg *ntm)
+{
+ struct nss_map_t_instance_rule_deconfig_msg *ntdm __maybe_unused = &ntm->msg.destroy_msg;
+ nss_trace("%p: NSS MAP_T Rule Deconfigure message \n"
+ "MAP_T Interface Number: %d\n",
+ ntdm, ntdm->if_number);
+}
+
+/*
+ * nss_map_t_log_verbose()
+ * Log message contents.
+ */
+static void nss_map_t_log_verbose(struct nss_map_t_msg *ntm)
+{
+ switch (ntm->cm.type) {
+ case NSS_MAP_T_MSG_INSTANCE_RULE_CONFIGURE:
+ nss_map_t_log_rule_configure_msg(ntm);
+ break;
+
+ case NSS_MAP_T_MSG_INSTANCE_RULE_DECONFIGURE:
+ nss_map_t_log_rule_deconfig_msg(ntm);
+ break;
+
+ case NSS_MAP_T_MSG_SYNC_STATS:
+ /*
+ * No log for valid stats message.
+ */
+ break;
+
+ default:
+ nss_trace("%p: Invalid message type\n", ntm);
+ break;
+ }
+}
+
+/*
+ * nss_map_t_log_tx_msg()
+ * Log messages transmitted to FW.
+ */
+void nss_map_t_log_tx_msg(struct nss_map_t_msg *ntm)
+{
+ if (ntm->cm.type >= NSS_MAP_T_MSG_MAX) {
+ nss_warning("%p: Invalid message type\n", ntm);
+ return;
+ }
+
+ nss_info("%p: type[%d]:%s\n", ntm, ntm->cm.type, nss_map_t_log_message_types_str[ntm->cm.type]);
+ nss_map_t_log_verbose(ntm);
+}
+
+/*
+ * nss_map_t_log_rx_msg()
+ * Log messages received from FW.
+ */
+void nss_map_t_log_rx_msg(struct nss_map_t_msg *ntm)
+{
+ if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) {
+ nss_warning("%p: Invalid response\n", ntm);
+ return;
+ }
+
+ if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) {
+ nss_info("%p: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type,
+ nss_map_t_log_message_types_str[ntm->cm.type],
+ ntm->cm.response, nss_cmn_response_str[ntm->cm.response]);
+ goto verbose;
+ }
+
+ nss_info("%p: msg nack - type[%d]:%s, response[%d]:%s\n",
+ ntm, ntm->cm.type, nss_map_t_log_message_types_str[ntm->cm.type],
+ ntm->cm.response, nss_cmn_response_str[ntm->cm.response]);
+
+verbose:
+ nss_map_t_log_verbose(ntm);
+}
diff --git a/nss_map_t_log.h b/nss_map_t_log.h
new file mode 100644
index 0000000..3944889
--- /dev/null
+++ b/nss_map_t_log.h
@@ -0,0 +1,41 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2018, 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_MAP_T_LOG_H
+#define __NSS_MAP_T_LOG_H
+
+/*
+ * nss_map_t.h
+ * NSS MAP_T header file.
+ */
+
+/*
+ * Logger APIs
+ */
+
+/*
+ * nss_map_t_log_tx_msg
+ * Logs a map_t message that is sent to the NSS firmware.
+ */
+void nss_map_t_log_tx_msg(struct nss_map_t_msg *ntm);
+
+/*
+ * nss_map_t_log_rx_msg
+ * Logs a map_t message that is received from the NSS firmware.
+ */
+void nss_map_t_log_rx_msg(struct nss_map_t_msg *ntm);
+
+#endif /* __NSS_MAP_T_LOG_H */
diff --git a/nss_meminfo.c b/nss_meminfo.c
index 719a4aa..1a0d36f 100644
--- a/nss_meminfo.c
+++ b/nss_meminfo.c
@@ -305,6 +305,11 @@
mem_ctx->logbuffer = (struct nss_log_descriptor *)kern_addr;
}
+ if (!strcmp(r->name, "c2c_descs_if_mem_map")) {
+ mem_ctx->c2c_start_memtype = mtype;
+ mem_ctx->c2c_start_dma = dma_addr;
+ }
+
/*
* Flush the updated meminfo request.
*/
diff --git a/nss_meminfo.h b/nss_meminfo.h
index d2f5d1e..c9bb3b9 100644
--- a/nss_meminfo.h
+++ b/nss_meminfo.h
@@ -115,6 +115,8 @@
struct nss_log_descriptor *logbuffer; /* nss_logbuffer virtual address */
uint32_t logbuffer_dma; /* nss_logbuffer physical address */
enum nss_meminfo_memtype logbuffer_memtype; /* Memory type for logbuffer */
+ uint32_t c2c_start_dma; /* nss_c2c start physical address */
+ enum nss_meminfo_memtype c2c_start_memtype; /* Memory type for c2c_start */
struct nss_meminfo_map meminfo_map; /* Meminfo map */
struct nss_meminfo_block_list block_lists[NSS_MEMINFO_MEMTYPE_MAX];
/* Block lists for each memory type */
diff --git a/nss_phys_if.c b/nss_phys_if.c
index 9c0ff00..7c35938 100644
--- a/nss_phys_if.c
+++ b/nss_phys_if.c
@@ -544,6 +544,24 @@
}
/*
+ * nss_phys_if_set_nexthop()
+ * Configures nexthop for an interface
+ */
+nss_tx_status_t nss_phys_if_set_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint32_t nexthop)
+{
+ struct nss_phys_if_msg nim;
+
+ NSS_VERIFY_CTX_MAGIC(nss_ctx);
+ nss_info("%p: Phys If nexthop will be set to %d, id:%d\n", nss_ctx, nexthop, if_num);
+
+ nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_SET_NEXTHOP,
+ sizeof(struct nss_if_set_nexthop), nss_phys_if_callback, NULL);
+ nim.msg.if_msg.set_nexthop.nexthop = nexthop;
+
+ return nss_phys_if_msg_sync(nss_ctx, &nim);
+}
+
+/*
* nss_get_state()
* Return the NSS initialization state
*/
diff --git a/nss_phys_if.h b/nss_phys_if.h
index da381f6..06386c9 100644
--- a/nss_phys_if.h
+++ b/nss_phys_if.h
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018, 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.
@@ -120,6 +120,7 @@
NSS_PHYS_IF_PAUSE_ON_OFF = NSS_IF_PAUSE_ON_OFF,
NSS_PHYS_IF_VSI_ASSIGN = NSS_IF_VSI_ASSIGN,
NSS_PHYS_IF_VSI_UNASSIGN = NSS_IF_VSI_UNASSIGN,
+ NSS_PHYS_IF_SET_NEXTHOP = NSS_IF_SET_NEXTHOP,
NSS_PHYS_IF_EXTENDED_STATS_SYNC = NSS_IF_MAX_MSG_TYPES + 1,
NSS_PHYS_IF_MAX_MSG_TYPES
};
diff --git a/nss_portid.c b/nss_portid.c
index 41c5967..e3be15d 100644
--- a/nss_portid.c
+++ b/nss_portid.c
@@ -16,6 +16,7 @@
#include "nss_tx_rx_common.h"
#include "nss_portid_stats.h"
+#include "nss_portid_log.h"
/*
* Spinlock to protect portid interface create/destroy/update
@@ -51,6 +52,11 @@
BUG_ON(ncm->interface != NSS_PORTID_INTERFACE);
/*
+ * Trace Messages
+ */
+ nss_portid_log_rx_msg(npm);
+
+ /*
* Is this a valid request/response packet?
*/
if (ncm->type >= NSS_PORTID_MAX_MSG_TYPE) {
@@ -170,6 +176,11 @@
struct nss_cmn_msg *ncm = &msg->cm;
/*
+ * Trace Messages
+ */
+ nss_portid_log_tx_msg(msg);
+
+ /*
* Sanity check the message
*/
if (ncm->interface != NSS_PORTID_INTERFACE) {
diff --git a/nss_portid_log.c b/nss_portid_log.c
new file mode 100644
index 0000000..4ac1484
--- /dev/null
+++ b/nss_portid_log.c
@@ -0,0 +1,129 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2018, 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.
+ **************************************************************************
+ */
+
+/*
+ * nss_portid_log.c
+ * NSS PORTID logger file.
+ */
+
+#include "nss_core.h"
+
+/*
+ * nss_portid_log_message_types_str
+ * NSS PORTID message strings
+ */
+static int8_t *nss_portid_log_message_types_str[NSS_PORTID_MAX_MSG_TYPE] __maybe_unused = {
+ "PORTID Configure",
+ "PORTID Unconfigure",
+ "PORTID Stats",
+};
+
+/*
+ * nss_portid_log_configure_msg()
+ * Log NSS PORTID Configure.
+ */
+static void nss_portid_log_configure_msg(struct nss_portid_msg *npm)
+{
+ struct nss_portid_configure_msg *npcm __maybe_unused = &npm->msg.configure;
+ nss_trace("%p: NSS PORTID Configure message \n"
+ "PORTID Interface Number: %d\n"
+ "PORTID Interface ID: %d\n"
+ "PORTID GMAC ID: %d\n",
+ npcm, npcm->port_if_num,
+ npcm->port_id, npcm->gmac_id);
+}
+
+/*
+ * nss_portid_log_unconfigure_msg()
+ * Log NSS PORTID Unconfigure.
+ */
+static void nss_portid_log_unconfigure_msg(struct nss_portid_msg *npm)
+{
+ struct nss_portid_unconfigure_msg *npum __maybe_unused = &npm->msg.unconfigure;
+ nss_trace("%p: NSS PORTID Configure message \n"
+ "PORTID Interface Number: %d\n"
+ "PORTID Interface ID: %d\n",
+ npum, npum->port_if_num,
+ npum->port_id);
+}
+
+/*
+ * nss_portid_log_verbose()
+ * Log message contents.
+ */
+static void nss_portid_log_verbose(struct nss_portid_msg *npm)
+{
+ switch (npm->cm.type) {
+ case NSS_PORTID_CONFIGURE_MSG:
+ nss_portid_log_configure_msg(npm);
+ break;
+
+ case NSS_PORTID_UNCONFIGURE_MSG:
+ nss_portid_log_unconfigure_msg(npm);
+ break;
+
+ case NSS_PORTID_STATS_SYNC_MSG:
+ /*
+ * No log for valid stats message.
+ */
+ break;
+
+ default:
+ nss_trace("%p: Invalid message type\n", npm);
+ break;
+ }
+}
+
+/*
+ * nss_portid_log_tx_msg()
+ * Log messages transmitted to FW.
+ */
+void nss_portid_log_tx_msg(struct nss_portid_msg *npm)
+{
+ if (npm->cm.type >= NSS_PORTID_MAX_MSG_TYPE) {
+ nss_warning("%p: Invalid message type\n", npm);
+ return;
+ }
+
+ nss_info("%p: type[%d]:%s\n", npm, npm->cm.type, nss_portid_log_message_types_str[npm->cm.type]);
+ nss_portid_log_verbose(npm);
+}
+
+/*
+ * nss_portid_log_rx_msg()
+ * Log messages received from FW.
+ */
+void nss_portid_log_rx_msg(struct nss_portid_msg *npm)
+{
+ if (npm->cm.response >= NSS_CMN_RESPONSE_LAST) {
+ nss_warning("%p: Invalid response\n", npm);
+ return;
+ }
+
+ if (npm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npm->cm.response == NSS_CMN_RESPONSE_ACK)) {
+ nss_info("%p: type[%d]:%s, response[%d]:%s\n", npm, npm->cm.type,
+ nss_portid_log_message_types_str[npm->cm.type],
+ npm->cm.response, nss_cmn_response_str[npm->cm.response]);
+ goto verbose;
+ }
+
+ nss_info("%p: msg nack - type[%d]:%s, response[%d]:%s\n",
+ npm, npm->cm.type, nss_portid_log_message_types_str[npm->cm.type],
+ npm->cm.response, nss_cmn_response_str[npm->cm.response]);
+
+verbose:
+ nss_portid_log_verbose(npm);
+}
diff --git a/nss_portid_log.h b/nss_portid_log.h
new file mode 100644
index 0000000..54d904f
--- /dev/null
+++ b/nss_portid_log.h
@@ -0,0 +1,41 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2018, 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_PORTID_LOG_H
+#define __NSS_PORTID_LOG_H
+
+/*
+ * nss_portid.h
+ * NSS PORTID header file.
+ */
+
+/*
+ * Logger APIs
+ */
+
+/*
+ * nss_portid_log_tx_msg
+ * Logs a portid message that is sent to the NSS firmware.
+ */
+void nss_portid_log_tx_msg(struct nss_portid_msg *ntm);
+
+/*
+ * nss_portid_log_rx_msg
+ * Logs a portid message that is received from the NSS firmware.
+ */
+void nss_portid_log_rx_msg(struct nss_portid_msg *ntm);
+
+#endif /* __NSS_PORTID_LOG_H */
diff --git a/nss_trustsec_tx.c b/nss_trustsec_tx.c
index 842fd53..b84da30 100644
--- a/nss_trustsec_tx.c
+++ b/nss_trustsec_tx.c
@@ -16,6 +16,7 @@
#include "nss_tx_rx_common.h"
#include "nss_trustsec_tx_stats.h"
+#include "nss_trustsec_tx_log.h"
#define NSS_TRUSTSEC_TX_TIMEOUT 3000 /* 3 Seconds */
@@ -41,6 +42,11 @@
BUG_ON(ncm->interface != NSS_TRUSTSEC_TX_INTERFACE);
/*
+ * Trace messages.
+ */
+ nss_trustsec_tx_log_rx_msg(npm);
+
+ /*
* Is this a valid request/response packet?
*/
if (ncm->type >= NSS_TRUSTSEC_TX_MAX_MSG_TYPE) {
@@ -100,6 +106,11 @@
struct nss_cmn_msg *ncm = &msg->cm;
/*
+ * Trace messages.
+ */
+ nss_trustsec_tx_log_tx_msg(msg);
+
+ /*
* Sanity check the message
*/
if (ncm->interface != NSS_TRUSTSEC_TX_INTERFACE) {
diff --git a/nss_trustsec_tx_log.c b/nss_trustsec_tx_log.c
new file mode 100644
index 0000000..d795f71
--- /dev/null
+++ b/nss_trustsec_tx_log.c
@@ -0,0 +1,149 @@
+/*
+ **************************************************************************
+ * Copyright (c) 2018, 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.
+ **************************************************************************
+ */
+
+/*
+ * nss_trustsec_tx_log.c
+ * NSS TRUSTSEC_TX logger file.
+ */
+
+#include "nss_core.h"
+
+/*
+ * nss_trustsec_tx_log_message_types_str
+ * TRUSTSEC_TX message strings
+ */
+static int8_t *nss_trustsec_tx_log_message_types_str[NSS_TRUSTSEC_TX_MAX_MSG_TYPE] __maybe_unused = {
+ "TRUSTSEC_TX Configure Message",
+ "TRUSTSEC_TX Unconfigure Message",
+ "TRUSTSEC_TX Stats Sync",
+};
+
+/*
+ * nss_trustsec_tx_log_error_response_types_str
+ * Strings for error types for TRUSTSEC_TX messages
+ */
+static int8_t *nss_trustsec_tx_log_error_response_types_str[NSS_TRUSTSEC_TX_ERR_UNKNOWN] __maybe_unused = {
+ "TRUSTSEC_TX Invalid Source Interface",
+ "TRUSTSEC_TX Reconfigure Source Interface"
+ "TRUSTSEC_TX Destination Interface Not Found",
+ "TRUSTSEC_TX Not Configured",
+ "TRUSTSEC_TX Unknown Error",
+};
+
+/*
+ * nss_trustsec_tx_log_configure_msg()
+ * Log NSS TRUSTSEC_TX configure message.
+ */
+static void nss_trustsec_tx_log_configure_msg(struct nss_trustsec_tx_msg *ntm)
+{
+ struct nss_trustsec_tx_configure_msg *ntcm __maybe_unused = &ntm->msg.configure;
+ nss_trace("%p: NSS TRUSTSEC_TX Configure Message:\n"
+ "TRUSTSEC_TX Source: %d\n"
+ "TRUSTSEC_TX Destination: %d\n"
+ "TRUSTSEC_TX Security Group Tag: %d\n",
+ ntcm, ntcm->src,
+ ntcm->dest, ntcm->sgt);
+}
+
+/*
+ * nss_trustsec_tx_log_unconfigure_msg()
+ * Log NSS TRUSTSEC_TX unconfigure message.
+ */
+static void nss_trustsec_tx_log_unconfigure_msg(struct nss_trustsec_tx_msg *ntm)
+{
+ struct nss_trustsec_tx_unconfigure_msg *ntcm __maybe_unused = &ntm->msg.unconfigure;
+ nss_trace("%p: NSS TRUSTSEC_TX Unconfigure Message:\n"
+ "TRUSTSEC_TX Source: %d\n"
+ "TRUSTSEC_TX Security Group Tag: %d\n",
+ ntcm, ntcm->src, ntcm->sgt);
+}
+
+/*
+ * nss_trustsec_tx_log_verbose()
+ * Log message contents.
+ */
+static void nss_trustsec_tx_log_verbose(struct nss_trustsec_tx_msg *ntm)
+{
+ switch (ntm->cm.type) {
+ case NSS_TRUSTSEC_TX_CONFIGURE_MSG:
+ nss_trustsec_tx_log_configure_msg(ntm);
+ break;
+
+ case NSS_TRUSTSEC_TX_UNCONFIGURE_MSG:
+ nss_trustsec_tx_log_unconfigure_msg(ntm);
+ break;
+
+ case NSS_TRUSTSEC_TX_STATS_SYNC_MSG:
+ /*
+ * No log for valid stats message.
+ */
+ break;
+
+ default:
+ nss_warning("%p: Invalid message type\n", ntm);
+ break;
+ }
+}
+
+/*
+ * nss_trustsec_tx_log_tx_msg()
+ * Log messages transmitted to FW.
+ */
+void nss_trustsec_tx_log_tx_msg(struct nss_trustsec_tx_msg *ntm)
+{
+ if (ntm->cm.type >= NSS_TRUSTSEC_TX_MAX_MSG_TYPE) {
+ nss_warning("%p: Invalid message type\n", ntm);
+ return;
+ }
+
+ nss_info("%p: type[%d]:%s\n", ntm, ntm->cm.type, nss_trustsec_tx_log_message_types_str[ntm->cm.type]);
+ nss_trustsec_tx_log_verbose(ntm);
+}
+
+/*
+ * nss_trustsec_tx_log_rx_msg()
+ * Log messages received from FW.
+ */
+void nss_trustsec_tx_log_rx_msg(struct nss_trustsec_tx_msg *ntm)
+{
+ if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) {
+ nss_warning("%p: Invalid response\n", ntm);
+ return;
+ }
+
+ if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) {
+ nss_info("%p: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type,
+ nss_trustsec_tx_log_message_types_str[ntm->cm.type],
+ ntm->cm.response, nss_cmn_response_str[ntm->cm.response]);
+ goto verbose;
+ }
+
+ if (ntm->cm.error >= NSS_TRUSTSEC_TX_ERR_UNKNOWN) {
+ nss_warning("%p: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n",
+ ntm, ntm->cm.type, nss_trustsec_tx_log_message_types_str[ntm->cm.type],
+ ntm->cm.response, nss_cmn_response_str[ntm->cm.response],
+ ntm->cm.error);
+ goto verbose;
+ }
+
+ nss_info("%p: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n",
+ ntm, ntm->cm.type, nss_trustsec_tx_log_message_types_str[ntm->cm.type],
+ ntm->cm.response, nss_cmn_response_str[ntm->cm.response],
+ ntm->cm.error, nss_trustsec_tx_log_error_response_types_str[ntm->cm.error]);
+
+verbose:
+ nss_trustsec_tx_log_verbose(ntm);
+}
diff --git a/nss_trustsec_tx_log.h b/nss_trustsec_tx_log.h
new file mode 100644
index 0000000..58633c9
--- /dev/null
+++ b/nss_trustsec_tx_log.h
@@ -0,0 +1,37 @@
+/*
+ ******************************************************************************
+ * Copyright (c) 2018, 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_TRUSTSEC_TX_LOG_H__
+#define __NSS_TRUSTSEC_TX_LOG_H__
+
+/*
+ * nss_trustsec_tx_log.h
+ * NSS TRUSTSEC_TX Log Header File
+ */
+
+/*
+ * nss_trustsec_tx_log_tx_msg
+ * Logs a trustsec_tx message that is sent to the NSS firmware.
+ */
+void nss_trustsec_tx_log_tx_msg(struct nss_trustsec_tx_msg *ncm);
+
+/*
+ * nss_trustsec_tx_log_rx_msg
+ * Logs a trustsec_tx message that is received from the NSS firmware.
+ */
+void nss_trustsec_tx_log_rx_msg(struct nss_trustsec_tx_msg *ncm);
+
+#endif /* __NSS_TRUSTSEC_TX_LOG_H__ */