From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id E011E1B1BC for ; Wed, 24 Jan 2018 16:39:30 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 93602226C8; Wed, 24 Jan 2018 10:39:30 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:39:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=+o7Kq4PVNwCtJmwZb vpK5THVI3cqs/HTiQ0FQ3lcFec=; b=qkU0FoXJAJaT5oxT37Pu1rQ7SAWuLOQUJ R+jRKrxDQuYJa+I6eXa7jEh+yfu8FH1hexPs0QrsdIHwJlA9h8BMBQDNMRYz5pmY cgUQHhbo35cem87R2Qfs4m8uSovPLWS1yZrATjr2OoBImofghQZXz/yqkmQ6YeyW fE5kRBtGvYSaxHQVCKWVpGe9+vTOAgTGFY4kPn04jWmce2eu9bTDj+SeIDMNdPx2 TuZSVd/89UntxoUUM+NQdVq++VVVfFs70LpPp3deLDTT5J750r1yYguJC/lTNDPF 926XsSJKJgRAz4G9XvaHru61IIUdaro41XefPU0Lja8kzVyv2qJHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=+o7Kq4PVNwCtJmwZbvpK5THVI3cqs/HTiQ0FQ3lcFec=; b=hJRt6Ci/ gUkFR0RPVrDIvGCbbUQCqqmXi/d7lA5VWVTS0XrDZCtUnlFGyRg6QH7r3jfRl+NC vlsclIR1qhoVfdBrvossS2DIFNNj63gAbmh0trnxpapKtNybJUXz8TN67BwkX3TZ my+9Sm2l9K2u3lB4MD0pDgQEEOWgErmWQV3bZVNE/dkfHAikUI2OlIkapKixbbhU GmiadaFYosSuADCOYDoLNERRZmWPRyXZfWN4rtfHdKVPdMheGbQZcZSUOKJWHEuy M9b9KGdYFQ+F+UT8zTe5KJm+zNyzVgJ6N88xkCAmnnhp6UyLUTu+eCNBylG4sOPJ JlaAtAT9CbSV5A== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 137607E354; Wed, 24 Jan 2018 10:39:27 -0500 (EST) From: Yuanhan Liu To: Olivier Matz Cc: Laurent Hardy , Beilei Xing , dpdk stable Date: Wed, 24 Jan 2018 23:32:28 +0800 Message-Id: <1516808026-25523-80-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/i40e: fix VSI MAC filter on primary address change' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:39:31 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 3e026d20900e5d42c00a9c91c4c564422579dd7b Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Wed, 3 Jan 2018 15:29:23 +0100 Subject: [PATCH] net/i40e: fix VSI MAC filter on primary address change [ upstream commit 047779508874994fbd905dcc2eeacf78b815e4f4 ] When primary address mac is changed, the mac filters were not updated in the VSI with the new mac addr and incoming packets with this destination address are dropped by the hardware filters. This patch removes the VSI mac filter for the previous mac address and adds a new one for new mac address. Fixes: e18e01e92c29 ("i40e: support default MAC address setting") Signed-off-by: Laurent Hardy Signed-off-by: Olivier Matz Acked-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 14de929..5f1faf1 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -10872,12 +10872,41 @@ static void i40e_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr) { struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); + struct i40e_vsi *vsi = pf->main_vsi; + struct i40e_mac_filter_info mac_filter; + struct i40e_mac_filter *f; + int ret; if (!is_valid_assigned_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Tried to set invalid MAC address."); return; } + TAILQ_FOREACH(f, &vsi->mac_list, next) { + if (is_same_ether_addr(&pf->dev_addr, &f->mac_info.mac_addr)) + break; + } + + if (f == NULL) { + PMD_DRV_LOG(ERR, "Failed to find filter for default mac"); + return; + } + + mac_filter = f->mac_info; + ret = i40e_vsi_delete_mac(vsi, &mac_filter.mac_addr); + if (ret != I40E_SUCCESS) { + PMD_DRV_LOG(ERR, "Failed to delete mac filter"); + return; + } + memcpy(&mac_filter.mac_addr, mac_addr, ETH_ADDR_LEN); + ret = i40e_vsi_add_mac(vsi, &mac_filter); + if (ret != I40E_SUCCESS) { + PMD_DRV_LOG(ERR, "Failed to add mac filter"); + return; + } + memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN); + /* Flags: 0x3 updates port address */ i40e_aq_mac_address_write(hw, 0x3, mac_addr->addr_bytes, NULL); } -- 2.7.4