net/cxgbevf: don't allocate control queues for VFs

Message ID 1532590086-10242-1-git-send-email-rahul.lakkireddy@chelsio.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/cxgbevf: don't allocate control queues for VFs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Rahul Lakkireddy July 26, 2018, 7:28 a.m. UTC
  From: Shagun Agrawal <shaguna@chelsio.com>

Control queues can not be allocated for VFs. So, add check to
only allocate control queues for PFs. This fixes adapter crash
when an attempt is made to allocate control queues for VFs.

Fixes: 3a3aaabc ("net/cxgbe: add control queue to communicate filter requests")

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
  

Comments

Thomas Monjalon Aug. 2, 2018, 9:25 a.m. UTC | #1
26/07/2018 09:28, Rahul Lakkireddy:
> From: Shagun Agrawal <shaguna@chelsio.com>
> 
> Control queues can not be allocated for VFs. So, add check to
> only allocate control queues for PFs. This fixes adapter crash
> when an attempt is made to allocate control queues for VFs.
> 
> Fixes: 3a3aaabc ("net/cxgbe: add control queue to communicate filter requests")
> 
> Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>

Applied, thanks
  

Patch

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index f1ca89cec..4dcad7a23 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -433,9 +433,11 @@  int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 		if (err)
 			return err;
 		adapter->flags |= FW_QUEUE_BOUND;
-		err = setup_sge_ctrl_txq(adapter);
-		if (err)
-			return err;
+		if (is_pf4(adapter)) {
+			err = setup_sge_ctrl_txq(adapter);
+			if (err)
+				return err;
+		}
 	}
 
 	err = cfg_queue_count(eth_dev);