From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A78F01B1E8; Fri, 12 Apr 2019 16:03:44 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 07:03:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,341,1549958400"; d="scan'208";a="133735459" Received: from unknown (HELO npg-dpdk-cvl-yingwang-117d94.sh.intel.com) ([10.67.117.94]) by orsmga008.jf.intel.com with ESMTP; 12 Apr 2019 07:03:42 -0700 From: Wang Ying A To: wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, Wang Ying A , stable@dpdk.org Date: Fri, 12 Apr 2019 21:52:19 +0800 Message-Id: <1555077139-244831-3-git-send-email-ying.a.wang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1555077139-244831-1-git-send-email-ying.a.wang@intel.com> References: <1555077139-244831-1-git-send-email-ying.a.wang@intel.com> Subject: [dpdk-dev] [PATCH 2/2] net/ice: fix promiscuous mode 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: , X-List-Received-Date: Fri, 12 Apr 2019 14:03:45 -0000 When device promiscuous mode has already been enabled, if user re-enables the promisc mode, he/she should be prompted with "Promisc has already been enabled" rather than "Failed to enable promisc". Fixes: c945e4bf9063 ("net/ice: support promiscuous mode") Cc: stable@dpdk.org Signed-off-by: Wang Ying A --- drivers/net/ice/ice_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 72831bb..cb82a6f 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2759,7 +2759,9 @@ static int ice_macaddr_set(struct rte_eth_dev *dev, ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0); - if (status != ICE_SUCCESS) + if (status == ICE_ERR_ALREADY_EXISTS) + PMD_DRV_LOG(DEBUG, "Promisc mode has already been enabled"); + else if (status != ICE_SUCCESS) PMD_DRV_LOG(ERR, "Failed to enable promisc, err=%d", status); } -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1F642A0096 for ; Fri, 12 Apr 2019 16:03:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9346F1B1EE; Fri, 12 Apr 2019 16:03:46 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A78F01B1E8; Fri, 12 Apr 2019 16:03:44 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 07:03:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,341,1549958400"; d="scan'208";a="133735459" Received: from unknown (HELO npg-dpdk-cvl-yingwang-117d94.sh.intel.com) ([10.67.117.94]) by orsmga008.jf.intel.com with ESMTP; 12 Apr 2019 07:03:42 -0700 From: Wang Ying A To: wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, Wang Ying A , stable@dpdk.org Date: Fri, 12 Apr 2019 21:52:19 +0800 Message-Id: <1555077139-244831-3-git-send-email-ying.a.wang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1555077139-244831-1-git-send-email-ying.a.wang@intel.com> References: <1555077139-244831-1-git-send-email-ying.a.wang@intel.com> Subject: [dpdk-dev] [PATCH 2/2] net/ice: fix promiscuous mode 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190412135219.ZYTQTfPkrkDPn4ElQIvbAysnAwpJsI1mT5dYRYXCFHg@z> When device promiscuous mode has already been enabled, if user re-enables the promisc mode, he/she should be prompted with "Promisc has already been enabled" rather than "Failed to enable promisc". Fixes: c945e4bf9063 ("net/ice: support promiscuous mode") Cc: stable@dpdk.org Signed-off-by: Wang Ying A --- drivers/net/ice/ice_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 72831bb..cb82a6f 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2759,7 +2759,9 @@ static int ice_macaddr_set(struct rte_eth_dev *dev, ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0); - if (status != ICE_SUCCESS) + if (status == ICE_ERR_ALREADY_EXISTS) + PMD_DRV_LOG(DEBUG, "Promisc mode has already been enabled"); + else if (status != ICE_SUCCESS) PMD_DRV_LOG(ERR, "Failed to enable promisc, err=%d", status); } -- 1.8.3.1