From patchwork Sun Jan 26 17:32:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Harton X-Patchwork-Id: 65133 X-Patchwork-Delegate: qi.z.zhang@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 88763A052F; Sun, 26 Jan 2020 18:32:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 569AA397D; Sun, 26 Jan 2020 18:32:54 +0100 (CET) Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) by dpdk.org (Postfix) with ESMTP id C656D1B53 for ; Sun, 26 Jan 2020 18:32:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1839; q=dns/txt; s=iport; t=1580059972; x=1581269572; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pq0tYU148Br/lWmeR5T5l9qZ98H/keu2J7zcaxSip4c=; b=VzB+YsGlfEP5dK8hjSjBmnHK51RHYpbwiLvbwpoaCQHx98p0hXs0fyf4 is92c3oRiEHVLe26K2FaXfXPY0L0Damvesc9r6AKgnRxtyLk3dGDoevfn pPhpJcAeq7g5eoE7EKhmxhhItMrRwXZVC5w36PVTSo94wua0oaaU9mZcG k=; X-IronPort-AV: E=Sophos;i="5.70,366,1574121600"; d="scan'208";a="427030614" Received: from rcdn-core-12.cisco.com ([173.37.93.148]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 26 Jan 2020 17:32:51 +0000 Received: from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com [172.18.5.114]) by rcdn-core-12.cisco.com (8.15.2/8.15.2) with ESMTP id 00QHWprk020733; Sun, 26 Jan 2020 17:32:51 GMT Received: by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087) id 73721A9E; Sun, 26 Jan 2020 12:32:51 -0500 (EST) From: David Harton To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, xiaolong.ye@intel.com, David Harton , ivan.boule@6wind.com Date: Sun, 26 Jan 2020 12:32:49 -0500 Message-Id: <20200126173249.27722-1-dharton@cisco.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20191211021133.11342-1-dharton@cisco.com> References: <20191211021133.11342-1-dharton@cisco.com> MIME-Version: 1.0 X-Outbound-SMTP-Client: 172.18.5.114, cpp-rtpbld-31.cisco.com X-Outbound-Node: rcdn-core-12.cisco.com Subject: [dpdk-dev] [PATCH v2] net/ixgbevf: prevent duplicate default mac filter entries 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" The ixgbe PF manages the default VF mac address in a separate list from the additional VF mac filters. librte_ethdev stores the default mac in dev->data->mac_addrs[0], however, the ixgbevf driver re-adds mac_addr[0] when a mac filter is removed. ixgbevf_remove_mac_addr() is modified to avoid (re)adding the default mac when it differs from the permanent mac. Fixes: b6562244b4f3 ("ixgbevf: skip null and permanent mac addresses") Cc: ivan.boule@6wind.com Signed-off-by: David Harton --- drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 2c6fd0f13..49285ce53 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -6209,15 +6209,16 @@ ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index) * The IXGBE_VF_SET_MACVLAN command of the ixgbe-pf driver does * not support the deletion of a given MAC address. * Instead, it imposes to delete all MAC addresses, then to add again - * all MAC addresses with the exception of the one to be deleted. + * all MAC addresses with the exception of the one to be deleted + * and the default mac address (index 0). */ (void) ixgbevf_set_uc_addr_vf(hw, 0, NULL); /* - * Add again all MAC addresses, with the exception of the deleted one - * and of the permanent MAC address. + * Add again all MAC addresses, with the exception of the deleted one, + * the default mac (index 0) and the permanent MAC address. */ - for (i = 0, mac_addr = dev->data->mac_addrs; + for (i = 1, mac_addr = &dev->data->mac_addrs[1]; i < hw->mac.num_rar_entries; i++, mac_addr++) { /* Skip the deleted MAC address */ if (i == index)