From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 646CBA0613 for ; Thu, 26 Sep 2019 04:00:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A76A3288C; Thu, 26 Sep 2019 04:00:07 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A6C2A2862 for ; Thu, 26 Sep 2019 04:00:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 19:00:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,549,1559545200"; d="scan'208";a="340605544" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 25 Sep 2019 19:00:05 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 19:00:04 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 25 Sep 2019 19:00:04 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 25 Sep 2019 19:00:04 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by shsmsx102.ccr.corp.intel.com ([169.254.2.113]) with mapi id 14.03.0439.000; Thu, 26 Sep 2019 10:00:02 +0800 From: "Yang, Qiming" To: Andrew Rybchenko CC: "dev@dpdk.org" Thread-Topic: [PATCH v2 4/7] ethdev: change allmulticast callbacks to return status Thread-Index: AQHVctewnpUbzid81kqjY+74itIhJac9NXpw Date: Thu, 26 Sep 2019 02:00:01 +0000 Message-ID: References: <1568031190-16510-1-git-send-email-arybchenko@solarflare.co <1569329773-10185-5-git-send-email-arybchenko@solarflare.com> In-Reply-To: <1569329773-10185-5-git-send-email-arybchenko@solarflare.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 4/7] ethdev: change allmulticast callbacks to return status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" [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; } =20 -static void +static int ice_allmulti_enable(struct rte_eth_dev *dev) { struct ice_pf *pf =3D 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 =3D pf->main_vsi; enum ice_status status; uint8_t pmask; + int ret =3D 0; =20 pmask =3D ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; =20 status =3D ice_set_vsi_promisc(hw, vsi->idx, pmask, 0); - if (status !=3D 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=3D%d", status); + ret =3D -EAGAIN; + } + + return ret; } =20 -static void +static int ice_allmulti_disable(struct rte_eth_dev *dev) { struct ice_pf *pf =3D 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 =3D pf->main_vsi; enum ice_status status; uint8_t pmask; + int ret =3D 0; =20 if (dev->data->promiscuous =3D=3D 1) - return; /* must remain in all_multicast mode */ + return 0; /* must remain in all_multicast mode */ =20 pmask =3D ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; =20 status =3D ice_clear_vsi_promisc(hw, vsi->idx, pmask, 0); - if (status !=3D ICE_SUCCESS) + if (status !=3D ICE_SUCCESS) { PMD_DRV_LOG(ERR, "Failed to clear allmulti, err=3D%d", status); + ret =3D -EAGAIN; + } + + return ret; } =20 [snip] ...