From patchwork Wed Dec 11 02:11:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Harton X-Patchwork-Id: 63732 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 EACB0A04F1; Wed, 11 Dec 2019 03:11:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4EFC237A2; Wed, 11 Dec 2019 03:11:39 +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 9772123D for ; Wed, 11 Dec 2019 03:11:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1739; q=dns/txt; s=iport; t=1576030297; x=1577239897; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wmqbxdgIX6dtPgf8rH20ThN3jDj9QElzztmtiWOM3yE=; b=Z18/QrhQZYp+ulm/mqZ7BJ0v7C/RMYF19Ajp4tWfZrr7la+57Pqmva1i d9sul+ia1GHUxYl1y7izq5vQ9c17l2jFuhozzkJVhqb1PpUQLtPGFpHYq +YUs7w/qy8Q5aDopFFbwDLEwM/ImgWgI2+CUvKjsRLXBDnpTiFOmwachV 4=; X-IronPort-AV: E=Sophos;i="5.69,301,1571702400"; d="scan'208";a="390423256" Received: from rcdn-core-2.cisco.com ([173.37.93.153]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 11 Dec 2019 02:11:36 +0000 Received: from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com [172.18.5.114]) by rcdn-core-2.cisco.com (8.15.2/8.15.2) with ESMTP id xBB2BaBG027133; Wed, 11 Dec 2019 02:11:36 GMT Received: by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087) id 05A48C63; Tue, 10 Dec 2019 21:11:36 -0500 (EST) From: David Harton To: dev@dpdk.org, wenzhuo.lu@intel.com, konstantin.ananyev@intel.com Cc: David Harton Date: Tue, 10 Dec 2019 21:11:33 -0500 Message-Id: <20191211021133.11342-1-dharton@cisco.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Outbound-SMTP-Client: 172.18.5.114, cpp-rtpbld-31.cisco.com X-Outbound-Node: rcdn-core-2.cisco.com Subject: [dpdk-dev] [PATCH] 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. 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)