From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F12AA0518 for ; Fri, 24 Jul 2020 14:11:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 977671C20A; Fri, 24 Jul 2020 14:11:06 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 6B0171C20A for ; Fri, 24 Jul 2020 14:11:03 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id f18so8069869wml.3 for ; Fri, 24 Jul 2020 05:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=In7LfoChVP0GUjoIGtC0g1z/JsEOsVEE5On9z7jrgXc=; b=oXXMHaNqBuAu8qoNmE27tt3I/klWrI3ZuFDzNFN/5yM3djZgzFbcEpQwQrgUe8sflD lmNTStC8B43N9LsYjns05w9ZfltbmMG6O8wcqoGCeZUAUUnZbL+WOKQd5+nAbjhk7dzI lH54xnL51vZu5060kf1LUyPuGePLhTn+CyKKUe1uS0njuZiFkiBLW2GMCADfpsCYsTmo XMnyWnKRN+HKzSiLx6m05yQjc+3QnUqJfToDCyoBU0PyDnzBbqGWq5EBsBsYzYN9yGFv 8ovLenDblyUgtDCTpvT1SlIfV7AHaEiEnu06XD8VTn4UJ9o+u55aIWLNCgXk5Kqkk5y5 X0jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=In7LfoChVP0GUjoIGtC0g1z/JsEOsVEE5On9z7jrgXc=; b=nKcZ7p0pIFShTQhiDCgC2asNC3gQdjQk3NlSHZ+TkFvvxhKiFHjUQ1hK3izVhdBBNF KzaV8edFh475iL0AhAC0C42J6qcUaLBYWFtUfCziChJabdDkgm1yzGfSMaCqh6n2DAPH pyF1lfbKx5Z7UpliBJeGTIXNet52YXorvMEKyLjL54C9IqgwneY1GdC0nvpDe1VvhP7U 0vPYB6QUumlmtPxisyTWutQL7ijwYXc9mXoRbE+KW+YObAipOQ00ODLGk+i3vty6+i8Z oOehSdb3MS791DYv6/PzzVSPviWb+rdAH31TPtPX0X8He3Cqu8lOJv84HQ/ggPmmVUe3 vmCQ== X-Gm-Message-State: AOAM530Emuy3FfdCW1LsYYPYuoNu+DjSQuSMmpqqbKJp/ZZiOgXsmRUE cvdhju6if0KvhPvXGP8ADOn7DgY6WM+wRw== X-Google-Smtp-Source: ABdhPJyVAfLgUYYbwItTiqHCksyRtgGzy6X1SSja+5ZSsWfzBD05ZDbm66Y11Q11jod+TnokaJpoMQ== X-Received: by 2002:a1c:9c0b:: with SMTP id f11mr8340338wme.0.1595592663089; Fri, 24 Jul 2020 05:11:03 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id r16sm1009188wrr.13.2020.07.24.05.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:11:02 -0700 (PDT) From: luca.boccassi@gmail.com To: Chenmin Sun Cc: Beilei Xing , dpdk stable Date: Fri, 24 Jul 2020 13:00:00 +0100 Message-Id: <20200724120030.1863487-162-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: fix flow director Rx writeback packet' has been queued to stable release 19.11.4 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 058c965e7b9afe7bc6de305faba1c69c1c8fab52 Mon Sep 17 00:00:00 2001 From: Chenmin Sun Date: Fri, 17 Jul 2020 22:57:58 +0800 Subject: [PATCH] net/i40e: fix flow director Rx writeback packet [ upstream commit ae6575409ff5609e44d53e1c3014ae77105e8610 ] This patch fixes the fdir cannot receive rx writeback packet issue. The root cause is FDIR interrupt is not correctly enabled. Beside this, to make sure fdir programming works fine when the port is stopped, move the fdir interrupt configure from start/stop to setup/teardown. Fixes: cfd662d22e7b ("net/i40e: fix interrupt throttling setting in PF") Signed-off-by: Chenmin Sun Acked-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 15 ++------------- drivers/net/i40e/i40e_ethdev.h | 2 ++ drivers/net/i40e/i40e_fdir.c | 11 +++++++++++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 225e6920f..c23581123 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2072,7 +2072,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) } } -static void +void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) { struct rte_eth_dev *dev = vsi->adapter->eth_dev; @@ -2099,7 +2099,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) I40E_WRITE_FLUSH(hw); } -static void +void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi) { struct rte_eth_dev *dev = vsi->adapter->eth_dev; @@ -2321,13 +2321,6 @@ i40e_dev_start(struct rte_eth_dev *dev) i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi); } - /* enable FDIR MSIX interrupt */ - if (pf->fdir.fdir_vsi) { - i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi, - I40E_ITR_INDEX_NONE); - i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi); - } - /* Enable all queues which have been configured */ for (nb_rxq = 0; nb_rxq < dev->data->nb_rx_queues; nb_rxq++) { ret = i40e_dev_rx_queue_start(dev, nb_rxq); @@ -2463,10 +2456,6 @@ i40e_dev_stop(struct rte_eth_dev *dev) i40e_vsi_queues_unbind_intr(pf->vmdq[i].vsi); } - if (pf->fdir.fdir_vsi) { - i40e_vsi_queues_unbind_intr(pf->fdir.fdir_vsi); - i40e_vsi_disable_queues_intr(pf->fdir.fdir_vsi); - } /* Clear all queues and release memory */ i40e_dev_clear_queues(dev); diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 295ad593b..1e01b312d 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -1172,6 +1172,7 @@ void i40e_pf_enable_irq0(struct i40e_hw *hw); int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx); void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi); +void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi); int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, struct i40e_vsi_vlan_pvid_info *info); int i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on); @@ -1181,6 +1182,7 @@ uint64_t i40e_parse_hena(const struct i40e_adapter *adapter, uint64_t flags); enum i40e_status_code i40e_fdir_setup_tx_resources(struct i40e_pf *pf); enum i40e_status_code i40e_fdir_setup_rx_resources(struct i40e_pf *pf); int i40e_fdir_setup(struct i40e_pf *pf); +void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi); const struct rte_memzone *i40e_memzone_reserve(const char *name, uint32_t len, int socket_id); diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 239cdbf52..9a2b40b8a 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -222,6 +222,11 @@ i40e_fdir_setup(struct i40e_pf *pf) goto fail_mem; } + /* enable FDIR MSIX interrupt */ + vsi->nb_used_qps = 1; + i40e_vsi_queues_bind_intr(vsi, I40E_ITR_INDEX_NONE); + i40e_vsi_enable_queues_intr(vsi); + /* reserve memory for the fdir programming packet */ snprintf(z_name, sizeof(z_name), "%s_%s_%d", eth_dev->device->driver->name, @@ -267,12 +272,18 @@ i40e_fdir_teardown(struct i40e_pf *pf) vsi = pf->fdir.fdir_vsi; if (!vsi) return; + + /* disable FDIR MSIX interrupt */ + i40e_vsi_queues_unbind_intr(vsi); + i40e_vsi_disable_queues_intr(vsi); + int err = i40e_switch_tx_queue(hw, vsi->base_queue, FALSE); if (err) PMD_DRV_LOG(DEBUG, "Failed to do FDIR TX switch off"); err = i40e_switch_rx_queue(hw, vsi->base_queue, FALSE); if (err) PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off"); + i40e_dev_rx_queue_release(pf->fdir.rxq); pf->fdir.rxq = NULL; i40e_dev_tx_queue_release(pf->fdir.txq); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:54.797442918 +0100 +++ 0162-net-i40e-fix-flow-director-Rx-writeback-packet.patch 2020-07-24 12:53:48.543011229 +0100 @@ -1,8 +1,10 @@ -From ae6575409ff5609e44d53e1c3014ae77105e8610 Mon Sep 17 00:00:00 2001 +From 058c965e7b9afe7bc6de305faba1c69c1c8fab52 Mon Sep 17 00:00:00 2001 From: Chenmin Sun Date: Fri, 17 Jul 2020 22:57:58 +0800 Subject: [PATCH] net/i40e: fix flow director Rx writeback packet +[ upstream commit ae6575409ff5609e44d53e1c3014ae77105e8610 ] + This patch fixes the fdir cannot receive rx writeback packet issue. The root cause is FDIR interrupt is not correctly enabled. @@ -11,7 +13,6 @@ setup/teardown. Fixes: cfd662d22e7b ("net/i40e: fix interrupt throttling setting in PF") -Cc: stable@dpdk.org Signed-off-by: Chenmin Sun Acked-by: Beilei Xing @@ -22,10 +23,10 @@ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c -index 690164320..05d5f2861 100644 +index 225e6920f..c23581123 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c -@@ -2184,7 +2184,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) +@@ -2072,7 +2072,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) } } @@ -34,7 +35,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) { struct rte_eth_dev *dev = vsi->adapter->eth_dev; -@@ -2211,7 +2211,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) +@@ -2099,7 +2099,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) I40E_WRITE_FLUSH(hw); } @@ -43,7 +44,7 @@ i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi) { struct rte_eth_dev *dev = vsi->adapter->eth_dev; -@@ -2433,13 +2433,6 @@ i40e_dev_start(struct rte_eth_dev *dev) +@@ -2321,13 +2321,6 @@ i40e_dev_start(struct rte_eth_dev *dev) i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi); } @@ -57,7 +58,7 @@ /* Enable all queues which have been configured */ for (nb_rxq = 0; nb_rxq < dev->data->nb_rx_queues; nb_rxq++) { ret = i40e_dev_rx_queue_start(dev, nb_rxq); -@@ -2575,10 +2568,6 @@ i40e_dev_stop(struct rte_eth_dev *dev) +@@ -2463,10 +2456,6 @@ i40e_dev_stop(struct rte_eth_dev *dev) i40e_vsi_queues_unbind_intr(pf->vmdq[i].vsi); } @@ -69,10 +70,10 @@ i40e_dev_clear_queues(dev); diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h -index d3bda0272..aef88abed 100644 +index 295ad593b..1e01b312d 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h -@@ -1321,6 +1321,7 @@ void i40e_pf_enable_irq0(struct i40e_hw *hw); +@@ -1172,6 +1172,7 @@ void i40e_pf_enable_irq0(struct i40e_hw *hw); int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx); void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi); @@ -80,7 +81,7 @@ int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, struct i40e_vsi_vlan_pvid_info *info); int i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on); -@@ -1330,6 +1331,7 @@ uint64_t i40e_parse_hena(const struct i40e_adapter *adapter, uint64_t flags); +@@ -1181,6 +1182,7 @@ uint64_t i40e_parse_hena(const struct i40e_adapter *adapter, uint64_t flags); enum i40e_status_code i40e_fdir_setup_tx_resources(struct i40e_pf *pf); enum i40e_status_code i40e_fdir_setup_rx_resources(struct i40e_pf *pf); int i40e_fdir_setup(struct i40e_pf *pf); @@ -89,10 +90,10 @@ uint32_t len, int socket_id); diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c -index 9998e5d4f..8e87b4a00 100644 +index 239cdbf52..9a2b40b8a 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c -@@ -231,6 +231,11 @@ i40e_fdir_setup(struct i40e_pf *pf) +@@ -222,6 +222,11 @@ i40e_fdir_setup(struct i40e_pf *pf) goto fail_mem; } @@ -104,7 +105,7 @@ /* reserve memory for the fdir programming packet */ snprintf(z_name, sizeof(z_name), "%s_%s_%d", eth_dev->device->driver->name, -@@ -287,12 +292,18 @@ i40e_fdir_teardown(struct i40e_pf *pf) +@@ -267,12 +272,18 @@ i40e_fdir_teardown(struct i40e_pf *pf) vsi = pf->fdir.fdir_vsi; if (!vsi) return; @@ -121,8 +122,8 @@ PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off"); + i40e_dev_rx_queue_release(pf->fdir.rxq); - rte_eth_dma_zone_free(dev, "fdir_rx_ring", pf->fdir.rxq->queue_id); pf->fdir.rxq = NULL; + i40e_dev_tx_queue_release(pf->fdir.txq); -- 2.20.1