patches for DPDK stable branches
 help / color / mirror / Atom feed
From: luca.boccassi@gmail.com
To: Wei Dai <wei.dai@intel.com>
Cc: Lijuan Tu <lijuanx.a.tu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/i40e: fix mirror rule reset when port is closed' has been queued to LTS release 16.11.4
Date: Mon, 30 Oct 2017 15:34:34 +0000	[thread overview]
Message-ID: <20171030153511.13322-31-luca.boccassi@gmail.com> (raw)
In-Reply-To: <20171030153511.13322-1-luca.boccassi@gmail.com>

Hi,

FYI, your patch has been queued to LTS release 16.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 11/01/17. So please
shout if anyone has objections.

Thanks.

Kind regards,
Luca Boccassi

---
>From 62766a6f94a552fa2b2379440f2f8801330932da Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Mon, 25 Sep 2017 14:36:53 +0800
Subject: [PATCH] net/i40e: fix mirror rule reset when port is closed

[ upstream commit 77a45aeb6b2b4f8dbf8ca53e8bfae8aa18382157 ]

When an i40e PF port is stopped, all mirror rules should be reserved.
But when an i40e PF port is closed, all mirror rules should be removed.
When a mirror rule is removed, its associated hardware and software
resource should also be removed.

Fixes: a4def5edf0fc ("i40e: enable port mirroring")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lijuan Tu <lijuanx.a.tu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5be7f0af6..d63d5b483 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -422,6 +422,12 @@ static int i40e_dev_sync_phy_type(struct i40e_hw *hw);
 static void i40e_configure_registers(struct i40e_hw *hw);
 static void i40e_hw_init(struct rte_eth_dev *dev);
 static int i40e_config_qinq(struct i40e_hw *hw, struct i40e_vsi *vsi);
+static enum i40e_status_code i40e_aq_del_mirror_rule(struct i40e_hw *hw,
+						     uint16_t seid,
+						     uint16_t rule_type,
+						     uint16_t *entries,
+						     uint16_t count,
+						     uint16_t rule_id);
 static int i40e_mirror_rule_set(struct rte_eth_dev *dev,
 			struct rte_eth_mirror_conf *mirror_conf,
 			uint8_t sw_id, uint8_t on);
@@ -1819,7 +1825,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_vsi *main_vsi = pf->main_vsi;
-	struct i40e_mirror_rule *p_mirror;
 	struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
 	int i;
 
@@ -1845,13 +1850,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
 	/* Set link down */
 	i40e_dev_set_link_down(dev);
 
-	/* Remove all mirror rules */
-	while ((p_mirror = TAILQ_FIRST(&pf->mirror_list))) {
-		TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules);
-		rte_free(p_mirror);
-	}
-	pf->nb_mirror_rule = 0;
-
 	if (!rte_intr_allow_others(intr_handle))
 		/* resume to the default handler */
 		rte_intr_callback_register(intr_handle,
@@ -1871,13 +1869,35 @@ i40e_dev_close(struct rte_eth_dev *dev)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct i40e_mirror_rule *p_mirror;
 	uint32_t reg;
 	int i;
+	int ret;
 
 	PMD_INIT_FUNC_TRACE();
 
 	i40e_dev_stop(dev);
 	hw->adapter_stopped = 1;
+
+	/* Remove all mirror rules */
+	while ((p_mirror = TAILQ_FIRST(&pf->mirror_list))) {
+		ret = i40e_aq_del_mirror_rule(hw,
+					      pf->main_vsi->veb->seid,
+					      p_mirror->rule_type,
+					      p_mirror->entries,
+					      p_mirror->num_entries,
+					      p_mirror->id);
+		if (ret < 0)
+			PMD_DRV_LOG(ERR, "failed to remove mirror rule: "
+				    "status = %d, aq_err = %d.", ret,
+				    hw->aq.asq_last_status);
+
+		/* remove mirror software resource anyway */
+		TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules);
+		rte_free(p_mirror);
+		pf->nb_mirror_rule--;
+	}
+
 	i40e_dev_free_queues(dev);
 
 	/* Disable interrupt */
