patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Haiyue Wang <haiyue.wang@intel.com>
Cc: Scott Daniels <daniels@research.att.com>,
	Qi Zhang <qi.z.zhang@intel.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/ixgbevf: add full link status check option' has been queued to LTS release 18.11.3
Date: Mon, 24 Jun 2019 16:25:05 +0100	[thread overview]
Message-ID: <20190624152525.19349-41-ktraynor@redhat.com> (raw)
In-Reply-To: <20190624152525.19349-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/19. 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.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/6d58d68dc8eab0164fb8b20c3dc3c6ec24d419a8

Thanks.

Kevin Traynor

---
From 6d58d68dc8eab0164fb8b20c3dc3c6ec24d419a8 Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang@intel.com>
Date: Fri, 7 Jun 2019 23:56:21 +0800
Subject: [PATCH] net/ixgbevf: add full link status check option

[ upstream commit bd282035b37e6477805dd26d891ffedaeb9870a5 ]

To get the VF's link status by calling 'rte_eth_link_get_nowait()', the
VF not only check PF's physical link status, but also check the mailbox
running status. And mailbox checking will generate mailbox interrupt in
PF, it will be worse if many VFs are running in the system, the PF will
have to handle many interrrupts.

Normally, checking the PF's physical link status is enough for nowait.
For different scenarios, adding an 'pflink_fullchk' option to control
whether to check the link fully or not.

Fixes: 91546fb62e67 ("net/ixgbevf: fix link state")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Scott Daniels <daniels@research.att.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/ixgbe.rst        | 25 +++++++++++++
 drivers/net/ixgbe/ixgbe_ethdev.c | 63 ++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/ixgbe_ethdev.h |  5 +++
 3 files changed, 93 insertions(+)

diff --git a/doc/guides/nics/ixgbe.rst b/doc/guides/nics/ixgbe.rst
index 975143f8b..5c3a7e4f2 100644
--- a/doc/guides/nics/ixgbe.rst
+++ b/doc/guides/nics/ixgbe.rst
@@ -83,4 +83,29 @@ To guarantee the constraint, capabilities in dev_conf.rxmode.offloads will be ch
 fdir_conf->mode will also be checked.
 
+VF Runtime Options
+^^^^^^^^^^^^^^^^^^
+
+The following ``devargs`` options can be enabled at runtime. They must
+be passed as part of EAL arguments. For example,
+
+.. code-block:: console
+
+   testpmd -w af:10.0,pflink_fullchk=1 -- -i
+
+- ``pflink_fullchk`` (default **0**)
+
+  When calling ``rte_eth_link_get_nowait()`` to get VF link status,
+  this option is used to control how VF synchronizes its status with
+  PF's. If set, VF will not only check the PF's physical link status
+  by reading related register, but also check the mailbox status. We
+  call this behavior as fully checking. And checking mailbox will
+  trigger PF's mailbox interrupt generation. If unset, the application
+  can get the VF's link status quickly by just reading the PF's link
+  status register, this will avoid the whole system's mailbox interrupt
+  generation.
+
+  ``rte_eth_link_get()`` will still use the mailbox method regardless
+  of the pflink_fullchk setting.
+
 RX Burst Size
 ^^^^^^^^^^^^^
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index eafad30e4..e432a767e 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -23,4 +23,5 @@
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
+#include <rte_kvargs.h>
 #include <rte_eal.h>
 #include <rte_alarm.h>
@@ -127,4 +128,11 @@
 #define IXGBE_DMATXCTL_VT_MASK                 0xFFFF0000
 
+#define IXGBEVF_DEVARG_PFLINK_FULLCHK		"pflink_fullchk"
+
+static const char * const ixgbevf_valid_arguments[] = {
+	IXGBEVF_DEVARG_PFLINK_FULLCHK,
+	NULL
+};
+
 static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params);
 static int eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -1543,4 +1551,43 @@ generate_random_mac_addr(struct ether_addr *mac_addr)
 }
 
