From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) by dpdk.org (Postfix) with ESMTP id C73DFCFBC; Fri, 24 Mar 2017 08:41:30 +0100 (CET) Received: from pps.filterd (m0095336.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v2O7fRpS017149; Fri, 24 Mar 2017 00:41:27 -0700 Received: from avcashub1.qlogic.com ([198.186.0.116]) by mx0a-0016ce01.pphosted.com with ESMTP id 29b9xy1cr5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 24 Mar 2017 00:41:27 -0700 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.191) with Microsoft SMTP Server id 14.3.235.1; Fri, 24 Mar 2017 00:41:26 -0700 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id v2O7fQ9E012403; Fri, 24 Mar 2017 00:41:27 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@cavium.com using -f From: Rasesh Mody To: , CC: Harish Patil , , Date: Fri, 24 Mar 2017 00:40:58 -0700 Message-ID: <1490341259-12320-2-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1490341259-12320-1-git-send-email-rasesh.mody@cavium.com> References: <1490341259-12320-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8476 signatures=668449 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703240070 Subject: [dpdk-stable] [PATCH 2/3] net/qede: fix VF's RSS configuration failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2017 07:41:31 -0000 From: Harish Patil The newer SR-IOV PF drivers expects RX/TX queues to be created before applying RSS configuration. This patch addresses this requirement by deferring RSS configuration till the queues are created. Even though this issue is only seen in SR-IOV context, the changes will be made applicable to PF also to keep the behavior consistent between VF/PF. Fixes: 7ab35bf6b97b ("net/qede: fix RSS") Signed-off-by: Harish Patil --- drivers/net/qede/qede_ethdev.c | 18 +++--------------- drivers/net/qede/qede_ethdev.h | 2 +- drivers/net/qede/qede_rxtx.c | 9 +++++++++ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 798783b..e096f63 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -798,7 +798,7 @@ static void qede_prandom_bytes(uint32_t *buff) buff[i] = rand(); } -static int qede_config_rss(struct rte_eth_dev *eth_dev) +int qede_config_rss(struct rte_eth_dev *eth_dev) { struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); @@ -906,20 +906,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) if (rc != 0) return rc; - /* Do RSS configuration after vport-start */ - switch (rxmode->mq_mode) { - case ETH_MQ_RX_RSS: - rc = qede_config_rss(eth_dev); - if (rc != 0) { - qdev->ops->vport_stop(edev, 0); - qede_dealloc_fp_resc(eth_dev); - return -EINVAL; - } - break; - case ETH_MQ_RX_NONE: - DP_INFO(edev, "RSS is disabled\n"); - break; - default: + if (!(rxmode->mq_mode == ETH_MQ_RX_RSS || + rxmode->mq_mode == ETH_MQ_RX_NONE)) { DP_ERR(edev, "Unsupported RSS mode\n"); qdev->ops->vport_stop(edev, 0); qede_dealloc_fp_resc(eth_dev); diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index 799a3ba..9a7e9c2 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -234,7 +234,7 @@ static uint16_t qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev, struct ecore_arfs_config_params *param); /* Non-static functions */ -void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf); +int qede_config_rss(struct rte_eth_dev *eth_dev); int qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info); diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 380d8fb..6c2837e 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -1702,6 +1702,15 @@ int qede_dev_start(struct rte_eth_dev *eth_dev) return rc; } + /* Newer SR-IOV PF driver expects RX/TX queues to be started before + * enabling RSS. Hence RSS configuration is deferred upto this point. + * Also, we would like to retain similar behavior in PF case, so we + * don't do PF/VF specific check here. + */ + if (eth_dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) + if (qede_config_rss(eth_dev)) + return -1; + /* Bring-up the link */ qede_dev_set_link_state(eth_dev, true); -- 1.7.10.3