DPDK patches and discussions
 help / color / mirror / Atom feed
From: Beilei Xing <beilei.xing@intel.com>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v4] net/i40e: allow VF to configure pctype mapping
Date: Mon, 17 Jun 2019 11:17:35 +0800	[thread overview]
Message-ID: <1560741455-3411-1-git-send-email-beilei.xing@intel.com> (raw)
In-Reply-To: <1560323452-120705-1-git-send-email-beilei.xing@intel.com>

This patch allows VF to get/update/reset pctype
mapping info.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
v4 changes:
 - Fix messon build error.
v3 changes:
 - add new function is_i40evf_supported.
v2 changes:
 - Allow VF update/reset pctype mapping.

 drivers/net/i40e/i40e_ethdev.c    | 2 +-
 drivers/net/i40e/i40e_ethdev.h    | 3 +++
 drivers/net/i40e/i40e_ethdev_vf.c | 6 ++++++
 drivers/net/i40e/rte_pmd_i40e.c   | 9 ++++++---
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 815baa1..65cd6cc 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12135,7 +12135,7 @@ i40e_filter_restore(struct i40e_pf *pf)
 	i40e_rss_filter_restore(pf);
 }
 
-static bool
+bool
 is_device_supported(struct rte_eth_dev *dev, struct rte_pci_driver *drv)
 {
 	if (strcmp(dev->device->driver->name, drv->driver.name))
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 9855038..7e327ea 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -271,6 +271,7 @@ enum i40e_flxpld_layer_idx {
 	(ETHER_HDR_LEN + ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE * 2)
 
 struct i40e_adapter;
+struct rte_pci_driver;
 
 /**
  * MAC filter structure
@@ -1214,7 +1215,9 @@ void i40e_set_vlan_filter(struct i40e_vsi *vsi, uint16_t vlan_id, bool on);
 int i40e_add_macvlan_filters(struct i40e_vsi *vsi,
 			     struct i40e_macvlan_filter *filter,
 			     int total);
+bool is_device_supported(struct rte_eth_dev *dev, struct rte_pci_driver *drv);
 bool is_i40e_supported(struct rte_eth_dev *dev);
+bool is_i40evf_supported(struct rte_eth_dev *dev);
 
 int i40e_validate_input_set(enum i40e_filter_pctype pctype,
 			    enum rte_filter_type filter, uint64_t inset);
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index a348972..bc9fc01 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2804,3 +2804,9 @@ i40evf_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addrs,
 
 	return 0;
 }
+
+bool
+is_i40evf_supported(struct rte_eth_dev *dev)
+{
+	return is_device_supported(dev, &rte_i40evf_pmd);
+}
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 7ae78e4..0fdb552 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2405,7 +2405,8 @@ int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port)
 
 	dev = &rte_eth_devices[port];
 
-	if (!is_i40e_supported(dev))
+	if (!is_i40e_supported(dev) &&
+	    !is_i40evf_supported(dev))
 		return -ENOTSUP;
 
 	i40e_set_default_pctype_table(dev);
@@ -2425,7 +2426,8 @@ int rte_pmd_i40e_flow_type_mapping_get(
 
 	dev = &rte_eth_devices[port];
 
-	if (!is_i40e_supported(dev))
+	if (!is_i40e_supported(dev) &&
+	    !is_i40evf_supported(dev))
 		return -ENOTSUP;
 
 	ad = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
@@ -2453,7 +2455,8 @@ rte_pmd_i40e_flow_type_mapping_update(
 
 	dev = &rte_eth_devices[port];
 
-	if (!is_i40e_supported(dev))
+	if (!is_i40e_supported(dev) &&
+	    !is_i40evf_supported(dev))
 		return -ENOTSUP;
 
 	if (count > I40E_FLOW_TYPE_MAX)
-- 
2.5.5


  reply	other threads:[~2019-06-17  3:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22  6:34 [dpdk-dev] [PATCH] net/i40e: allow VF to get pctype mapping info Beilei Xing
2019-05-23  1:37 ` [dpdk-dev] [PATCH v2] net/i40e: allow VF to configure pctype mapping Beilei Xing
2019-05-24 13:52   ` Ferruh Yigit
2019-05-27 16:36     ` Zhang, Qi Z
2019-06-12  7:10   ` [dpdk-dev] [PATCH v3] " Beilei Xing
2019-06-17  3:17     ` Beilei Xing [this message]
2019-06-18 13:14       ` [dpdk-dev] [PATCH v4] " Zhang, Qi Z
2019-06-18 13:16       ` 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=1560741455-3411-1-git-send-email-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@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).