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 CA0C9A034E for ; Mon, 21 Feb 2022 16:38:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C48FF40E5A; Mon, 21 Feb 2022 16:38:25 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0FBE6410F7 for ; Mon, 21 Feb 2022 16:38:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645457903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PJxMwwz4KwTTWyzc7n0rP/9Lc5tx7btShYumiOBdex4=; b=Ve739xZeAE0bEm4qhiMpWWsclKoJf5SERxj33ArbFz1Rju/bzlt5GShH5zIhDIy79qg2IN KwKkmlhddTmzv6k1J3c8bVCrNzcVWwzt6ushdULBAeAB5C+cZ7RkL4dvGaJu1tn3/TPm3R mMDJMdt2+fmBYL0oMVM9a7DtbrgFpCM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-IvWbQwPNPoCBqkIMviFPxA-1; Mon, 21 Feb 2022 10:38:20 -0500 X-MC-Unique: IvWbQwPNPoCBqkIMviFPxA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CFAF1091DA0; Mon, 21 Feb 2022 15:38:19 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA0757E2EF; Mon, 21 Feb 2022 15:38:17 +0000 (UTC) From: Kevin Traynor To: Kalesh AP Cc: Ajit Khaparde , Somnath Kotur , dpdk stable Subject: patch 'net/bnxt: fix multicast address set' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:33:59 +0000 Message-Id: <20220221153625.152324-50-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/26/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/5e35fae22237b5f9ab98d833288bcbfd68de097f Thanks. Kevin --- >From 5e35fae22237b5f9ab98d833288bcbfd68de097f Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Tue, 4 Jan 2022 14:08:07 +0530 Subject: [PATCH] net/bnxt: fix multicast address set [ upstream commit 4dc9409e01b41a8cd8d53bcc38344666fd42a7c9 ] Fix bnxt_dev_set_mc_addr_list_op. Fix to cache the multicast mac addresses added to the port to the driver private structure memory. Use this cached mc list to program the FW. This fixes an issue where multicast packets reception is successful only if the multicast mac address of the packets is the first one in the multicast address list of the port. This is in preparation for another fix in the series. Fixes: d69851df12b2 ("net/bnxt: support multicast filter and set MAC addr") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 5 +++++ drivers/net/bnxt/bnxt_ethdev.c | 34 +++++++++++++++++++++++++--------- drivers/net/bnxt/bnxt_hwrm.c | 4 ++-- drivers/net/bnxt/bnxt_vnic.c | 7 +------ drivers/net/bnxt/bnxt_vnic.h | 4 ---- 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 234161053f..521fcb7af3 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -892,4 +892,9 @@ struct bnxt { struct bnxt_ring_stats *prev_rx_ring_stats; struct bnxt_ring_stats *prev_tx_ring_stats; + +#define BNXT_MAX_MC_ADDRS 16 + struct rte_ether_addr *mcast_addr_list; + rte_iova_t mc_list_dma_addr; + uint32_t nb_mc_addr; }; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f79f33ab4e..50ffa30577 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -2832,7 +2832,6 @@ bnxt_dev_set_mc_addr_list_op(struct rte_eth_dev *eth_dev, { struct bnxt *bp = eth_dev->data->dev_private; - char *mc_addr_list = (char *)mc_addr_set; struct bnxt_vnic_info *vnic; - uint32_t off = 0, i = 0; + uint32_t i = 0; int rc; @@ -2843,4 +2842,6 @@ bnxt_dev_set_mc_addr_list_op(struct rte_eth_dev *eth_dev, vnic = BNXT_GET_DEFAULT_VNIC(bp); + bp->nb_mc_addr = nb_mc_addr; + if (nb_mc_addr > BNXT_MAX_MC_ADDRS) { vnic->flags |= BNXT_VNIC_INFO_ALLMULTI; @@ -2850,12 +2851,8 @@ bnxt_dev_set_mc_addr_list_op(struct rte_eth_dev *eth_dev, /* TODO Check for Duplicate mcast addresses */ vnic->flags &= ~BNXT_VNIC_INFO_ALLMULTI; - for (i = 0; i < nb_mc_addr; i++) { - memcpy(vnic->mc_list + off, &mc_addr_list[i], - RTE_ETHER_ADDR_LEN); - off += RTE_ETHER_ADDR_LEN; - } + for (i = 0; i < nb_mc_addr; i++) + rte_ether_addr_copy(&mc_addr_set[i], &bp->mcast_addr_list[i]); - vnic->mc_addr_cnt = i; - if (vnic->mc_addr_cnt) + if (bp->nb_mc_addr) vnic->flags |= BNXT_VNIC_INFO_MCAST; else @@ -5017,4 +5014,21 @@ static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev) memcpy(ð_dev->data->mac_addrs[0], bp->mac_addr, RTE_ETHER_ADDR_LEN); + /* + * Allocate memory to hold multicast mac addresses added. + * Used to restore them during reset recovery + */ + bp->mcast_addr_list = rte_zmalloc("bnxt_mcast_addr_tbl", + sizeof(struct rte_ether_addr) * + BNXT_MAX_MC_ADDRS, 0); + if (bp->mcast_addr_list == NULL) { + PMD_DRV_LOG(ERR, "Failed to allocate multicast addr table\n"); + return -ENOMEM; + } + bp->mc_list_dma_addr = rte_malloc_virt2iova(bp->mcast_addr_list); + if (bp->mc_list_dma_addr == RTE_BAD_IOVA) { + PMD_DRV_LOG(ERR, "Fail to map mcast_addr_list to physical memory\n"); + return -ENOMEM; + } + return rc; } @@ -5917,4 +5931,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev) bnxt_free_hwrm_resources(bp); bnxt_free_error_recovery_info(bp); + rte_free(bp->mcast_addr_list); + bp->mcast_addr_list = NULL; } diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 7bcf36c9cb..568f77a87e 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -507,6 +507,6 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, } else if (vnic->flags & BNXT_VNIC_INFO_MCAST) { mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST; - req.num_mc_entries = rte_cpu_to_le_32(vnic->mc_addr_cnt); - req.mc_tbl_addr = rte_cpu_to_le_64(vnic->mc_list_dma_addr); + req.num_mc_entries = rte_cpu_to_le_32(bp->nb_mc_addr); + req.mc_tbl_addr = rte_cpu_to_le_64(bp->mc_list_dma_addr); } if (vlan_table) { diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index c63cf4b943..e05dc241dc 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -127,6 +127,5 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) rte_iova_t mz_phys_addr; - entry_length = HW_HASH_KEY_SIZE + - BNXT_MAX_MC_ADDRS * RTE_ETHER_ADDR_LEN; + entry_length = HW_HASH_KEY_SIZE; if (BNXT_CHIP_P5(bp)) @@ -170,8 +169,4 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) vnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr + rss_table_size; - vnic->mc_list = (void *)((char *)vnic->rss_hash_key + - HW_HASH_KEY_SIZE); - vnic->mc_list_dma_addr = vnic->rss_hash_key_dma_addr + - HW_HASH_KEY_SIZE; bnxt_prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE); } diff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h index 37b452f281..af3a2dd779 100644 --- a/drivers/net/bnxt/bnxt_vnic.h +++ b/drivers/net/bnxt/bnxt_vnic.h @@ -33,8 +33,4 @@ struct bnxt_vnic_info { rte_iova_t rss_hash_key_dma_addr; void *rss_hash_key; - rte_iova_t mc_list_dma_addr; - char *mc_list; - uint32_t mc_addr_cnt; -#define BNXT_MAX_MC_ADDRS 16 uint32_t flags; #define BNXT_VNIC_INFO_PROMISC (1 << 0) -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:45.733251911 +0000 +++ 0050-net-bnxt-fix-multicast-address-set.patch 2022-02-21 15:22:44.113704175 +0000 @@ -1 +1 @@ -From 4dc9409e01b41a8cd8d53bcc38344666fd42a7c9 Mon Sep 17 00:00:00 2001 +From 5e35fae22237b5f9ab98d833288bcbfd68de097f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4dc9409e01b41a8cd8d53bcc38344666fd42a7c9 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org