DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: fix calling null function of VF
@ 2017-05-10  7:00 Wei Dai
  2017-05-10  9:34 ` Gregory Etelson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wei Dai @ 2017-05-10  7:00 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev; +Cc: dev, Wei Dai, stable

hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
be called directly. It had better be replaced by calling
ixgbe_get_media_type( ) to avoid crash.

Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ec667d8..ed2baec 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 	hw->mac.get_link_status = true;
 
 	if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
-		hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
+		ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
 		speed = hw->phy.autoneg_advertised;
 		if (!speed)
 			ixgbe_get_link_capabilities(hw, &speed, &autoneg);
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix calling null function of VF
  2017-05-10  7:00 [dpdk-dev] [PATCH] net/ixgbe: fix calling null function of VF Wei Dai
@ 2017-05-10  9:34 ` Gregory Etelson
  2017-05-10  9:49   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  2017-05-10  9:50 ` Ferruh Yigit
  2017-05-10 19:08 ` Roger B Melton
  2 siblings, 1 reply; 8+ messages in thread
From: Gregory Etelson @ 2017-05-10  9:34 UTC (permalink / raw)
  To: dev; +Cc: Wei Dai, wenzhuo.lu, konstantin.ananyev, stable

Hello,

The patch you proposed fixed a crash I experienced in IXGBE VF.
However, there's still another crash possibility
if the code will proceed with speed == 0 condition to ixgbe_get_link_capabilities
VF mac.ops.get_link_capabilities is also set to NULL;

Regards,
Gregory


On Wednesday, 10 May 2017 10:00:02 IDT Wei Dai wrote:
> hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
> be called directly. It had better be replaced by calling
> ixgbe_get_media_type( ) to avoid crash.
> 
> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ec667d8..ed2baec 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
>  	hw->mac.get_link_status = true;
>  
>  	if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
> -		hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
> +		ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
>  		speed = hw->phy.autoneg_advertised;
>  		if (!speed)
>  			ixgbe_get_link_capabilities(hw, &speed, &autoneg);
> 

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/ixgbe: fix calling null function of VF
  2017-05-10  9:34 ` Gregory Etelson
@ 2017-05-10  9:49   ` Ferruh Yigit
  0 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2017-05-10  9:49 UTC (permalink / raw)
  To: Gregory Etelson, dev; +Cc: Wei Dai, wenzhuo.lu, konstantin.ananyev, stable

On 5/10/2017 10:34 AM, Gregory Etelson wrote:
> Hello,
> 
> The patch you proposed fixed a crash I experienced in IXGBE VF.
> However, there's still another crash possibility
> if the code will proceed with speed == 0 condition to ixgbe_get_link_capabilities
> VF mac.ops.get_link_capabilities is also set to NULL;

There seems a NULL check in that path, so it should be OK, can you
please check:

ixgbe_get_link_capabilities()
	return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, .)

...

#define ixgbe_call_func(hw, func, params, error) \
	(func != NULL) ? func params : error

So, if hw->mac.ops.get_link_capabilities == NULL, this will return
IXGBE_NOT_IMPLEMENTED


> 
> Regards,
> Gregory
> 
> 
> On Wednesday, 10 May 2017 10:00:02 IDT Wei Dai wrote:
>> hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
>> be called directly. It had better be replaced by calling
>> ixgbe_get_media_type( ) to avoid crash.
>>
>> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Wei Dai <wei.dai@intel.com>
>> ---
>>  drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>> index ec667d8..ed2baec 100644
>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>> @@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
>>  	hw->mac.get_link_status = true;
>>  
>>  	if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
>> -		hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
>> +		ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
>>  		speed = hw->phy.autoneg_advertised;
>>  		if (!speed)
>>  			ixgbe_get_link_capabilities(hw, &speed, &autoneg);
>>
> 

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/ixgbe: fix calling null function of VF
  2017-05-10  7:00 [dpdk-dev] [PATCH] net/ixgbe: fix calling null function of VF Wei Dai
  2017-05-10  9:34 ` Gregory Etelson
@ 2017-05-10  9:50 ` Ferruh Yigit
  2017-05-10 12:20   ` Roger B. Melton
  2017-05-10 19:08 ` Roger B Melton
  2 siblings, 1 reply; 8+ messages in thread
