From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A470BA034C; Wed, 27 Apr 2022 16:59:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C07F4282B; Wed, 27 Apr 2022 16:58:45 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id F13D24281C for ; Wed, 27 Apr 2022 16:58:43 +0200 (CEST) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 87D40C0000E8; Wed, 27 Apr 2022 07:58:42 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 87D40C0000E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1651071523; bh=MXwu1lx4KJO2HBRq8OJA7Ygmx4hNS4zlwNR0q8RLnxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pKFCg5HjHJUJrFGCkZt4NtAxAiweyN1v0uRjQTkQghcF+cijjIEbgF3TNNf8J7WJr fHEW8rv4M7RUtNhEvZJOI3E3uSuDI8EGnbYqGuUWfQ2r1gH0hPQFB6yltQOyF+rqz8 XrqOGf+ksJmE/h5LSChuABsUW13wV7CbPMULzskQ= From: Kalesh A P To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com Subject: [PATCH 10/17] net/bnxt: fix to handle queue stop during RSS flow create Date: Wed, 27 Apr 2022 20:28:14 +0530 Message-Id: <20220427145821.5987-11-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com> References: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Somnath Kotur The programming of the RSS table was not taking into account if any of the queues in the set were stopped prior to the flow creation, hence leading to a vnic RSS config cmd failure thrown by the FW. Fix by programming only the active queues in the RSS action queue set. Fixes: 239695f754cb ("net/bnxt: enhance RSS action support") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde Reviewed-by: Kalesh AP --- drivers/net/bnxt/bnxt_flow.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index fc5bacf..f8e1096 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -1115,7 +1115,7 @@ bnxt_vnic_rss_cfg_update(struct bnxt *bp, struct rte_flow_error *error) { const struct rte_flow_action_rss *rss; - unsigned int rss_idx, i, j; + unsigned int rss_idx, i, j, fw_idx; uint16_t hash_type; uint64_t types; int rc; @@ -1232,11 +1232,21 @@ bnxt_vnic_rss_cfg_update(struct bnxt *bp, goto skip_rss_table; /* Prepare the indirection table */ - for (rss_idx = 0; rss_idx < HW_HASH_INDEX_SIZE; rss_idx++) { + for (rss_idx = 0, fw_idx = 0; rss_idx < HW_HASH_INDEX_SIZE; + rss_idx++, fw_idx++) { + uint8_t *rxq_state = bp->eth_dev->data->rx_queue_state; struct bnxt_rx_queue *rxq; uint32_t idx; - idx = rss->queue[rss_idx % rss->queue_num]; + for (i = 0; i < bp->rx_cp_nr_rings; i++) { + idx = rss->queue[fw_idx % rss->queue_num]; + if (rxq_state[idx] != RTE_ETH_QUEUE_STATE_STOPPED) + break; + fw_idx++; + } + + if (i == bp->rx_cp_nr_rings) + return 0; if (BNXT_CHIP_P5(bp)) { rxq = bp->rx_queues[idx]; -- 2.10.1