DPDK patches and discussions
 help / color / mirror / Atom feed
From: Robin Zhang <robinx.zhang@intel.com>
To: dev@dpdk.org
Cc: mdr@ashroe.eu, nhorman@tuxdriver.com, jingjing.wu@intel.com,
	beilei.xing@intel.com, jia.guo@intel.com, qiming.yang@intel.com,
	stevex.yang@intel.com, Robin Zhang <robinx.zhang@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/iavf: deprecate i40evf pmd
Date: Tue, 30 Mar 2021 08:16:23 +0000	[thread overview]
Message-ID: <20210330081623.2478845-1-robinx.zhang@intel.com> (raw)
In-Reply-To: <20210302061323.165998-1-robinx.zhang@intel.com>

Avf PMD was introduced from DPDK 18.02 to promote Intel Adaptive Virtual
Function with device ID is 0x1889 aligned with AVF public spec. At the
meanwhile, i40evf PMD was co-existed to support other existing device IDs
of i40e devices. So on i40e devices, iavf PMD can only run in the VM whose
hypervisor has emulated the VF’s device to 0x1889. At that time, linux
i40evf kernel driver covers device ID of i40e VF and 0x1889. Start from
ice, all the VFs will be AVF, that is to say their device ID is 0x1889.

Currently in i40e VF driver, when one new feature is added, DPDK SW need
to maintain two drivers even for one device. Validation team also need to
keep the behavior of those two drivers are the same.
Meanwhile, container deploy becomes more popular, and device ID cannot be
changed as there is no device emulate. So the user in container can only
use i40evf PMD on i40e devices, when upgrade to ice devices, driver should
be switched to iavf. That will break iavf continuity on i40e devices.
Also, one driver would force the developing the interface to be consistent
for customers using both i40e, ice and later products.

So, i40evf PMD is no need to maintain, as iavf will be used instead of
i40evf. Starting from DPDK 21.05, the default VF driver will be iavf.

Impact:
If the customers are using i40evf PMD on Intel 700 series NICs, when they
upgrade to latest DPDK SW, they do not need to modify device ID anymore.
Meanwhile, before i40evf is deleted officially, i40evf can still be used
if users specify the devarg "driver=i40evf".

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
---
v2:
-change default VF driver to iavf, add devarg "driver=i40evf" so that
 i40evf can still be used.
---
 doc/guides/rel_notes/deprecation.rst |  8 +++++
 drivers/common/iavf/iavf_devids.h    |  4 +++
 drivers/net/i40e/i40e_ethdev_vf.c    | 45 ++++++++++++++++++++++++++++
 drivers/net/iavf/iavf_ethdev.c       |  6 ++++
 4 files changed, 63 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 64629e0641..63b59bd2fd 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -130,3 +130,11 @@ Deprecation Notices
 * cmdline: ``cmdline`` structure will be made opaque to hide platform-specific
   content. On Linux and FreeBSD, supported prior to DPDK 20.11,
   original structure will be kept until DPDK 21.11.