+static int
+devarg_handle_int(__rte_unused const char *key, const char *value,
+		  void *extra_args)
+{
+	uint16_t *n = extra_args;
+
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
+	*n = (uint16_t)strtoul(value, NULL, 0);
+	if (*n == USHRT_MAX && errno == ERANGE)
+		return -1;
+
+	return 0;
+}
+
+static void
+ixgbevf_parse_devargs(struct ixgbe_adapter *adapter,
+		      struct rte_devargs *devargs)
+{
+	struct rte_kvargs *kvlist;
+	uint16_t pflink_fullchk;
+
+	if (devargs == NULL)
+		return;
+
+	kvlist = rte_kvargs_parse(devargs->args, ixgbevf_valid_arguments);
+	if (kvlist == NULL)
+		return;
+
+	if (rte_kvargs_count(kvlist, IXGBEVF_DEVARG_PFLINK_FULLCHK) == 1 &&
+	    rte_kvargs_process(kvlist, IXGBEVF_DEVARG_PFLINK_FULLCHK,
+			       devarg_handle_int, &pflink_fullchk) == 0 &&
+	    pflink_fullchk == 1)
+		adapter->pflink_fullchk = 1;
+
+	rte_kvargs_free(kvlist);
+}
+
 /*
  * Virtual Function device init
@@ -1590,4 +1637,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
+	ixgbevf_parse_devargs(eth_dev->data->dev_private,
+			      pci_dev->device.devargs);
+
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 
@@ -3889,4 +3939,6 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		   int *link_up, int wait_to_complete)
 {
+	struct ixgbe_adapter *adapter = container_of(hw,
+						     struct ixgbe_adapter, hw);
 	struct ixgbe_mbx_info *mbx = &hw->mbx;
 	struct ixgbe_mac_info *mac = &hw->mac;
@@ -3949,4 +4001,13 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	}
 
+	if (wait_to_complete == 0 && adapter->pflink_fullchk == 0) {
+		if (*speed == IXGBE_LINK_SPEED_UNKNOWN)
+			mac->get_link_status = true;
+		else
+			mac->get_link_status = false;
+
+		goto out;
+	}
+
 	/* if the read failed it could just be a mailbox collision, best wait
 	 * until we are called again and don't report an error
@@ -8612,4 +8673,6 @@ RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe_vf, pci_id_ixgbevf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio-pci");
+RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf,
+			      IXGBEVF_DEVARG_PFLINK_FULLCHK "=<0|1>");
 
 RTE_INIT(ixgbe_init_log)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 565c69c9e..5023fa13f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -494,4 +494,9 @@ struct ixgbe_adapter {
 	/* For RSS reta table update */
 	uint8_t rss_reta_updated;