From: Ferruh Yigit @ 2017-05-10  9:50 UTC (permalink / raw)
  To: Wei Dai, wenzhuo.lu, konstantin.ananyev
  Cc: dev, stable, Roger B Melton, Laurent Hardy

On 5/10/2017 8:00 AM, Wei Dai wrote:
> hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
> be called directly. It had better be replaced by calling
> ixgbe_get_media_type( ) to avoid crash.
> 
> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>

Hi Roger and Laurent,

This is very close the release, can you please support verifying this
defect?

An explicit Acked-by and/or Tested-by would help a lot.

Thanks,
ferruh


> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ec667d8..ed2baec 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
>  	hw->mac.get_link_status = true;
>  
>  	if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
> -		hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
> +		ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
>  		speed = hw->phy.autoneg_advertised;
>  		if (!speed)
>  			ixgbe_get_link_capabilities(hw, &speed, &autoneg);
> 

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/ixgbe: fix calling null function of VF
  2017-05-10  9:50 ` Ferruh Yigit
@ 2017-05-10 12:20   ` Roger B. Melton
  2017-05-10 12:33     ` Laurent Hardy
  0 siblings, 1 reply; 8+ messages in thread
From: Roger B. Melton @ 2017-05-10 12:20 UTC (permalink / raw)
  To: Ferruh Yigit, Wei Dai, wenzhuo.lu, konstantin.ananyev
  Cc: dev, stable, Laurent Hardy



On 5/10/17 5:50 AM, Ferruh Yigit wrote:
> On 5/10/2017 8:00 AM, Wei Dai wrote:
>> hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
>> be called directly. It had better be replaced by calling
>> ixgbe_get_media_type( ) to avoid crash.
>>
>> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Wei Dai <wei.dai@intel.com>
> Hi Roger and Laurent,
>
> This is very close the release, can you please support verifying this
> defect?
>
> An explicit Acked-by and/or Tested-by would help a lot.
>
> Thanks,
> ferruh

Hi Ferruh,

Happy to test it.  I'll get back to you shortly.

Regards,
Roger

>
>
>> ---
>>   drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>> index ec667d8..ed2baec 100644
>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>> @@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
>>   	hw->mac.get_link_status = true;
>>   
>>   	if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
>> -		hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
>> +		ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
>>   		speed = hw->phy.autoneg_advertised;
>>   		if (!speed)
>>   			ixgbe_get_link_capabilities(hw, &speed, &autoneg);
>>
> .
>

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/ixgbe: fix calling null function of VF
  2017-05-10 12:20   ` Roger B. Melton
@ 2017-05-10 12:33     ` Laurent Hardy
  2017-05-10 15:18       ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Hardy @ 2017-05-10 12:33 UTC (permalink / raw)
  To: Roger B. Melton, Ferruh Yigit, Wei Dai, wenzhuo.lu, konstantin.ananyev
  Cc: dev, stable

Hi Ferruh, Wei, Roger,
PSB
I also redo test plan provided through 
http://dpdk.org/dev/patchwork/patch/20502/

Thanks & regards,
Laurent

On 05/10/2017 02:20 PM, Roger B. Melton wrote:
>
>
> On 5/10/17 5:50 AM, Ferruh Yigit wrote:
>> On 5/10/2017 8:00 AM, Wei Dai wrote:
>>> hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
>>> be called directly. It had better be replaced by calling
>>> ixgbe_get_media_type( ) to avoid crash.
>>>
>>> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Laurent Hardy <laurent.hardy@6wind.com>
>> Hi Roger and Laurent,
>>
>> This is very close the release, can you please support verifying this
>> defect?
>>
>> An explicit Acked-by and/or Tested-by would help a lot.
>>
>> Thanks,
>> ferruh
>
> Hi Ferruh,
>
> Happy to test it.  I'll get back to you shortly.
>
> Regards,
> Roger
>
>>
>>
>>> ---
>>>   drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c 
>>> b/drivers/net/ixgbe/ixgbe_ethdev.c
>>> index ec667d8..ed2baec 100644
>>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>>> @@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, 
>>> int wait_to_complete)
>>>       hw->mac.get_link_status = true;
>>>         if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
>>> -        hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
>>> +        ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
>>>           speed = hw->phy.autoneg_advertised;
>>>           if (!speed)
>>>               ixgbe_get_link_capabilities(hw, &speed, &autoneg);
>>>
>> .
>>
>

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/ixgbe: fix calling null function of VF
  2017-05-10 12:33     ` Laurent Hardy
