DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: allow VF to get pctype mapping info
@ 2019-05-22  6:34 Beilei Xing
  2019-05-23  1:37 ` [dpdk-dev] [PATCH v2] net/i40e: allow VF to configure pctype mapping Beilei Xing
  0 siblings, 1 reply; 8+ messages in thread
From: Beilei Xing @ 2019-05-22  6:34 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev

This patch allows VF to get pctype mapping info.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 7ae78e4..8a4889e 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2425,9 +2425,6 @@ int rte_pmd_i40e_flow_type_mapping_get(
 
 	dev = &rte_eth_devices[port];
 
-	if (!is_i40e_supported(dev))
-		return -ENOTSUP;
-
 	ad = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
 	for (i = 0; i < I40E_FLOW_TYPE_MAX; i++) {
-- 
2.5.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v2] net/i40e: allow VF to configure pctype mapping
  2019-05-22  6:34 [dpdk-dev] [PATCH] net/i40e: allow VF to get pctype mapping info Beilei Xing
@ 2019-05-23  1:37 ` Beilei Xing
  2019-05-24 13:52   ` Ferruh Yigit
  2019-06-12  7:10   ` [dpdk-dev] [PATCH v3] " Beilei Xing
  0 siblings, 2 replies; 8+ messages in thread
From: Beilei Xing @ 2019-05-23  1:37 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev

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

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
v2 changes:
 - Allow VF update/reset pctype mapping.

 drivers/net/i40e/rte_pmd_i40e.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 7ae78e4..b3bdc61 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2405,8 +2405,6 @@ int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port)
 
 	dev = &rte_eth_devices[port];
 
-	if (!is_i40e_supported(dev))
-		return -ENOTSUP;
 
 	i40e_set_default_pctype_table(dev);
 