+
+	/* Used for VF link sync with PF's physical and logical (by checking
+	 * mailbox status) link status.
+	 */
+	uint8_t pflink_fullchk;
 };
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-06-24 16:18:57.198974606 +0100
+++ 0041-net-ixgbevf-add-full-link-status-check-option.patch	2019-06-24 16:18:55.085429949 +0100
@@ -1 +1 @@
-From bd282035b37e6477805dd26d891ffedaeb9870a5 Mon Sep 17 00:00:00 2001
+From 6d58d68dc8eab0164fb8b20c3dc3c6ec24d419a8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bd282035b37e6477805dd26d891ffedaeb9870a5 ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -63 +64 @@
-index 12d0405d3..22c5b2c5c 100644
+index eafad30e4..e432a767e 100644
@@ -66 +67 @@
-@@ -24,4 +24,5 @@
+@@ -23,4 +23,5 @@
@@ -72 +73 @@
-@@ -128,4 +129,11 @@
+@@ -127,4 +128,11 @@
@@ -84 +85 @@
-@@ -1551,4 +1559,43 @@ generate_random_mac_addr(struct rte_ether_addr *mac_addr)
+@@ -1543,4 +1551,43 @@ generate_random_mac_addr(struct ether_addr *mac_addr)
@@ -128 +129 @@
-@@ -1599,4 +1646,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
+@@ -1590,4 +1637,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
@@ -136 +137 @@
-@@ -3909,4 +3959,6 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+@@ -3889,4 +3939,6 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
@@ -143 +144 @@
-@@ -3969,4 +4021,13 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+@@ -3949,4 +4001,13 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
@@ -157 +158 @@
-@@ -8661,4 +8722,6 @@ RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd);
+@@ -8612,4 +8673,6 @@ RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd);
@@ -165 +166 @@
-index fdad94d58..6e9ed2e10 100644
+index 565c69c9e..5023fa13f 100644
@@ -168 +169 @@
-@@ -499,4 +499,9 @@ struct ixgbe_adapter {
+@@ -494,4 +494,9 @@ struct ixgbe_adapter {

  parent reply	other threads:[~2019-06-24 15:27 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 15:24 [dpdk-stable] patch 'net/atlantic: remove unnecessary cast' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/ark: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/axgbe: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnxt: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bonding: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/cxgbe: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/e1000: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/ena: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/enic: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/i40e: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/ixgbe: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/mlx5: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/virtio: remove useless check on mempool' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/virtio: fix in-order Rx with segmented packet' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnxt: fix endianness in ring macros' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnxt: fix ring type macro name' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnxt: fix variable width in endian conversion' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/failsafe: fix reported device info' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/ena: fix assigning NUMA node to IO queue' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnx2x: fix packet drop' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnx2x: fix interrupt flood' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnx2x: fix memory leak' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnx2x: fix link state' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/bnx2x: fix supported max Rx/Tx descriptor count' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'ethdev: fix Tx prepare documentation to use positive errno' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/atlantic: fix Tx prepare to set positive rte_errno' " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/e1000: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/enic: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/fm10k: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/i40e: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/iavf: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/ixgbe: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/qede: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/vmxnet3: " Kevin Traynor
2019-06-24 15:24 ` [dpdk-stable] patch 'net/enic: remove flow count action support' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/enic: remove flow locks' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/bnxt: check for null completion ring doorbell' " Kevin Traynor
2019-06-25  3:42   ` Somnath Kotur
2019-06-24 15:25 ` [dpdk-stable] patch 'net/bnxt: fix xstats' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/bnxt: fix interrupt vector initialization' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/bnxt: fix icc build' " Kevin Traynor
2019-06-24 15:25 ` Kevin Traynor [this message]
2019-06-24 15:25 ` [dpdk-stable] patch 'bus/pci: fix TOCTOU for sysfs access' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'doc: fix typo in EAL guide' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'telemetry: fix memory leak' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/sfc/base: enable chained multicast on all EF10 cards' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/sfc/base: fix signed/unsigned mismatch' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/sfc/base: fix shift by more bits than field width' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/netvsc: initialize VF spinlock' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/i40e: fix dropped packets statistics name' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/i40e: remove empty queue stats mapping set devops' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/virtio: fix queue memory leak on error' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/virtio: unmap port IO for legacy device' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/virtio: unmap device on initialization error' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'examples/vdpa: remove trace of legacy linuxapp' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/virtio: add Tx preparation' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/virtio: move VLAN tag insertion to Tx prepare' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'net/virtio: fix memory leak in in-order Rx' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'vhost: fix missing include' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'examples/vhost_crypto: remove unused function' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'vhost/crypto: fix logically dead code' " Kevin Traynor
2019-06-24 15:25 ` [dpdk-stable] patch 'vhost/crypto: fix inferred misuse of enum' " Kevin Traynor

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=20190624152525.19349-41-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=daniels@research.att.com \
    --cc=haiyue.wang@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    /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).