DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Yang, Qiming" <qiming.yang@intel.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 4/7] ethdev: change allmulticast callbacks to return status
Date: Thu, 26 Sep 2019 02:00:01 +0000	[thread overview]
Message-ID: <F5DF4F0E3AFEF648ADC1C3C33AD4DBF17A540920@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1569329773-10185-5-git-send-email-arybchenko@solarflare.com>

[snip] ...

Hi, Andrew
I think it's no need to define a 'ret'.
Return -EAGAIN and return 0 is enough.

Qiming

static int
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 46ed70816..c699f3ef0 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -69,8 +69,8 @@ static int ice_rss_hash_conf_get(struct rte_eth_dev *dev,
 				 struct rte_eth_rss_conf *rss_conf);
 static int ice_promisc_enable(struct rte_eth_dev *dev);
 static int ice_promisc_disable(struct rte_eth_dev *dev);
-static void ice_allmulti_enable(struct rte_eth_dev *dev);
-static void ice_allmulti_disable(struct rte_eth_dev *dev);
+static int ice_allmulti_enable(struct rte_eth_dev *dev);
+static int ice_allmulti_disable(struct rte_eth_dev *dev);
 static int ice_vlan_filter_set(struct rte_eth_dev *dev,
 			       uint16_t vlan_id,
 			       int on);
@@ -3152,7 +3152,7 @@ ice_promisc_disable(struct rte_eth_dev *dev)
 	return ret;
 }
 
-static void
+static int
 ice_allmulti_enable(struct rte_eth_dev *dev)
 {
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -3160,15 +3160,26 @@ ice_allmulti_enable(struct rte_eth_dev *dev)
 	struct ice_vsi *vsi = pf->main_vsi;
 	enum ice_status status;
 	uint8_t pmask;
+	int ret = 0;
 
 	pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
 	status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0);
-	if (status != ICE_SUCCESS)
+
+	switch (status) {
+	case ICE_ERR_ALREADY_EXISTS:
+		PMD_DRV_LOG(DEBUG, "Allmulti has already been enabled");
+	case ICE_SUCCESS:
+		break;
+	default:
 		PMD_DRV_LOG(ERR, "Failed to enable allmulti, err=%d", status);
+		ret = -EAGAIN;
+	}
+
+	return ret;
 }
 
-static void
+static int
 ice_allmulti_disable(struct rte_eth_dev *dev)
 {
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -3176,15 +3187,20 @@ ice_allmulti_disable(struct rte_eth_dev *dev)
 	struct ice_vsi *vsi = pf->main_vsi;
 	enum ice_status status;
 	uint8_t pmask;
+	int ret = 0;
 
 	if (dev->data->promiscuous == 1)
-		return; /* must remain in all_multicast mode */
+		return 0; /* must remain in all_multicast mode */
 
 	pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
 	status = ice_clear_vsi_promisc(hw, vsi->idx, pmask, 0);
-	if (status != ICE_SUCCESS)
+	if (status != ICE_SUCCESS) {
 		PMD_DRV_LOG(ERR, "Failed to clear allmulti, err=%d", status);
+		ret = -EAGAIN;
+	}
+
+	return ret;
 }
 

[snip] ...

  reply	other threads:[~2019-09-26  2:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 12:56 [dpdk-dev] [PATCH v2 0/7] ethdev: change allmulticast controls " Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 1/7] ethdev: change allmulticast mode API to return errors Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 2/7] net/failsafe: check code of allmulticast mode switch Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 3/7] net/bonding: " Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 4/7] ethdev: change allmulticast callbacks to return status Andrew Rybchenko
2019-09-26  2:00   ` Yang, Qiming [this message]
2019-09-26  7:41     ` Ferruh Yigit
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 5/7] ethdev: do nothing if all-multicast mode is applied again Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 6/7] app/testpmd: check code of allmulticast mode switch Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 7/7] examples/ipv4_multicast: check allmulticast enable status Andrew Rybchenko
2019-09-24 16:41 ` [dpdk-dev] [PATCH v2 0/7] ethdev: change allmulticast controls to return status Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F5DF4F0E3AFEF648ADC1C3C33AD4DBF17A540920@SHSMSX101.ccr.corp.intel.com \
    --to=qiming.yang@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).