@@ -2425,9 +2423,6 @@ int rte_pmd_i40e_flow_type_mapping_get(
 
 	dev = &rte_eth_devices[port];
 
-	if (!is_i40e_supported(dev))
-		return -ENOTSUP;
-
 	ad = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
 	for (i = 0; i < I40E_FLOW_TYPE_MAX; i++) {
@@ -2453,9 +2448,6 @@ rte_pmd_i40e_flow_type_mapping_update(
 
 	dev = &rte_eth_devices[port];
 
-	if (!is_i40e_supported(dev))
-		return -ENOTSUP;
-
 	if (count > I40E_FLOW_TYPE_MAX)
 		return -EINVAL;
 
-- 
2.5.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/i40e: allow VF to configure pctype mapping
  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
  1 sibling, 1 reply; 8+ messages in thread
From: Ferruh Yigit @ 2019-05-24 13:52 UTC (permalink / raw)
  To: Beilei Xing, qi.z.zhang; +Cc: dev

On 5/23/2019 2:37 AM, Beilei Xing wrote:
> This patch allows VF to get/update/reset pctype
> mapping info.
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
> v2 changes:
>  - Allow VF update/reset pctype mapping.
> 
>  drivers/net/i40e/rte_pmd_i40e.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
> index 7ae78e4..b3bdc61 100644
> --- a/drivers/net/i40e/rte_pmd_i40e.c
> +++ b/drivers/net/i40e/rte_pmd_i40e.c
> @@ -2405,8 +2405,6 @@ int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port)
>  
>  	dev = &rte_eth_devices[port];
>  
> -	if (!is_i40e_supported(dev))
> -		return -ENOTSUP;

Hi Beilei,

Since these are public APIs, these checks are to prevent possible issues user
call these APIs with a port_id that is not 'i40e' at all, in that case the API
still will try to work on that device and this may lead a crash or corruption in
that device.

Instead of removing these checks, can it be possible to extend it to cover both
PF and VF? If there are APIs in this file that requires device explicitly to be
PF or VF, perhaps we can create two version of the check and use appropriate one
for the API.


>  
>  	i40e_set_default_pctype_table(dev);
>  
> @@ -2425,9 +2423,6 @@ int rte_pmd_i40e_flow_type_mapping_get(
>  
>  	dev = &rte_eth_devices[port];
>  
> -	if (!is_i40e_supported(dev))
> -		return -ENOTSUP;
> -
>  	ad = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
>  
>  	for (i = 0; i < I40E_FLOW_TYPE_MAX; i++) {
> @@ -2453,9 +2448,6 @@ rte_pmd_i40e_flow_type_mapping_update(
>  
>  	dev = &rte_eth_devices[port];
>  
> -	if (!is_i40e_supported(dev))
> -		return -ENOTSUP;
> -
>  	if (count > I40E_FLOW_TYPE_MAX)
>  		return -EINVAL;
>  
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/i40e: allow VF to configure pctype mapping
  2019-05-24 13:52   ` Ferruh Yigit
@ 2019-05-27 16:36     ` Zhang, Qi Z
  0 siblings, 0 replies; 8+ messages in thread
From: Zhang, Qi Z @ 2019-05-27 16:36 UTC (permalink / raw)
  To: Yigit, Ferruh, Xing, Beilei; +Cc: dev



> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Friday, May 24, 2019 6:53 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: allow VF to configure pctype
> mapping
> 
> On 5/23/2019 2:37 AM, Beilei Xing wrote:
> > This patch allows VF to get/update/reset pctype mapping info.
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> > ---
> > v2 changes:
> >  - Allow VF update/reset pctype mapping.
> >
> >  drivers/net/i40e/rte_pmd_i40e.c | 8 --------
> >  1 file changed, 8 deletions(-)
> >
> > diff --git a/drivers/net/i40e/rte_pmd_i40e.c
> > b/drivers/net/i40e/rte_pmd_i40e.c index 7ae78e4..b3bdc61 100644
> > --- a/drivers/net/i40e/rte_pmd_i40e.c
> > +++ b/drivers/net/i40e/rte_pmd_i40e.c
> > @@ -2405,8 +2405,6 @@ int
> > rte_pmd_i40e_flow_type_mapping_reset(uint16_t port)
> >
> >  	dev = &rte_eth_devices[port];
> >
> > -	if (!is_i40e_supported(dev))
> > -		return -ENOTSUP;
> 
> Hi Beilei,
> 
> Since these are public APIs, these checks are to prevent possible issues user
> call these APIs with a port_id that is not 'i40e' at all, in that case the API still
> will try to work on that device and this may lead a crash or corruption in that
> device.
> 
> Instead of removing these checks, can it be possible to extend it to cover both
> PF and VF? If there are APIs in this file that requires device explicitly to be PF
> or VF, perhaps we can create two version of the check and use appropriate one
> for the API.

+1 

> 
> 
> >
> >  	i40e_set_default_pctype_table(dev);
> >
> > @@ -2425,9 +2423,6 @@ int rte_pmd_i40e_flow_type_mapping_get(
> >
> >  	dev = &rte_eth_devices[port];
> >
> > -	if (!is_i40e_supported(dev))
> > -		return -ENOTSUP;
> > -
> >  	ad = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> >
> >  	for (i = 0; i < I40E_FLOW_TYPE_MAX; i++) { @@ -2453,9 +2448,6 @@
> > rte_pmd_i40e_flow_type_mapping_update(
> >
> >  	dev = &rte_eth_devices[port];
> >
> > -	if (!is_i40e_supported(dev))
> > -		return -ENOTSUP;
> > -
> >  	if (count > I40E_FLOW_TYPE_MAX)
> >  		return -EINVAL;
> >
> >


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v3] net/i40e: allow VF to configure pctype mapping
  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-06-12  7:10   ` Beilei Xing
  2019-06-17  3:17     ` [dpdk-dev] [PATCH v4] " Beilei Xing
  1 sibling, 1 reply; 8+ messages in thread
From: Beilei Xing @ 2019-06-12  7:10 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev

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

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
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 <rte_kvargs.h>
 #include <rte_hash.h>
 #include <rte_flow.h>
+#include <rte_pci.h>
+#include <rte_bus_pci.h>
 #include <rte_flow_driver.h>
 #include <rte_tm_driver.h>
 #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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v4] net/i40e: allow VF to configure pctype mapping
  2019-06-12  7:10   ` [dpdk-dev] [PATCH v3] " Beilei Xing
@ 2019-06-17  3:17     ` Beilei Xing
  2019-06-18 13:14       ` Zhang, Qi Z
  2019-06-18 13:16       ` Zhang, Qi Z
  0 siblings, 2 replies; 8+ messages in thread
From: Beilei Xing @ 2019-06-17  3:17 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/i40e: allow VF to configure pctype mapping
  2019-06-17  3:17     ` [dpdk-dev] [PATCH v4] " Beilei Xing
@ 2019-06-18 13:14       ` Zhang, Qi Z
  2019-06-18 13:16       ` Zhang, Qi Z
  1 sibling, 0 replies; 8+ messages in thread
From: Zhang, Qi Z @ 2019-06-18 13:14 UTC (permalink / raw)
  To: Xing, Beilei; +Cc: dev



> -----Original Message-----
> From: Xing, Beilei
> Sent: Monday, June 17, 2019 11:18 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH v4] net/i40e: allow VF to configure pctype mapping
> 
> This patch allows VF to get/update/reset pctype mapping info.
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/i40e: allow VF to configure pctype mapping
  2019-06-17  3:17     ` [dpdk-dev] [PATCH v4] " Beilei Xing
  2019-06-18 13:14       ` Zhang, Qi Z
@ 2019-06-18 13:16       ` Zhang, Qi Z
  1 sibling, 0 replies; 8+ messages in thread
From: Zhang, Qi Z @ 2019-06-18 13:16 UTC (permalink / raw)
  To: Xing, Beilei; +Cc: dev



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Tuesday, June 18, 2019 9:14 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v4] net/i40e: allow VF to configure pctype mapping
> 
> 
> 
> > -----Original Message-----
> > From: Xing, Beilei
> > Sent: Monday, June 17, 2019 11:18 AM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org
> > Subject: [PATCH v4] net/i40e: allow VF to configure pctype mapping
> >
> > This patch allows VF to get/update/reset pctype mapping info.
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Added Cc: stable@dpdk.org during apply.


> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Applied to dpdk-next-net-intel.
> 
> Thanks
> Qi

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-18 13:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` [dpdk-dev] [PATCH v4] " Beilei Xing
2019-06-18 13:14       ` Zhang, Qi Z
2019-06-18 13:16       ` Zhang, Qi Z

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).