@ 2017-05-10 15:18       ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2017-05-10 15:18 UTC (permalink / raw)
  To: Wei Dai
  Cc: dev, Laurent Hardy, Roger B. Melton, Ferruh Yigit, wenzhuo.lu,
	konstantin.ananyev

10/05/2017 14:33, Laurent Hardy:
> Hi Ferruh, Wei, Roger,
> PSB
> I also redo test plan provided through 
> http://dpdk.org/dev/patchwork/patch/20502/
> 
> Thanks & regards,
> Laurent
> 
> On 05/10/2017 02:20 PM, Roger B. Melton wrote:
> >
> >
> > On 5/10/17 5:50 AM, Ferruh Yigit wrote:
> >> On 5/10/2017 8:00 AM, Wei Dai wrote:
> >>> hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
> >>> be called directly. It had better be replaced by calling
> >>> ixgbe_get_media_type( ) to avoid crash.
> >>>
> >>> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
> >>> Cc: stable@dpdk.org
> >>>
> >>> Signed-off-by: Wei Dai <wei.dai@intel.com>
> Acked-by: Laurent Hardy <laurent.hardy@6wind.com>

Removing stable@dpdk.org as the bug was introduced in 17.05-rc3.

Applied, thanks

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/ixgbe: fix calling null function of VF
  2017-05-10  7:00 [dpdk-dev] [PATCH] net/ixgbe: fix calling null function of VF Wei Dai
  2017-05-10  9:34 ` Gregory Etelson
  2017-05-10  9:50 ` Ferruh Yigit
@ 2017-05-10 19:08 ` Roger B Melton
  2 siblings, 0 replies; 8+ messages in thread
From: Roger B Melton @ 2017-05-10 19:08 UTC (permalink / raw)
  To: Wei Dai, wenzhuo.lu, konstantin.ananyev; +Cc: dev

-stable@dpdk.org per Thomas

I know this patch has already been applied but to complete the loop, I 
have applied the patch to 17.05-rc4 and verified within my application 
that the NULL function pointer issue for ixgbe_vf has been resolved.


Regards,
Roger

On 5/10/17 3:00 AM, Wei Dai wrote:
> hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
> be called directly. It had better be replaced by calling
> ixgbe_get_media_type( ) to avoid crash.
>
> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by Roger B Melton <rmelton@cisco.com>
> ---
>   drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ec667d8..ed2baec 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
>   	hw->mac.get_link_status = true;
>   
>   	if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
> -		hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
> +		ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
>   		speed = hw->phy.autoneg_advertised;
>   		if (!speed)
>   			ixgbe_get_link_capabilities(hw, &speed, &autoneg);

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

end of thread, other threads:[~2017-05-10 19:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10  7:00 [dpdk-dev] [PATCH] net/ixgbe: fix calling null function of VF Wei Dai
2017-05-10  9:34 ` Gregory Etelson
2017-05-10  9:49   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2017-05-10  9:50 ` Ferruh Yigit
2017-05-10 12:20   ` Roger B. Melton
2017-05-10 12:33     ` Laurent Hardy
2017-05-10 15:18       ` Thomas Monjalon
2017-05-10 19:08 ` Roger B Melton

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