DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: output details on failure to configure filter
@ 2017-02-04  8:28 Wei Dai
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Dai @ 2017-02-04  8:28 UTC (permalink / raw)
  To: dev; +Cc: helin.zhang, konstantin.ananyev, Wei Dai

Add more details when the filter mode can't be successfully configured.
These details tell user what filter configuration is right.

Reported-by: Yulong Pei <yulong.pei@intel.com>
Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_fdir.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 3b9d60c..a23581f 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -628,16 +628,25 @@ ixgbe_fdir_configure(struct rte_eth_dev *dev)
 		hw->mac.type != ixgbe_mac_X540 &&
 		hw->mac.type != ixgbe_mac_X550 &&
 		hw->mac.type != ixgbe_mac_X550EM_x &&
-		hw->mac.type != ixgbe_mac_X550EM_a)
+		hw->mac.type != ixgbe_mac_X550EM_a) {
+		PMD_INIT_LOG(err, "Only when ixgbe MAC type is 82599EB or X540 or X550 "
+			"or X550EM_x or X550EM_a, a filter mode can be supported. "
+			"Current MAC type = %d", (int)(hw->mac.type));
 		return -ENOSYS;
+	}
 
 	/* x550 supports mac-vlan and tunnel mode but other NICs not */
 	if (hw->mac.type != ixgbe_mac_X550 &&
 	    hw->mac.type != ixgbe_mac_X550EM_x &&
 	    hw->mac.type != ixgbe_mac_X550EM_a &&
 	    mode != RTE_FDIR_MODE_SIGNATURE &&
-	    mode != RTE_FDIR_MODE_PERFECT)
+	    mode != RTE_FDIR_MODE_PERFECT) {
+		PMD_INIT_LOG(err, "If ixgbe MAC type is not X550 or X550EM_x or "
+			"X550EM_a, the filter mode must be signature or perfect, other mode "
+			"is not supported ! Current MAC type = %d filter mode = %d",
+			(int)(hw->mac.type), (int)mode);
 		return -ENOSYS;
+	}
 
 	err = configure_fdir_flags(&dev->data->dev_conf.fdir_conf, &fdirctrl);
 	if (err)
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: output details on failure to configure filter
  2017-02-04  8:37 Wei Dai
@ 2017-02-04 21:50 ` Stephen Hemminger
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2017-02-04 21:50 UTC (permalink / raw)
  To: Wei Dai; +Cc: dev, helin.zhang, konstantin.ananyev

On Sat,  4 Feb 2017 16:37:54 +0800
Wei Dai <wei.dai@intel.com> wrote:

> +		PMD_INIT_LOG(ERR, "If ixgbe MAC type is not X550 or X550EM_x or "
> +			"X550EM_a, the filter mode must be signature or perfect, other mode "
> +			"is not supported ! Current MAC type = %d filter mode = %d",
> +			(int)(hw->mac.type), (int)mode);
>  		return -ENOSYS;

Having better messages is good. Please punctuate correctly, and ! is not necessary.

Please try and keep it to one line, having really long log messages doesn't help.
Also, breaking a string makes it harder to use grep to find the source.

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

* [dpdk-dev] [PATCH] net/ixgbe: output details on failure to configure filter
@ 2017-02-04  8:37 Wei Dai
  2017-02-04 21:50 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Dai @ 2017-02-04  8:37 UTC (permalink / raw)
  To: dev; +Cc: helin.zhang, konstantin.ananyev, Wei Dai

Add more details when the filter mode can't be successfully configured.
These details tell user what filter configuration is right.

Reported-by: Yulong Pei <yulong.pei@intel.com>
Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_fdir.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 3b9d60c..98ff956 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -628,16 +628,25 @@ ixgbe_fdir_configure(struct rte_eth_dev *dev)
 		hw->mac.type != ixgbe_mac_X540 &&
 		hw->mac.type != ixgbe_mac_X550 &&
 		hw->mac.type != ixgbe_mac_X550EM_x &&
-		hw->mac.type != ixgbe_mac_X550EM_a)
+		hw->mac.type != ixgbe_mac_X550EM_a) {
+		PMD_INIT_LOG(ERR, "Only when ixgbe MAC type is 82599EB or X540 or X550 "
+			"or X550EM_x or X550EM_a, a filter mode can be supported. "
+			"Current MAC type = %d", (int)(hw->mac.type));
 		return -ENOSYS;
+	}
 
 	/* x550 supports mac-vlan and tunnel mode but other NICs not */
 	if (hw->mac.type != ixgbe_mac_X550 &&
 	    hw->mac.type != ixgbe_mac_X550EM_x &&
 	    hw->mac.type != ixgbe_mac_X550EM_a &&
 	    mode != RTE_FDIR_MODE_SIGNATURE &&
-	    mode != RTE_FDIR_MODE_PERFECT)
+	    mode != RTE_FDIR_MODE_PERFECT) {
+		PMD_INIT_LOG(ERR, "If ixgbe MAC type is not X550 or X550EM_x or "
+			"X550EM_a, the filter mode must be signature or perfect, other mode "
+			"is not supported ! Current MAC type = %d filter mode = %d",
+			(int)(hw->mac.type), (int)mode);
 		return -ENOSYS;
+	}
 
 	err = configure_fdir_flags(&dev->data->dev_conf.fdir_conf, &fdirctrl);
 	if (err)
-- 
2.7.4

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

end of thread, other threads:[~2017-02-04 21:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-04  8:28 [dpdk-dev] [PATCH] net/ixgbe: output details on failure to configure filter Wei Dai
2017-02-04  8:37 Wei Dai
2017-02-04 21:50 ` Stephen Hemminger

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).