From patchwork Tue Nov 19 13:45:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 63116 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B037EA04B4; Tue, 19 Nov 2019 14:45:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8913AB62; Tue, 19 Nov 2019 14:45:33 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id ED6611F5 for ; Tue, 19 Nov 2019 14:45:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574171131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nHv0RxMqkETI8Njd0QmfBS3SycdR4gS/sACsCjwG1B4=; b=SduYwqBqbdYF14TCQlBNW0E7mYBGtKvHbWVEzHwjcTEmngBJoHSNFHU63YtBNak9vhr3q8 1zDoPZ4dsPCDDVLA/FitI7ksh0lRSOwqtDUt8bHkCx85Ch/MQLt7n4tYoUvpNnFw+X1JrK nhxI0FddhS+5FAFTjM4tzwECwN3gsXQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-370-bWF5NaUmMHCJmwl5EUVMhQ-1; Tue, 19 Nov 2019 08:45:28 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 156C6107ACC5; Tue, 19 Nov 2019 13:45:27 +0000 (UTC) Received: from netdev64.ntdv.lab.eng.bos.redhat.com (wsfd-netdev64.ntdv.lab.eng.bos.redhat.com [10.19.188.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87BB52937F; Tue, 19 Nov 2019 13:45:26 +0000 (UTC) From: Eelco Chaudron To: beilei.xing@intel.com, qi.z.zhang@intel.com Cc: xiao.zhang@intel.com, dev@dpdk.org Date: Tue, 19 Nov 2019 08:45:21 -0500 Message-Id: <20191119134431.13566.87940.stgit@netdev64> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: bWF5NaUmMHCJmwl5EUVMhQ-1 X-Mimecast-Spam-Score: 0 Subject: [dpdk-dev] [PATCH v2] net/i40e: always re-program promiscuous mode on VF interface 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" During a kernel PF reset, this event is propagated to the VF. The DPDK VF PMD will execute the reset task before the PF is done with his. This results in the admin queue message not being responded to leaving the port in "promiscuous" mode. This patch makes sure the promiscuous mode is configured independently of the current admin state. Signed-off-by: Eelco Chaudron Reviewed-by: Xiao Zhang --- v1-v2: In the earlier patch, we would force the vf->promisc_unicast_enabled state to false after a reset. Based on the review comments it was prefered to not take the current state into account when programming. v1 patch was called: net/i40e: force promiscuous state after VF reset drivers/net/i40e/i40e_ethdev_vf.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 5dba092..43f7ab5 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2162,10 +2162,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); int ret; - /* If enabled, just return */ - if (vf->promisc_unicast_enabled) - return 0; - ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled); if (ret == 0) vf->promisc_unicast_enabled = TRUE; @@ -2181,10 +2177,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); int ret; - /* If disabled, just return */ - if (!vf->promisc_unicast_enabled) - return 0; - ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled); if (ret == 0) vf->promisc_unicast_enabled = FALSE; @@ -2200,10 +2192,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); int ret; - /* If enabled, just return */ - if (vf->promisc_multicast_enabled) - return 0; - ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1); if (ret == 0) vf->promisc_multicast_enabled = TRUE; @@ -2219,10 +2207,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); int ret; - /* If enabled, just return */ - if (!vf->promisc_multicast_enabled) - return 0; - ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0); if (ret == 0) vf->promisc_multicast_enabled = FALSE;