+
+* i40e: As there are both i40evf and iavf pmd, the functions of them are
+  duplicated. And now more and more advanced features are developed on iavf.
+  To keep consistent with kernel driver's name
+  (https://patchwork.ozlabs.org/patch/970154/), i40evf is no need to maintain.
+  Starting from 21.05, the default VF driver of i40e will be iavf, but i40evf
+  can still be used if users specify the devarg "driver=i40evf". I40evf will
+  be deleted in DPDK 21.11.
diff --git a/drivers/common/iavf/iavf_devids.h b/drivers/common/iavf/iavf_devids.h
index 722c2e4f49..74d84a82e8 100644
--- a/drivers/common/iavf/iavf_devids.h
+++ b/drivers/common/iavf/iavf_devids.h
@@ -13,5 +13,9 @@
 #define IAVF_DEV_ID_VF_HV		0x1571
 #define IAVF_DEV_ID_ADAPTIVE_VF		0x1889
 #define IAVF_DEV_ID_X722_VF		0x37CD
+#ifdef X722_A0_SUPPORT
+#define I40E_DEV_ID_X722_A0_VF          0x374D
+#endif
+
 
 #endif /* _IAVF_DEVIDS_H_ */
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0c9bd8d2c6..509c8f4e37 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1656,9 +1656,53 @@ i40evf_dev_uninit(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
+static int
+i40evf_check_driver_handler(__rte_unused const char *key,
+			    const char *value, __rte_unused void *opaque)
+{
+	if (strcmp(value, "i40evf"))
+		return -1;
+
+	return 0;
+}
+
+static int
+i40evf_driver_selected(struct rte_devargs *devargs)
+{
+	struct rte_kvargs *kvlist;
+	const char *key = "driver";
+	int ret = 0;
+
+	if (devargs == NULL)
+		return 0;
+
+	kvlist = rte_kvargs_parse(devargs->args, NULL);
+	if (kvlist == NULL)
+		return 0;
+
+	if (!rte_kvargs_count(kvlist, key))
+		goto exit;
+
+	/* i40evf driver selected when there's a key-value pair:
+	 * driver=i40evf
+	 */
+	if (rte_kvargs_process(kvlist, key,
+			       i40evf_check_driver_handler, NULL) < 0)
+		goto exit;
+
+	ret = 1;
+
+exit:
+	rte_kvargs_free(kvlist);
+	return ret;
+}
+
 static int eth_i40evf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	struct rte_pci_device *pci_dev)
 {
+	if (!i40evf_driver_selected(pci_dev->device.devargs))
+		return 1;
+
 	return rte_eth_dev_pci_generic_probe(pci_dev,
 		sizeof(struct i40e_adapter), i40evf_dev_init);
 }
@@ -1681,6 +1725,7 @@ static struct rte_pci_driver rte_i40evf_pmd = {
 RTE_PMD_REGISTER_PCI(net_i40e_vf, rte_i40evf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_i40e_vf, pci_id_i40evf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_i40e_vf, "* igb_uio | vfio-pci");
+RTE_PMD_REGISTER_PARAM_STRING(net_i40e_vf, "driver=i40evf");
 
 static int
 i40evf_dev_configure(struct rte_eth_dev *dev)
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 869c4a1988..e20e07807f 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -125,6 +125,12 @@ static int iavf_set_mc_addr_list(struct rte_eth_dev *dev,
 
 static const struct rte_pci_id pci_id_iavf_map[] = {
 	{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) },
+	{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF) },
+	{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF_HV) },
+	{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_X722_VF) },
+#ifdef X722_A0_SUPPORT
+	{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, I40E_DEV_ID_X722_A0_VF) },
+#endif
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
-- 
2.25.1


  reply	other threads:[~2021-03-30  8:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02  6:13 [dpdk-dev] [PATCH] " Robin Zhang
2021-03-30  8:16 ` Robin Zhang [this message]
2021-04-02 10:42 ` [dpdk-dev] [PATCH v3] " Robin Zhang
2021-04-15  2:05 ` [dpdk-dev] [PATCH v4] " Robin Zhang
2021-04-15  7:46   ` Wang, Haiyue
2021-04-15  9:40   ` Zhang, Qi Z
2021-04-15 10:34 ` [dpdk-dev] [PATCH v5] " Robin Zhang
2021-04-15 12:14   ` Zhang, Qi Z
2021-04-16  1:57 ` [dpdk-dev] [PATCH v6] " Robin Zhang
2021-04-16 10:15   ` Zhang, Qi Z
2021-04-16 13:36     ` Ferruh Yigit
2021-04-19  2:06   ` Xing, Beilei
2021-04-19  3:05 ` [dpdk-dev] [PATCH v7] " Robin Zhang
2021-04-19  8:31   ` Xing, Beilei
2021-04-19  8:33     ` Zhang, Qi Z

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=20210330081623.2478845-1-robinx.zhang@intel.com \
    --to=robinx.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=qiming.yang@intel.com \
    --cc=stevex.yang@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).