netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate
@ 2019-09-03  6:08 Stefan Assmann
  2019-09-03  6:42 ` [Intel-wired-lan] " Paul Menzel
  2019-09-09 21:00 ` Bowers, AndrewX
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Assmann @ 2019-09-03  6:08 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: netdev, davem, jeffrey.t.kirsher, lihong.yang, sassmann

In the case of an invalid min tx rate being requested
i40e_ndo_set_vf_bw() immediately returns -EINVAL instead of releasing
__I40E_VIRTCHNL_OP_PENDING first.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index f8aa4deceb5e..3d2440838822 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -4263,7 +4263,8 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
 	if (min_tx_rate) {
 		dev_err(&pf->pdev->dev, "Invalid min tx rate (%d) (greater than 0) specified for VF %d.\n",
 			min_tx_rate, vf_id);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto error;
 	}
 
 	vf = &pf->vf[vf_id];
-- 
2.21.0


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

* Re: [Intel-wired-lan] [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate
  2019-09-03  6:08 [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate Stefan Assmann
@ 2019-09-03  6:42 ` Paul Menzel
  2019-09-03  7:09   ` Stefan Assmann
  2019-09-09 21:00 ` Bowers, AndrewX
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2019-09-03  6:42 UTC (permalink / raw)
  To: Stefan Assmann, intel-wired-lan; +Cc: netdev, davem

Dear Stefan,


On 03.09.19 08:08, Stefan Assmann wrote:
> In the case of an invalid min tx rate being requested
> i40e_ndo_set_vf_bw() immediately returns -EINVAL instead of releasing
> __I40E_VIRTCHNL_OP_PENDING first.

What problem does this cause?

> Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
> ---
>   drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> index f8aa4deceb5e..3d2440838822 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> @@ -4263,7 +4263,8 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
>   	if (min_tx_rate) {
>   		dev_err(&pf->pdev->dev, "Invalid min tx rate (%d) (greater than 0) specified for VF %d.\n",
>   			min_tx_rate, vf_id);
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto error;
>   	}
>   
>   	vf = &pf->vf[vf_id];


Kind regards,

Paul

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

* Re: [Intel-wired-lan] [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate
  2019-09-03  6:42 ` [Intel-wired-lan] " Paul Menzel
@ 2019-09-03  7:09   ` Stefan Assmann
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Assmann @ 2019-09-03  7:09 UTC (permalink / raw)
  To: Paul Menzel, intel-wired-lan; +Cc: netdev, davem

On 03.09.19 08:42, Paul Menzel wrote:
> Dear Stefan,

Hi Paul,

> On 03.09.19 08:08, Stefan Assmann wrote:
>> In the case of an invalid min tx rate being requested
>> i40e_ndo_set_vf_bw() immediately returns -EINVAL instead of releasing
>> __I40E_VIRTCHNL_OP_PENDING first.
> 
> What problem does this cause?

If the __I40E_VIRTCHNL_OP_PENDING bit never gets cleared no further
virtchnl op can be processed. For example you can no longer destroy the
VFs.

  Stefan

>> Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
>> ---
>>   drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
>> index f8aa4deceb5e..3d2440838822 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
>> @@ -4263,7 +4263,8 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
>>   	if (min_tx_rate) {
>>   		dev_err(&pf->pdev->dev, "Invalid min tx rate (%d) (greater than 0) specified for VF %d.\n",
>>   			min_tx_rate, vf_id);
>> -		return -EINVAL;
>> +		ret = -EINVAL;
>> +		goto error;
>>   	}
>>   
>>   	vf = &pf->vf[vf_id];
> 
> 
> Kind regards,
> 
> Paul
> 


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

* RE: [Intel-wired-lan] [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate
  2019-09-03  6:08 [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate Stefan Assmann
  2019-09-03  6:42 ` [Intel-wired-lan] " Paul Menzel
@ 2019-09-09 21:00 ` Bowers, AndrewX
  1 sibling, 0 replies; 4+ messages in thread
From: Bowers, AndrewX @ 2019-09-09 21:00 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: netdev

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Stefan Assmann
> Sent: Monday, September 2, 2019 11:08 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; davem@davemloft.net; sassmann@kpanic.de
> Subject: [Intel-wired-lan] [PATCH] i40e: clear
> __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate
> 
> In the case of an invalid min tx rate being requested
> i40e_ndo_set_vf_bw() immediately returns -EINVAL instead of releasing
> __I40E_VIRTCHNL_OP_PENDING first.
> 
> Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

end of thread, other threads:[~2019-09-09 21:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  6:08 [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate Stefan Assmann
2019-09-03  6:42 ` [Intel-wired-lan] " Paul Menzel
2019-09-03  7:09   ` Stefan Assmann
2019-09-09 21:00 ` Bowers, AndrewX

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