From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4ABBBA00E6 for ; Wed, 12 Jun 2019 09:13:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3FBF61D150; Wed, 12 Jun 2019 09:13:04 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DAF5C1D14A for ; Wed, 12 Jun 2019 09:13:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 00:13:00 -0700 X-ExtLoop1: 1 Received: from unknown (HELO dpdk9.sh.intel.com) ([10.67.118.52]) by fmsmga006.fm.intel.com with ESMTP; 12 Jun 2019 00:12:58 -0700 From: Beilei Xing To: qi.z.zhang@intel.com Cc: dev@dpdk.org Date: Wed, 12 Jun 2019 15:10:52 +0800 Message-Id: <1560323452-120705-1-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1558575434-57309-1-git-send-email-beilei.xing@intel.com> References: <1558575434-57309-1-git-send-email-beilei.xing@intel.com> Subject: [dpdk-dev] [PATCH v3] net/i40e: allow VF to configure pctype mapping X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch allows VF to get/update/reset pctype mapping info. Signed-off-by: Beilei Xing --- 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 | 4 ++++ drivers/net/i40e/i40e_ethdev_vf.c | 6 ++++++ drivers/net/i40e/rte_pmd_i40e.c | 9 ++++++--- 4 files changed, 17 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..95669fa 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include "rte_pmd_i40e.h" @@ -1214,7 +1216,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