Skip to contentSkip to conversation

i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate

PATCH In review Stefan Assmann 3 participants 4 messages Sep 3, 2019 – Sep 9, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 -1
index f8aa4deceb5e..3d2440838822 100644
@@ -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];
Signature · 1 line
2.21.0
#1 lore raw

Dear Stefan,

Quoted 3 lines · Stefan Assmann

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?

Quoted 10 lines
---
  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +0 -0
index f8aa4deceb5e..3d2440838822 100644

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate, · line 4270

Quoted 9 lines
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 -1
@@ -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

#2 lore raw
Quoted 1 line · Paul Menzel

Dear Stefan,

Hi Paul,

Quoted 6 lines · Stefan Assmann
Quoted 3 lines

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

Quoted 25 lines
Quoted 10 lines
---
  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +0 -0
index f8aa4deceb5e..3d2440838822 100644

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate, · line 4270

Quoted 9 lines
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 -1
@@ -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

Tested-by on v1 1/1
#3 lore raw
In reply to Stefan Assmann
Quoted 9 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Stefan Assmann
Sent: Monday, September 2, 2019 11:08 PM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; davem at davemloft.net; sassmann at kpanic.de
Subject: [Intel-wired-lan] [PATCH] i40e: clear __I40E_VIRTCHNL_OP_PENDING on invalid min tx rate

Quoted 8 lines

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.

---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)