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 7EE24A034F for ; Mon, 6 Dec 2021 09:27:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77BA740040; Mon, 6 Dec 2021 09:27:55 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id B582A40040 for ; Mon, 6 Dec 2021 09:27:54 +0100 (CET) Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 826D93F1B2 for ; Mon, 6 Dec 2021 08:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638779274; bh=+m6Wg8KpOVZ4CebdariOBRyBX3ycgxO/LWBO58ixyls=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=P8pRBvklJXD9DXMEw/Qpe3QzPF80PpZerxHCOCvxabjA7aSenxmBces/lp/wOKBVN 1/+NUbZdP5L7DBOcSl9fyZGZkRoST2rXcZZrrH7XCQ2usnRAwKZtRz3RVBzGm+g5RT ydK7LFbm2xtHkCE2GzEThoOOff2jlLgiyl2sI1+vjWcDRzFX811eAmqYpNX+arwCsD AIG3Gd4JI5MpIWG73mf8U4rDTN6MescS+kGvtslidPLYjznKv2gY9E23sD06V5/M8p tHhgJyWLxpFFw2N/fMBS4iTvGKKMzLjptCMaE3aoZwC6+5XBQSRRPvHkfDir7g/oEL /89wAwhdAGCSg== Received: by mail-qk1-f197.google.com with SMTP id bj32-20020a05620a192000b0046dcca212b6so3833721qkb.6 for ; Mon, 06 Dec 2021 00:27:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+m6Wg8KpOVZ4CebdariOBRyBX3ycgxO/LWBO58ixyls=; b=Ejs0PxrHCgXDxmkoVk0FwuAhY54Rggsj+PhL85k8t4gv1CBFcxKsOByBqiRz4tm3O6 1Z9QtY2T5GxWlmJB6AnuKctweUsE2N7Ue6uPBSlRujqOTtA0ADRTxi8boh3ZM8BtXvPz LtXqDg8xnSmETWixQ2I9omuuuxmVcL2Q4URe2u0OpAM5ZEixByRHRbjSfb9XvLPv+GEg grCoDmK6ULp9uqCcnVOyr0u70yOlWO2AX2QezKDfKTyadVHVe0Ah77E7u4wkgRt4gVhy yzkrgyNmwvtJL2snEVwL3Fz3gKzqdp4PxEES0yPYZ6eR8tXUssXWsd/H4zyVsXSWhJus mi4Q== X-Gm-Message-State: AOAM532tJkmb1IP5REmuLabCGjQAhOFwl2dhHaD3a8zFw25HfYD7Qk9d UsvsOsbMLHRI6Gwm2Dyd3wjPINOW7uNme93yn/R33X7VohVgbG/kbbyhzN6zZnlvI6R487iKQa/ g39ZyqVEtSOzyid//MhukThq7Rb/KSWKUL+U7H709 X-Received: by 2002:a05:6214:62b:: with SMTP id a11mr34951068qvx.26.1638779272872; Mon, 06 Dec 2021 00:27:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRkolSjr++3wM4JA2Gajttlx8DAzSFHGiGvUl06lSZsXEI49ROv/UbwcB0Bsx9StFC8066JVvZcUSid3UY3IA= X-Received: by 2002:a05:6214:62b:: with SMTP id a11mr34951056qvx.26.1638779272653; Mon, 06 Dec 2021 00:27:52 -0800 (PST) MIME-Version: 1.0 References: <20211205040206.8050-1-kalesh-anakkur.purayil@broadcom.com> In-Reply-To: <20211205040206.8050-1-kalesh-anakkur.purayil@broadcom.com> From: Christian Ehrhardt Date: Mon, 6 Dec 2021 09:27:26 +0100 Message-ID: Subject: Re: [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads To: Kalesh A P Cc: stable@dpdk.org Content-Type: text/plain; charset="UTF-8" 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 On Sun, Dec 5, 2021 at 4:42 AM Kalesh A P wrote: > > From: Kalesh AP > > [ upstream commit baedf29794aa7cf8527d6362af17dce5046b1f51 ] Applied, thanks! > VLAN offload capability may be disabled in the FW. The driver > should not attempt to override or utilize this feature in such > scenarios since it will not work as expected. > > Fixes: 0a6d2a720078 ("net/bnxt: get device infos") > > Signed-off-by: Kalesh AP > Reviewed-by: Somnath Kotur > Reviewed-by: Lance Richardson > Reviewed-by: Ajit Khaparde > --- > drivers/net/bnxt/bnxt.h | 2 ++ > drivers/net/bnxt/bnxt_ethdev.c | 8 +++++--- > drivers/net/bnxt/bnxt_hwrm.c | 10 ++++++++++ > drivers/net/bnxt/hsi_struct_def_dpdk.h | 3 +++ > 4 files changed, 20 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h > index ceff0a7..63d7475 100644 > --- a/drivers/net/bnxt/bnxt.h > +++ b/drivers/net/bnxt/bnxt.h > @@ -592,11 +592,13 @@ struct bnxt { > #define BNXT_FW_CAP_IF_CHANGE BIT(1) > #define BNXT_FW_CAP_ERROR_RECOVERY BIT(2) > #define BNXT_FW_CAP_ERR_RECOVER_RELOAD BIT(3) > +#define BNXT_FW_CAP_VLAN_TX_INSERT BIT(4) > > pthread_mutex_t flow_lock; > > uint32_t vnic_cap_flags; > #define BNXT_VNIC_CAP_COS_CLASSIFY BIT(0) > +#define BNXT_VNIC_CAP_VLAN_RX_STRIP BIT(1) > unsigned int rx_nr_rings; > unsigned int rx_cp_nr_rings; > unsigned int rx_num_qs_per_vnic; > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c > index 81f9886..d4c63fa 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -100,8 +100,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { > ETH_RSS_NONFRAG_IPV6_TCP | \ > ETH_RSS_NONFRAG_IPV6_UDP) > > -#define BNXT_DEV_TX_OFFLOAD_SUPPORT (DEV_TX_OFFLOAD_VLAN_INSERT | \ > - DEV_TX_OFFLOAD_IPV4_CKSUM | \ > +#define BNXT_DEV_TX_OFFLOAD_SUPPORT (DEV_TX_OFFLOAD_IPV4_CKSUM | \ > DEV_TX_OFFLOAD_TCP_CKSUM | \ > DEV_TX_OFFLOAD_UDP_CKSUM | \ > DEV_TX_OFFLOAD_TCP_TSO | \ > @@ -114,7 +113,6 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { > DEV_TX_OFFLOAD_MULTI_SEGS) > > #define BNXT_DEV_RX_OFFLOAD_SUPPORT (DEV_RX_OFFLOAD_VLAN_FILTER | \ > - DEV_RX_OFFLOAD_VLAN_STRIP | \ > DEV_RX_OFFLOAD_IPV4_CKSUM | \ > DEV_RX_OFFLOAD_UDP_CKSUM | \ > DEV_RX_OFFLOAD_TCP_CKSUM | \ > @@ -587,7 +585,11 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, > dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT; > if (bp->flags & BNXT_FLAG_PTP_SUPPORTED) > dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TIMESTAMP; > + if (bp->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP) > + dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_VLAN_STRIP; > dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT; > + if (bp->fw_cap & BNXT_FW_CAP_VLAN_TX_INSERT) > + dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_VLAN_INSERT; > dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT; > > dev_info->default_rxconf = (struct rte_eth_rxconf) { > diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c > index 844f1e8..25e6b8c 100644 > --- a/drivers/net/bnxt/bnxt_hwrm.c > +++ b/drivers/net/bnxt/bnxt_hwrm.c > @@ -734,6 +734,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) > if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE) > bp->fw_cap |= BNXT_FW_CAP_HOT_RESET; > > + if (!(flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED)) { > + bp->fw_cap |= BNXT_FW_CAP_VLAN_TX_INSERT; > + PMD_DRV_LOG(DEBUG, "VLAN acceleration for TX is enabled\n"); > + } > unlock: > HWRM_UNLOCK(); > > @@ -787,6 +791,12 @@ int bnxt_hwrm_vnic_qcaps(struct bnxt *bp) > PMD_DRV_LOG(INFO, "CoS assignment capability enabled\n"); > } > > + if (rte_le_to_cpu_32(resp->flags) & > + HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP) { > + bp->vnic_cap_flags |= BNXT_VNIC_CAP_VLAN_RX_STRIP; > + PMD_DRV_LOG(DEBUG, "Rx VLAN strip capability enabled\n"); > + } > + > bp->max_tpa_v2 = rte_le_to_cpu_16(resp->max_aggs_supported); > > HWRM_UNLOCK(); > diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h > index 6a16ea9..0935eb7 100644 > --- a/drivers/net/bnxt/hsi_struct_def_dpdk.h > +++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h > @@ -7441,6 +7441,9 @@ struct hwrm_func_qcaps_output { > */ > #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED \ > UINT32_C(0x4000000) > + /* If set to 1, then the vlan acceleration for TX is disabled. */ > + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED \ > + UINT32_C(0x8000000) > /* > * This value is current MAC address configured for this > * function. A value of 00-00-00-00-00-00 indicates no > -- > 2.10.1 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd