From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <rahul.lakkireddy@chelsio.com>
Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8])
 by dpdk.org (Postfix) with ESMTP id 87A16F72
 for <dev@dpdk.org>; Thu, 26 Jul 2018 09:29:58 +0200 (CEST)
Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94])
 by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w6Q7TnQq020718;
 Thu, 26 Jul 2018 00:29:55 -0700
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: shaguna@chelsio.com, nirranjan@chelsio.com, indranil@chelsio.com
Date: Thu, 26 Jul 2018 12:58:06 +0530
Message-Id: <1532590086-10242-1-git-send-email-rahul.lakkireddy@chelsio.com>
X-Mailer: git-send-email 2.5.3
Subject: [dpdk-dev] [PATCH] net/cxgbevf: don't allocate control queues for
	VFs
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Jul 2018 07:29:59 -0000

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

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);
-- 
2.14.1