All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/ixgbe: fix API parameter checking
@ 2017-01-11 14:25 Bernard Iremonger
  2017-01-11 15:15 ` [dpdk-stable] " Ferruh Yigit
  2017-01-11 17:24 ` [PATCH v2] " Bernard Iremonger
  0 siblings, 2 replies; 5+ messages in thread
From: Bernard Iremonger @ 2017-01-11 14:25 UTC (permalink / raw)
  To: dev, wenzhuo.lu; +Cc: Bernard Iremonger, stable

Add checks to rte_pmd_ixgbe_* API's to ensure that the port
is an ixgbe port.

Fixes: 49e248223e9f ("net/ixgbe: add API for VF management")

CC: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 71 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 69 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index b7ddd4f..ca14104 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -4066,6 +4066,12 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4564,6 +4570,12 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4591,6 +4603,12 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4617,10 +4635,16 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
-	if (vlan_id > 4095)
+	if (vlan_id > ETHER_MAX_VLAN_ID)
 		return -EINVAL;
 
 	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -4643,10 +4667,18 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on)
 	struct ixgbe_hw *hw;
 	uint32_t ctrl;
 	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
 
 	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
 
 	if (on > 1)
 		return -EINVAL;
@@ -4672,10 +4704,18 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on)
 	int i;
 	int num_queues = (int)(IXGBE_QDE_IDX_MASK >> IXGBE_QDE_IDX_SHIFT);
 	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
 
 	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
 
 	if (on > 1)
 		return -EINVAL;
@@ -4704,6 +4744,12 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
 	/* only support VF's 0 to 63 */
 	if ((vf >= dev_info.max_vfs) || (vf > 63))
 		return -EINVAL;
@@ -4736,6 +4782,12 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4775,6 +4827,9 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
 	if (strstr(dev_info.driver_name, "ixgbe_vf"))
 		return -ENOTSUP;
 
@@ -4822,6 +4877,9 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
 	if (strstr(dev_info.driver_name, "ixgbe_vf"))
 		return -ENOTSUP;
 
@@ -4873,6 +4931,9 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
 	if (strstr(dev_info.driver_name, "ixgbe_vf"))
 		return -ENOTSUP;
 
@@ -4922,6 +4983,9 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
 	if (strstr(dev_info.driver_name, "ixgbe_vf"))
 		return -ENOTSUP;
 
@@ -4965,6 +5029,9 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
 	rte_eth_dev_info_get(port, &dev_info);
 	rte_eth_link_get_nowait(port, &link);
 
+	if (!strstr(dev_info.driver_name, "ixgbe"))
+		return -ENOTSUP;
+
 	if (strstr(dev_info.driver_name, "ixgbe_vf"))
 		return -ENOTSUP;
 
-- 
2.10.1

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

* Re: [dpdk-stable] [PATCH] net/ixgbe: fix API parameter checking
  2017-01-11 14:25 [PATCH] net/ixgbe: fix API parameter checking Bernard Iremonger
@ 2017-01-11 15:15 ` Ferruh Yigit
  2017-01-11 17:05   ` Iremonger, Bernard
  2017-01-11 17:24 ` [PATCH v2] " Bernard Iremonger
  1 sibling, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2017-01-11 15:15 UTC (permalink / raw)
  To: Bernard Iremonger, dev, wenzhuo.lu; +Cc: stable

On 1/11/2017 2:25 PM, Bernard Iremonger wrote:
> Add checks to rte_pmd_ixgbe_* API's to ensure that the port
> is an ixgbe port.
> 
> Fixes: 49e248223e9f ("net/ixgbe: add API for VF management")
> 
> CC: stable@dpdk.org
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 71 ++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 69 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index b7ddd4f..ca14104 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -1,7 +1,7 @@
>  /*-
>   *   BSD LICENSE
>   *
> - *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> + *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
>   *   All rights reserved.
>   *
>   *   Redistribution and use in source and binary forms, with or without
> @@ -4066,6 +4066,12 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
>  	dev = &rte_eth_devices[port];
>  	rte_eth_dev_info_get(port, &dev_info);
>  
> +	if (!strstr(dev_info.driver_name, "ixgbe"))
> +		return -ENOTSUP;
> +
> +	if (strstr(dev_info.driver_name, "ixgbe_vf"))
> +		return -ENOTSUP;
> +

This part seems common for all functions, what do you think exporting
this into a static function?

Also in the feature if you need to update the method to decide if this
port_id is supported or not, only that function will be effected.

<...>

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

* Re: [dpdk-stable] [PATCH] net/ixgbe: fix API parameter checking
  2017-01-11 15:15 ` [dpdk-stable] " Ferruh Yigit
