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 AEAB44547F; Mon, 17 Jun 2024 11:54:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32AE840BA6; Mon, 17 Jun 2024 11:53:39 +0200 (CEST) Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) by mails.dpdk.org (Postfix) with ESMTP id 05C7340695; Mon, 17 Jun 2024 11:53:36 +0200 (CEST) X-QQ-mid: bizesmtpsz13t1718618014tec9jg X-QQ-Originating-IP: JMGNk4uh/XjF4DQogMs+l8e92FFqUOGuaKFwQwoCEHA= Received: from lap-jiawenwu.trustnetic.com ( [183.159.97.141]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 17 Jun 2024 17:53:33 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2957161825876928062 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 06/19] net/txgbe: fix VF promiscuous and allmulticast Date: Mon, 17 Jun 2024 17:53:16 +0800 Message-Id: <20240617095319.16664-7-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20240617095319.16664-1-jiawenwu@trustnetic.com> References: <20240617095319.16664-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpsz:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz8a-1 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 The configuration of allmulti and promiscuous modes conflicts together. For instance, if we enable promiscuous mode, then enable and disable allmulti, then the promiscuous mode is wrongly disabled. Fix this behavior by: - doing nothing when we set/unset allmulti if promiscuous mode is on - restorting the proper mode (none or allmulti) when we disable promiscuous mode Fixes: 29072d593fe4 ("net/txgbe: support VF promiscuous and allmulticast") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_ethdev_vf.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c index ec40419289..6ac34058ab 100644 --- a/drivers/net/txgbe/txgbe_ethdev_vf.c +++ b/drivers/net/txgbe/txgbe_ethdev_vf.c @@ -1202,9 +1202,13 @@ static int txgbevf_dev_promiscuous_disable(struct rte_eth_dev *dev) { struct txgbe_hw *hw = TXGBE_DEV_HW(dev); + int mode = TXGBEVF_XCAST_MODE_NONE; int ret; - switch (hw->mac.update_xcast_mode(hw, TXGBEVF_XCAST_MODE_NONE)) { + if (dev->data->all_multicast) + mode = TXGBEVF_XCAST_MODE_ALLMULTI; + + switch (hw->mac.update_xcast_mode(hw, mode)) { case 0: ret = 0; break; @@ -1225,6 +1229,9 @@ txgbevf_dev_allmulticast_enable(struct rte_eth_dev *dev) struct txgbe_hw *hw = TXGBE_DEV_HW(dev); int ret; + if (dev->data->promiscuous) + return 0; + switch (hw->mac.update_xcast_mode(hw, TXGBEVF_XCAST_MODE_ALLMULTI)) { case 0: ret = 0; @@ -1246,6 +1253,9 @@ txgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev) struct txgbe_hw *hw = TXGBE_DEV_HW(dev); int ret; + if (dev->data->promiscuous) + return 0; + switch (hw->mac.update_xcast_mode(hw, TXGBEVF_XCAST_MODE_MULTI)) { case 0: ret = 0; -- 2.27.0