DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/sfc: fix promiscuous and allmulticast toggles errors
@ 2020-03-10  9:42 Andrew Rybchenko
  2020-03-11 10:34 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Rybchenko @ 2020-03-10  9:42 UTC (permalink / raw)
  To: dev; +Cc: Igor Romanov, stable

From: Igor Romanov <igor.romanov@oktetlabs.ru>

Returned errors of ethdev callbacks are negative. Internal
sfc funtions return positive errors, so convert them to
negative value.

Fixes: 9039c8125730 ("ethdev: change promiscuous callbacks to return status")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc_ethdev.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 098038fbc..f8867b0ec 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -405,25 +405,37 @@ sfc_dev_filter_set(struct rte_eth_dev *dev, enum sfc_dev_filter_mode mode,
 static int
 sfc_dev_promisc_enable(struct rte_eth_dev *dev)
 {
-	return sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_TRUE);
+	int rc = sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_TRUE);
+
+	SFC_ASSERT(rc >= 0);
+	return -rc;
 }
 
 static int
 sfc_dev_promisc_disable(struct rte_eth_dev *dev)
 {
-	return sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_FALSE);
+	int rc = sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_PROMISC, B_FALSE);
+
+	SFC_ASSERT(rc >= 0);
+	return -rc;
 }
 
 static int
 sfc_dev_allmulti_enable(struct rte_eth_dev *dev)
 {
-	return sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_ALLMULTI, B_TRUE);
+	int rc = sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_ALLMULTI, B_TRUE);
+
+	SFC_ASSERT(rc >= 0);
+	return -rc;
 }
 
 static int
 sfc_dev_allmulti_disable(struct rte_eth_dev *dev)
 {
-	return sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_ALLMULTI, B_FALSE);
+	int rc = sfc_dev_filter_set(dev, SFC_DEV_FILTER_MODE_ALLMULTI, B_FALSE);
+
+	SFC_ASSERT(rc >= 0);
+	return -rc;
 }
 
 static int
-- 
2.17.1


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

end of thread, other threads:[~2020-03-11 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10  9:42 [dpdk-dev] [PATCH] net/sfc: fix promiscuous and allmulticast toggles errors Andrew Rybchenko
2020-03-11 10:34 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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