@ 2017-01-11 17:05   ` Iremonger, Bernard
  0 siblings, 0 replies; 5+ messages in thread
From: Iremonger, Bernard @ 2017-01-11 17:05 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Lu, Wenzhuo; +Cc: stable

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, January 11, 2017 3:15 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-stable] [PATCH] net/ixgbe: fix API parameter checking
> 
> On 1/11/2017 2:25 PM, Bernard Iremonger wrote:
> > Add checks to rte_pmd_ixgbe_* API's to ensure that the port is an
> > ixgbe port.
> >
> > Fixes: 49e248223e9f ("net/ixgbe: add API for VF management")
> >
> > CC: stable@dpdk.org
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 71
> > ++++++++++++++++++++++++++++++++++++++--
> >  1 file changed, 69 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index b7ddd4f..ca14104 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -1,7 +1,7 @@
> >  /*-
> >   *   BSD LICENSE
> >   *
> > - *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> > + *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
> >   *   All rights reserved.
> >   *
> >   *   Redistribution and use in source and binary forms, with or without
> > @@ -4066,6 +4066,12 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port,
> uint16_t vf,
> >  	dev = &rte_eth_devices[port];
> >  	rte_eth_dev_info_get(port, &dev_info);
> >
> > +	if (!strstr(dev_info.driver_name, "ixgbe"))
> > +		return -ENOTSUP;
> > +
> > +	if (strstr(dev_info.driver_name, "ixgbe_vf"))
> > +		return -ENOTSUP;
> > +
> 
> This part seems common for all functions, what do you think exporting this
> into a static function?
> 
> Also in the feature if you need to update the method to decide if this port_id
> is supported or not, only that function will be effected.
> 
> <...>
Ok, I will put the checks into a static function and send a v2.

Regards,

Bernard.

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

* [PATCH v2] net/ixgbe: fix API parameter checking
  2017-01-11 14:25 [PATCH] net/ixgbe: fix API parameter checking Bernard Iremonger
  2017-01-11 15:15 ` [dpdk-stable] " Ferruh Yigit
@ 2017-01-11 17:24 ` Bernard Iremonger
  2017-01-11 18:21   ` Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Bernard Iremonger @ 2017-01-11 17:24 UTC (permalink / raw)
  To: dev, wenzhuo.lu, ferruh.yigit; +Cc: Bernard Iremonger, stable

Add checks to rte_pmd_ixgbe_* API's to ensure that the port
is an ixgbe port.

Fixes: 49e248223e9f ("net/ixgbe: add API for VF management")

CC: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
Changes in v2:
Moved pmd checks into new function is_ixgbe_pmd.

 drivers/net/ixgbe/ixgbe_ethdev.c | 55 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 48 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index b7ddd4f..cc8f7d6 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -244,6 +244,7 @@ static void ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index);
 static void ixgbe_set_default_mac_addr(struct rte_eth_dev *dev,
 					   struct ether_addr *mac_addr);
 static void ixgbe_dcb_init(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config);
+static int is_ixgbe_pmd(const char *driver_name);
 
 /* For Virtual Function support */
 static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev);
@@ -4050,6 +4051,18 @@ ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr)
 	ixgbe_add_rar(dev, addr, 0, 0);
 }
 
+static int
+is_ixgbe_pmd(const char *driver_name)
+{
+	if (!strstr(driver_name, "ixgbe"))
+		return -ENOTSUP;
+
+	if (strstr(driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	return 0;
+}
+
 int
 rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
 		struct ether_addr *mac_addr)
@@ -4066,6 +4079,9 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4564,6 +4580,9 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4591,6 +4610,9 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4617,10 +4639,13 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
-	if (vlan_id > 4095)
+	if (vlan_id > ETHER_MAX_VLAN_ID)
 		return -EINVAL;
 
 	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -4643,10 +4668,15 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on)
 	struct ixgbe_hw *hw;
 	uint32_t ctrl;
 	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
 
 	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
 
 	if (on > 1)
 		return -EINVAL;
@@ -4672,10 +4702,15 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on)
 	int i;
 	int num_queues = (int)(IXGBE_QDE_IDX_MASK >> IXGBE_QDE_IDX_SHIFT);
 	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
 
 	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
 
 	if (on > 1)
 		return -EINVAL;
@@ -4704,6 +4739,9 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
+
 	/* only support VF's 0 to 63 */
 	if ((vf >= dev_info.max_vfs) || (vf > 63))
 		return -EINVAL;
@@ -4736,6 +4774,9 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+		return -ENOTSUP;
+
 	if (vf >= dev_info.max_vfs)
 		return -EINVAL;
 
@@ -4775,7 +4816,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
-	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
 		return -ENOTSUP;
 
 	if (vf >= dev_info.max_vfs)
@@ -4822,7 +4863,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
-	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
 		return -ENOTSUP;
 
 	if (vf >= dev_info.max_vfs)
@@ -4873,7 +4914,7 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
-	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
 		return -ENOTSUP;
 
 	if (vf >= dev_info.max_vfs)
@@ -4922,7 +4963,7 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
 	dev = &rte_eth_devices[port];
 	rte_eth_dev_info_get(port, &dev_info);
 
-	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
 		return -ENOTSUP;
 
 	if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
@@ -4965,7 +5006,7 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
 	rte_eth_dev_info_get(port, &dev_info);
 	rte_eth_link_get_nowait(port, &link);
 
-	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+	if (is_ixgbe_pmd(dev_info.driver_name) != 0)
 		return -ENOTSUP;
 
 	if (vf >= dev_info.max_vfs)
-- 
2.10.1

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

* Re: [PATCH v2] net/ixgbe: fix API parameter checking
  2017-01-11 17:24 ` [PATCH v2] " Bernard Iremonger
@ 2017-01-11 18:21   ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-01-11 18:21 UTC (permalink / raw)
  To: Bernard Iremonger, dev, wenzhuo.lu; +Cc: stable

On 1/11/2017 5:24 PM, Bernard Iremonger wrote:
> Add checks to rte_pmd_ixgbe_* API's to ensure that the port
> is an ixgbe port.
> 
> Fixes: 49e248223e9f ("net/ixgbe: add API for VF management")
> 
> CC: stable@dpdk.org
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2017-01-11 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 14:25 [PATCH] net/ixgbe: fix API parameter checking Bernard Iremonger
2017-01-11 15:15 ` [dpdk-stable] " Ferruh Yigit
2017-01-11 17:05   ` Iremonger, Bernard
2017-01-11 17:24 ` [PATCH v2] " Bernard Iremonger
2017-01-11 18:21   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.