DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/ice: enable to set HW debug mask
@ 2021-06-29 13:33 Haiyue Wang
  2021-06-29 15:02 ` Zhang, Qi Z
  2021-06-29 16:40 ` [dpdk-dev] [PATCH v2] " Haiyue Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Haiyue Wang @ 2021-06-29 13:33 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, Haiyue Wang, Qiming Yang, Qi Zhang

The HW debug mask is always zero, so user can't enable the related debug
function like ICE_DBG_XXX etc.

Add the devarg 'hw_debug_mask' to set the function like for ICE_DBG_NVM:
  -a 0000:88:00.0,hw_debug_mask=0x80 --log-level=pmd.net.ice.driver:8

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 09e38590e5..5a18663430 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -26,11 +26,13 @@
 #define ICE_SAFE_MODE_SUPPORT_ARG "safe-mode-support"
 #define ICE_PIPELINE_MODE_SUPPORT_ARG  "pipeline-mode-support"
 #define ICE_PROTO_XTR_ARG         "proto_xtr"
+#define ICE_HW_DEBUG_MASK_ARG     "hw_debug_mask"
 
 static const char * const ice_valid_args[] = {
 	ICE_SAFE_MODE_SUPPORT_ARG,
 	ICE_PIPELINE_MODE_SUPPORT_ARG,
 	ICE_PROTO_XTR_ARG,
+	ICE_HW_DEBUG_MASK_ARG,
 	NULL
 };
 
@@ -1836,6 +1838,25 @@ parse_bool(const char *key, const char *value, void *args)
 	return 0;
 }
 
+static int
+parse_u64(const char *key, const char *value, void *args)
+{
+	u64 *num = (u64 *)args;
+	u64 tmp;
+
+	errno = 0;
+	tmp = strtoull(value, NULL, 16);
+	if (errno) {
+		PMD_DRV_LOG(WARNING, "%s: \"%s\" is not a valid u64",
+			    key, value);
+		return -1;
+	}
+
+	*num = tmp;
+
+	return 0;
+}
+
 static int ice_parse_devargs(struct rte_eth_dev *dev)
 {
 	struct ice_adapter *ad =
@@ -1872,6 +1893,11 @@ static int ice_parse_devargs(struct rte_eth_dev *dev)
 	if (ret)
 		goto bail;
 
+	ret = rte_kvargs_process(kvlist, ICE_HW_DEBUG_MASK_ARG,
+				 &parse_u64, &ad->hw.debug_mask);
+	if (ret)
+		goto bail;
+
 bail:
 	rte_kvargs_free(kvlist);
 	return ret;
@@ -5306,6 +5332,7 @@ RTE_PMD_REGISTER_PCI(net_ice, rte_ice_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ice, pci_id_ice_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_ice,
+			      ICE_HW_DEBUG_MASK_ARG "=0xXXX"
 			      ICE_PROTO_XTR_ARG "=[queue:]<vlan|ipv4|ipv6|ipv6_flow|tcp|ip_offset>"
 			      ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>"
 			      ICE_PIPELINE_MODE_SUPPORT_ARG "=<0|1>");
-- 
2.32.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v1] net/ice: enable to set HW debug mask
  2021-06-29 13:33 [dpdk-dev] [PATCH v1] net/ice: enable to set HW debug mask Haiyue Wang
@ 2021-06-29 15:02 ` Zhang, Qi Z
  2021-06-29 16:40 ` [dpdk-dev] [PATCH v2] " Haiyue Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-06-29 15:02 UTC (permalink / raw)
  To: Wang, Haiyue, dev; +Cc: david.marchand, Yang, Qiming



> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Tuesday, June 29, 2021 9:34 PM
> To: dev@dpdk.org
> Cc: david.marchand@redhat.com; Wang, Haiyue <haiyue.wang@intel.com>;
> Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH v1] net/ice: enable to set HW debug mask
> 
> The HW debug mask is always zero, so user can't enable the related debug
> function like ICE_DBG_XXX etc.
> 
> Add the devarg 'hw_debug_mask' to set the function like for ICE_DBG_NVM:
>   -a 0000:88:00.0,hw_debug_mask=0x80 --log-level=pmd.net.ice.driver:8

