From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE7B0A0C41; Thu, 24 Jun 2021 09:46:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7AA2840141; Thu, 24 Jun 2021 09:46:00 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 5CFDC4003C for ; Thu, 24 Jun 2021 09:45:59 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 21C9532004CE; Thu, 24 Jun 2021 03:45:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 24 Jun 2021 03:45:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= 9ipBmHCypF3BhdhdRgdrHs+OGV73Z9xpsWJxADYCWXU=; b=KuIvET7OhYaoQEMI d9HMgmPeAp/Rioh6WxeygR8K5S3S4hikpMYRtSw+8x49vQON9HpYZrbPrwJygJyc ouu3tXiazSSkqjAJx+qTAXnuG6qaWjOiuYSskTYOZiX6CKS3HuwWo3B7nfnp/a8B NHPWGGpWMQxLARXOdVTVzH7wvXWrD5hV10pdXPCHKONVUiEGY/tKwIg3hy3F+2G7 W5WROZzUsWJA9nD5jrnJbZzzfg2DZd7EJ/9P8nv+xM9cGpgyxPB7mKoLxZnlCHOH GF4C4LcR5ZzK64pGQO5FT6PG6+pqNKUK4MvVD+6kbQEk/5vl0rLh89r3jvQNbCE2 j7MAIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=9ipBmHCypF3BhdhdRgdrHs+OGV73Z9xpsWJxADYCW XU=; b=CI5vFl1KrkbZBDxIzCUJPnpRMfX7M+6IX3hC8tgMZ4zofzNGUqgwLA1DG 0G6EcG9t9x1rpXZ0ppQaiOQJQkKAA4yvO175xURybPf+EXhyvbHn+OcRlSEYfmCd UrNxFSbwDJDlGhvHWDdo/z+sc+TBGDjHfEIYUMpyWGQ3dQxvgYwHtCver9IqPEt8 T7MJFtjzd/mc8msGwdB95atHvsVYVSPhOR7qE+kufsxdx/5arDhMuNBHCnC64lRb woGp62IE1huq3DgxwUcNDFmO1Zd5GqFtW/omGkmyfjV9dwBIst9B2dTeh+oEV8Ms YL0iVGTB4gpLWKP9Wvqxp2TuMfFlA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeggedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Jun 2021 03:45:56 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, "Min Hu (Connor)" , ajit.khaparde@broadcom.com, stephen@networkplumber.org Date: Thu, 24 Jun 2021 09:45:54 +0200 Message-ID: <1850388.lIl0hZ3jcu@thomas> In-Reply-To: <1619165562-50959-1-git-send-email-humin29@huawei.com> References: <1619165562-50959-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] kni: check code of allmulticast mode switch X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Waiting for review 23/04/2021 10:12, Min Hu (Connor): > From: Chengwen Feng > > Some drivers may return errcode when switch allmulticast mode, so it's > necessary to check the return code. > > Fixes: b34801d1aa2e ("kni: support allmulticast mode set") > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng > Signed-off-by: Min Hu (Connor) > --- > lib/kni/rte_kni.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c > index 9dae6a8..aa9b5b7 100644 > --- a/lib/kni/rte_kni.c > +++ b/lib/kni/rte_kni.c > @@ -514,6 +514,8 @@ kni_config_promiscusity(uint16_t port_id, uint8_t to_on) > static int > kni_config_allmulticast(uint16_t port_id, uint8_t to_on) > { > + int ret; > + > if (!rte_eth_dev_is_valid_port(port_id)) { > RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id); > return -EINVAL; > @@ -523,11 +525,16 @@ kni_config_allmulticast(uint16_t port_id, uint8_t to_on) > port_id, to_on); > > if (to_on) > - rte_eth_allmulticast_enable(port_id); > + ret = rte_eth_allmulticast_enable(port_id); > else > - rte_eth_allmulticast_disable(port_id); > + ret = rte_eth_allmulticast_disable(port_id); > + if (ret != 0) > + RTE_LOG(ERR, KNI, > + "Failed to %s allmulticast mode for port %u: %s\n", > + to_on ? "enable" : "disable", port_id, > + rte_strerror(-ret)); > > - return 0; > + return ret; > }