-- 
2.11.0

  parent reply	other threads:[~2017-10-30 15:37 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net: fix inner L2 length in packet type parser' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'vfio: fix close unchecked file descriptor' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'eal: fix auxv open check for ARM and PPC' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix flow control watermark mismatch' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/nfp: fix RSS' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix PF notify issue when VF is not up' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix mapping of user priority to TC' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix possible null pointer dereference' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang build' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: improve stack usage during link update' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix probe failure report' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/cxgbe: fix memory leak' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix adding a mirror rule' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix MAC address set' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix memory leak if VF init fails' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix i40evf MAC filter table' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter definition' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter logic' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix packet count for PF' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'test: fix assignment operation' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/igb: fix memcpy length' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e/base: fix bool definition' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix variable assignment' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix to use a passed ptt handle' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix macros to check chip revision/metal' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix API return types' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix number of app table entries' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix clear xstats bug in VF' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix packet throughput after stats reset' " luca.boccassi
2017-10-30 15:34 ` luca.boccassi [this message]
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix an issue with broadcast traffic' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: set checksum offload flags correctly' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: update status of Rx IP/L4 CKSUM' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix interrupt handler' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix dereference before null check' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'uio: fix compilation with -Og' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'cmdline: " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'hash: fix eviction counter' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'mem: fix malloc element free in debug mode' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'eal: copy raw strings taken from command line' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix mbuf port for simple Rx function' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix queue setup consistency' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix untrusted scalar value' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'timer: use 64-bit specific code on more platforms' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix compilation with -Og' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bonding: fix LACP slave deactivate behavioral' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix for VF malicious indication' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix return code to align with FW' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix invalid port id parameters' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang compilation error' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix assignment' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix uninitialized variable' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix VFIO interrupt mapping in VF' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix uninitialized variable' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix uninitialized errno value' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'drivers/crypto: use snprintf return value correctly' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix flexible payload configuration' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix mbuf free in vector Tx' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix ethtool build with kernel 4.11' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on RHEL 7.4' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on SLE12 SP3' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd-cat: fix build with PQOS 1.4' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd_fork: fix message pool init' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l3fwd-acl: check fseek return' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: check thread creation' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds sched array' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds tls " luca.boccassi
2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: flush Rx queues on start' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: fix Tx packet length stats' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/qos_sched: fix uninitialized config' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IP version check' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'cryptodev: fix build with -Ofast' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IPv6 payload length' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix RSS structure initialisation' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/enic: fix packet loss after MTU change' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/ixgbe: fix PF DCB info' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix mapping of user priority to DCB TC' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Tx offload capability' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Rx " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a bit shift operation' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a potential null pointer dereference' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'eal/x86: fix atomic cmpset' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/multi_process: fix received message length' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'lpm6: fix compilation with -Og' " luca.boccassi
2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'config: fix bnx2x option for armv7a' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix mirror with firmware 6.0' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx packets number for NEON' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/vmxnet3: fix memory leak when releasing queues' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix VFIO interrupt mapping in VF' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx queue " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/igb: fix Rx interrupt with VFIO and MSI-X' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/pcap: fix memory leak in dumper open' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'test/pmd_perf: fix crash with multiple devices' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix forwarding between non consecutive ports' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix topology error message' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'usertools: fix device binding with python 3' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede/base: fix division by zero' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede: fix icc build' " luca.boccassi
2017-11-10 16:10       ` [dpdk-stable] patch 'buildtools: check allocation error in pmdinfogen' " luca.boccassi
2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'net/nfp: fix stats struct initial value' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'net/bnxt: fix link handling and configuration' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'net/mlx5: fix link speed bitmasks' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'test/memzone: fix memory leak' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'pdump: fix possible mbuf leak on failure' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'ring: guarantee load/load order in enqueue and dequeue' " luca.boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171030153511.13322-31-luca.boccassi@gmail.com \
    --to=luca.boccassi@gmail.com \
    --cc=jingjing.wu@intel.com \
    --cc=lijuanx.a.tu@intel.com \
    --cc=stable@dpdk.org \
    --cc=wei.dai@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).