This looks good, please also update the document (ice.rst).

> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
>  drivers/net/ice/ice_ethdev.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> 09e38590e5..5a18663430 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -26,11 +26,13 @@
>  #define ICE_SAFE_MODE_SUPPORT_ARG "safe-mode-support"
>  #define ICE_PIPELINE_MODE_SUPPORT_ARG  "pipeline-mode-support"
>  #define ICE_PROTO_XTR_ARG         "proto_xtr"
> +#define ICE_HW_DEBUG_MASK_ARG     "hw_debug_mask"
> 
>  static const char * const ice_valid_args[] = {
>  	ICE_SAFE_MODE_SUPPORT_ARG,
>  	ICE_PIPELINE_MODE_SUPPORT_ARG,
>  	ICE_PROTO_XTR_ARG,
> +	ICE_HW_DEBUG_MASK_ARG,
>  	NULL
>  };
> 
> @@ -1836,6 +1838,25 @@ parse_bool(const char *key, const char *value,
> void *args)
>  	return 0;
>  }
> 
> +static int
> +parse_u64(const char *key, const char *value, void *args) {
> +	u64 *num = (u64 *)args;
> +	u64 tmp;
> +
> +	errno = 0;
> +	tmp = strtoull(value, NULL, 16);
> +	if (errno) {
> +		PMD_DRV_LOG(WARNING, "%s: \"%s\" is not a valid u64",
> +			    key, value);
> +		return -1;
> +	}
> +
> +	*num = tmp;
> +
> +	return 0;
> +}
> +
>  static int ice_parse_devargs(struct rte_eth_dev *dev)  {
>  	struct ice_adapter *ad =
> @@ -1872,6 +1893,11 @@ static int ice_parse_devargs(struct rte_eth_dev
> *dev)
>  	if (ret)
>  		goto bail;
> 
> +	ret = rte_kvargs_process(kvlist, ICE_HW_DEBUG_MASK_ARG,
> +				 &parse_u64, &ad->hw.debug_mask);
> +	if (ret)
> +		goto bail;
> +
>  bail:
>  	rte_kvargs_free(kvlist);
>  	return ret;
> @@ -5306,6 +5332,7 @@ RTE_PMD_REGISTER_PCI(net_ice, rte_ice_pmd);
> RTE_PMD_REGISTER_PCI_TABLE(net_ice, pci_id_ice_map);
> RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic |
> vfio-pci");  RTE_PMD_REGISTER_PARAM_STRING(net_ice,
> +			      ICE_HW_DEBUG_MASK_ARG "=0xXXX"
>  			      ICE_PROTO_XTR_ARG
> "=[queue:]<vlan|ipv4|ipv6|ipv6_flow|tcp|ip_offset>"
>  			      ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>"
>  			      ICE_PIPELINE_MODE_SUPPORT_ARG "=<0|1>");
> --
> 2.32.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v2] net/ice: enable to set HW debug mask
  2021-06-29 13:33 [dpdk-dev] [PATCH v1] net/ice: enable to set HW debug mask Haiyue Wang
  2021-06-29 15:02 ` Zhang, Qi Z
@ 2021-06-29 16:40 ` Haiyue Wang
  2021-06-30  3:59   ` Zhang, Qi Z
  1 sibling, 1 reply; 4+ messages in thread
From: Haiyue Wang @ 2021-06-29 16:40 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, Haiyue Wang, Qiming Yang, Qi Zhang

The HW debug mask is always zero, so user can't enable the related debug
function like ICE_DBG_XXX etc, add the devarg 'hw_debug_mask' to set the
debug mask log output at runtime.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
v2: Add the doc in ice.rst
---
 doc/guides/nics/ice.rst      |  8 ++++++++
 drivers/net/ice/ice_ethdev.c | 27 +++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst
index b691008add..22a19b8bba 100644
--- a/doc/guides/nics/ice.rst
+++ b/doc/guides/nics/ice.rst
@@ -209,6 +209,14 @@ Runtime Config Options
   The ``rte_net_ice_dump_proto_xtr_metadata`` routine shows how to
   access the protocol extraction result in ``struct rte_mbuf``.
 
+- ``Hardware debug mask log support`` (default ``0``)
+
+  User can enable the related hardware debug mask such as ICE_DBG_NVM::
+
+    -a 0000:88:00.0,hw_debug_mask=0x80 --log-level=pmd.net.ice.driver:8
+
+  These ICE_DBG_XXX are defined in ``drivers/net/ice/base/ice_type.h``.
+
 Driver compilation and testing
 ------------------------------
 
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 09e38590e5..5a18663430 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -26,11 +26,13 @@
 #define ICE_SAFE_MODE_SUPPORT_ARG "safe-mode-support"
 #define ICE_PIPELINE_MODE_SUPPORT_ARG  "pipeline-mode-support"
 #define ICE_PROTO_XTR_ARG         "proto_xtr"
+#define ICE_HW_DEBUG_MASK_ARG     "hw_debug_mask"
 
 static const char * const ice_valid_args[] = {
 	ICE_SAFE_MODE_SUPPORT_ARG,
 	ICE_PIPELINE_MODE_SUPPORT_ARG,
 	ICE_PROTO_XTR_ARG,
+	ICE_HW_DEBUG_MASK_ARG,
 	NULL
 };
 
@@ -1836,6 +1838,25 @@ parse_bool(const char *key, const char *value, void *args)
 	return 0;
 }
 
+static int
+parse_u64(const char *key, const char *value, void *args)
+{
+	u64 *num = (u64 *)args;
+	u64 tmp;
+
+	errno = 0;
+	tmp = strtoull(value, NULL, 16);
+	if (errno) {
+		PMD_DRV_LOG(WARNING, "%s: \"%s\" is not a valid u64",
+			    key, value);
+		return -1;
+	}
+
+	*num = tmp;
+
+	return 0;
+}
+
 static int ice_parse_devargs(struct rte_eth_dev *dev)
 {
 	struct ice_adapter *ad =
@@ -1872,6 +1893,11 @@ static int ice_parse_devargs(struct rte_eth_dev *dev)
 	if (ret)
 		goto bail;
 
+	ret = rte_kvargs_process(kvlist, ICE_HW_DEBUG_MASK_ARG,
+				 &parse_u64, &ad->hw.debug_mask);
+	if (ret)
+		goto bail;
+
 bail:
 	rte_kvargs_free(kvlist);
 	return ret;
@@ -5306,6 +5332,7 @@ RTE_PMD_REGISTER_PCI(net_ice, rte_ice_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ice, pci_id_ice_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(net_ice,
+			      ICE_HW_DEBUG_MASK_ARG "=0xXXX"
 			      ICE_PROTO_XTR_ARG "=[queue:]<vlan|ipv4|ipv6|ipv6_flow|tcp|ip_offset>"
 			      ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>"
 			      ICE_PIPELINE_MODE_SUPPORT_ARG "=<0|1>");
-- 
2.32.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice: enable to set HW debug mask
  2021-06-29 16:40 ` [dpdk-dev] [PATCH v2] " Haiyue Wang
@ 2021-06-30  3:59   ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-06-30  3:59 UTC (permalink / raw)
  To: Wang, Haiyue, dev; +Cc: david.marchand, Yang, Qiming



> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Wednesday, June 30, 2021 12:41 AM
> To: dev@dpdk.org
> Cc: david.marchand@redhat.com; Wang, Haiyue <haiyue.wang@intel.com>;
> Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH v2] net/ice: enable to set HW debug mask
> 
> The HW debug mask is always zero, so user can't enable the related debug
> function like ICE_DBG_XXX etc, add the devarg 'hw_debug_mask' to set the
> debug mask log output at runtime.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-30  3:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 13:33 [dpdk-dev] [PATCH v1] net/ice: enable to set HW debug mask Haiyue Wang
2021-06-29 15:02 ` Zhang, Qi Z
2021-06-29 16:40 ` [dpdk-dev] [PATCH v2] " Haiyue Wang
2021-06-30  3:59   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).