From patchwork Mon Aug 22 15:06:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12950729 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A357CC32774 for ; Mon, 22 Aug 2022 15:09:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235916AbiHVPJb (ORCPT ); Mon, 22 Aug 2022 11:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235998AbiHVPJF (ORCPT ); Mon, 22 Aug 2022 11:09:05 -0400 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01EED3DF3E for ; Mon, 22 Aug 2022 08:07:09 -0700 (PDT) Received: by mail-qv1-xf33.google.com with SMTP id e4so8313122qvr.2 for ; Mon, 22 Aug 2022 08:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=KVNuV0nawU5p5zFBSk1Rmd1N53t5M5FBZ+StSlZLmB0=; b=XC81aM+C7mDXhBljNn0P736uUZZKfbRNFo5HNGdfLnjtQ35dfwMt58RKBzm9COhJGn 2dSeHYXXMeXi3S3kZ471pNDrNFZeeVel65ALZQeEsvUyJkT4QzYu3n+0IhGGLlaRYmyc wFyuxY/wQ2FkNM23YMAGSnYoFzpi1kTqV35mE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=KVNuV0nawU5p5zFBSk1Rmd1N53t5M5FBZ+StSlZLmB0=; b=LlUQD1DAtZJ+yMV3jseHXOYnXA8OFX30pdl818+fAoFWdDh81tbavhU5U4Vk3Zief4 QEK+mfJ2UEW7B6MyxuH9bUbp/kBTBlzvY/WZ3vVD9Dj0OuCla9gEZz8taXAOh7c0dXN7 Li/I8MamiZ0m4Z+lzJHHOm7v/kW1UlDeuJyfMzC8LnAb+j1/ULrsS55/RIzsMREnuBCH +xAGHir0sEGj5kj6IFsyH6lTLxFJLm0aP2AmmqIteF7hBQUy5eLhfIH7UrdhVeEV4IGC rOHIQ9/qLQjg+nqhlUcDGY5ts3bSf+sZOIm7/BKgL6+0xtKziwUw1dmb4svNb/waVBTk JKyg== X-Gm-Message-State: ACgBeo1dG6V6IBXX3TSnlV6pCtqUU3+mBU56PHnGn2l4rns/cAgAmTq2 5VruZ/edq4lUwvr10v4X7OfSDw== X-Google-Smtp-Source: AA6agR41cPOQFxAY/KdscTR0eCQdAWgtSQrZay4PBKCqX+mVaMgaJrC/JWnDMwY+cLn4s1v0V0GMJA== X-Received: by 2002:a05:6214:76a:b0:496:c298:d165 with SMTP id f10-20020a056214076a00b00496c298d165mr13556874qvz.100.1661180825917; Mon, 22 Aug 2022 08:07:05 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f39-20020a05622a1a2700b00342f05defd1sm9380836qtb.66.2022.08.22.08.07.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2022 08:07:05 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, gospo@broadcom.com, Pavan Chebbi Subject: [PATCH net 1/4] bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use Date: Mon, 22 Aug 2022 11:06:51 -0400 Message-Id: <1661180814-19350-2-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> References: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Pavan Chebbi Using BNXT_PAGE_MODE_BUF_SIZE + offset as buffer length value is not sufficient when running single buffer XDP programs doing redirect operations. The stack will complain on missing skb tail room. Fix it by using PAGE_SIZE when calling xdp_init_buff() for single buffer programs. Fixes: b231c3f3414c ("bnxt: refactor bnxt_rx_xdp to separate xdp_init_buff/xdp_prepare_buff") Reviewed-by: Somnath Kotur Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 075c6206325c..b1b17f911300 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -2130,6 +2130,7 @@ struct bnxt { #define BNXT_DUMP_CRASH 1 struct bpf_prog *xdp_prog; + u8 xdp_has_frags; struct bnxt_ptp_cfg *ptp_cfg; u8 ptp_all_rx_tstamp; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c index f53387ed0167..c3065ec0a479 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c @@ -181,6 +181,7 @@ void bnxt_xdp_buff_init(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, struct xdp_buff *xdp) { struct bnxt_sw_rx_bd *rx_buf; + u32 buflen = PAGE_SIZE; struct pci_dev *pdev; dma_addr_t mapping; u32 offset; @@ -192,7 +193,10 @@ void bnxt_xdp_buff_init(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, mapping = rx_buf->mapping - bp->rx_dma_offset; dma_sync_single_for_cpu(&pdev->dev, mapping + offset, *len, bp->rx_dir); - xdp_init_buff(xdp, BNXT_PAGE_MODE_BUF_SIZE + offset, &rxr->xdp_rxq); + if (bp->xdp_has_frags) + buflen = BNXT_PAGE_MODE_BUF_SIZE + offset; + + xdp_init_buff(xdp, buflen, &rxr->xdp_rxq); xdp_prepare_buff(xdp, *data_ptr - offset, offset, *len, false); } @@ -397,8 +401,10 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) netdev_warn(dev, "ethtool rx/tx channels must be combined to support XDP.\n"); return -EOPNOTSUPP; } - if (prog) + if (prog) { tx_xdp = bp->rx_nr_rings; + bp->xdp_has_frags = prog->aux->xdp_has_frags; + } tc = netdev_get_num_tc(dev); if (!tc) From patchwork Mon Aug 22 15:06:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12950730 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BE34C28D13 for ; Mon, 22 Aug 2022 15:09:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236025AbiHVPJe (ORCPT ); Mon, 22 Aug 2022 11:09:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235921AbiHVPJG (ORCPT ); Mon, 22 Aug 2022 11:09:06 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90563DF3C for ; Mon, 22 Aug 2022 08:07:09 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id j17so8067978qtp.12 for ; Mon, 22 Aug 2022 08:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=lW+aRBABY6LQAf9GnaDCuQD8XbOsKF80aq7s3IVyhJE=; b=Xsw2DJaZmIouHVr86BUCkB7jKOOMzV/QdZB2pKAkJRbBotuii5Ftv5QAQZnwtfCn+I o+9CfGyqocMpM0/wBkf6vohroaGfCPd9B6UftcQlppMbytdGSBu4LwddGB5svjGjmSsl Q+QR1RGI6uAYtB6pTXLYMFS681+T5eCG3fmuQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=lW+aRBABY6LQAf9GnaDCuQD8XbOsKF80aq7s3IVyhJE=; b=Mz+9z++0W1KCFbY555SZCO4CMMYwNBSOgI84ZCZcA/tpukK2Dymx+rqugKDMsDRvaF HFJu89P5wQbVpIs1qzKsscFhaMrLGtA4svYwVKJRJgVI5PfvX56eqIFTwk3qKIJqVFzK BSpucclcb7nXm2fmtNbVeXkbOLF2JkuXBHqxkYrGqa+IQvoD33z1crrUrRORqeiZ2LAR 38CE0WFd4m9KTouzta3kv83fRgikAMvQvhiGDlhfAKhqQ3LXMkhsl2IAFjfdhmsSAyHY qS89au8sB4/UeuY+zy1mapAoOfvpNAZqDfbaBbwUgPEgFK0igqVj7LlFYRStfqRftOqt jxsw== X-Gm-Message-State: ACgBeo3fHey2Of1E4+Olpeik7CSODFYVnaE7c+zOKHxIFmDX0zJD6WN6 YD7CCSMertiho5WLzflyY101sA== X-Google-Smtp-Source: AA6agR6j5nJuMCgjel02eO+r5XO/4nXR8gbGj0SAeVVnBF4Kcvdb+Jho2GpJUCK/vubhZGEJtFuiuw== X-Received: by 2002:a05:622a:b:b0:342:f3de:e055 with SMTP id x11-20020a05622a000b00b00342f3dee055mr15294330qtw.43.1661180827570; Mon, 22 Aug 2022 08:07:07 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f39-20020a05622a1a2700b00342f05defd1sm9380836qtb.66.2022.08.22.08.07.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2022 08:07:07 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, gospo@broadcom.com, Vikas Gupta Subject: [PATCH net 2/4] bnxt_en: set missing reload flag in devlink features Date: Mon, 22 Aug 2022 11:06:52 -0400 Message-Id: <1661180814-19350-3-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> References: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta Add missing devlink_set_features() API for callbacks reload_down and reload_up to function. Fixes: 228ea8c187d8 ("bnxt_en: implement devlink dev reload driver_reinit") Reviewed-by: Somnath Kotur Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c index 059f96f7a96f..a36803e79e92 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -1306,6 +1306,7 @@ int bnxt_dl_register(struct bnxt *bp) if (rc) goto err_dl_port_unreg; + devlink_set_features(dl, DEVLINK_F_RELOAD); out: devlink_register(dl); return 0; From patchwork Mon Aug 22 15:06:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12950728 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F100C28D13 for ; Mon, 22 Aug 2022 15:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236019AbiHVPJ3 (ORCPT ); Mon, 22 Aug 2022 11:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236149AbiHVPJD (ORCPT ); Mon, 22 Aug 2022 11:09:03 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CF133E748 for ; Mon, 22 Aug 2022 08:07:10 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id g16so8031570qkl.11 for ; Mon, 22 Aug 2022 08:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=vhpY4khbia4ahavuPkAyUGmPuBQwq+sJnXfnnGjoPF4=; b=Dd5w1yoZWATmRq7hi09+qmWN/5czWyBxXLz+i9wRjCr3IFbGnwK8wLJ7VSNmmQHP6g zV8y31d727WMIjesZZVb8Cr+PRXf2gMHVb6nOiB+2G781qL4k0Wh5S6yfNNN0Jx8Ak+S 0AlmxUwHWZWEDnm5I7XlWElECiKdhiVh2zGNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=vhpY4khbia4ahavuPkAyUGmPuBQwq+sJnXfnnGjoPF4=; b=rw8TGNICokhbT8qxN0up7RyEdtOVfahyCDe2Ki3x9CqhSKssDnJiqWpNqIae3gf4M/ 3PsfS/BCgUuW+ESOH3E/78xFoApkso/86lXqaNEAu5U7+h7n7WMfnQ1s1554ZBPU5rkk yasA+FnoRJa3GYOz8WdUFeNoGZIuKaFiOD0bGKG32xZmea/T/TB7IUWF/vF6+u9tekni dcPDn/PKh53y9drFxWmnb1beVzK91ozUsE40DjgTr7qEM8QT1KKdTUQvNdCCJD/63mW9 FoUPD2OXk4RqQ+QA2kWIX8kupvs3hPfN/hZfh369W0VyUkDRxrcfZiVxbkk5nwDMRAfZ ioSQ== X-Gm-Message-State: ACgBeo1ftlWCtBVi/ciE82JFS5nEsnD6wwwt4j7MDlwvFtq/4RlLdNgP s+UIjdROkP7m2KLrr+C8GAiZsA== X-Google-Smtp-Source: AA6agR58g19yRJ/OecfUFdTSjtvuk33ThLP9hmXufqqvM8VqbUPfYoI0hBeVBw+FBTcgn9RMFr/k9Q== X-Received: by 2002:a05:620a:e15:b0:6bc:980:dbaf with SMTP id y21-20020a05620a0e1500b006bc0980dbafmr4290443qkm.315.1661180829221; Mon, 22 Aug 2022 08:07:09 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f39-20020a05622a1a2700b00342f05defd1sm9380836qtb.66.2022.08.22.08.07.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2022 08:07:08 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, gospo@broadcom.com, Vikas Gupta Subject: [PATCH net 3/4] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips Date: Mon, 22 Aug 2022 11:06:53 -0400 Message-Id: <1661180814-19350-4-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> References: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta There are 2 issues: 1. We should decrement hw_resc->max_nqs instead of hw_resc->max_irqs with the number of NQs assigned to the VFs. The IRQs are fixed on each function and cannot be re-assigned. Only the NQs are being assigned to the VFs. 2. vf_msix is the total number of NQs to be assigned to the VFs. So we should decrement vf_msix from hw_resc->max_nqs. Fixes: b16b68918674 ("bnxt_en: Add SR-IOV support for 57500 chips.") Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c index 730febd19330..a4cba7cb2783 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -623,7 +623,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset) hw_resc->max_stat_ctxs -= le16_to_cpu(req->min_stat_ctx) * n; hw_resc->max_vnics -= le16_to_cpu(req->min_vnics) * n; if (bp->flags & BNXT_FLAG_CHIP_P5) - hw_resc->max_irqs -= vf_msix * n; + hw_resc->max_nqs -= vf_msix; rc = pf->active_vfs; } From patchwork Mon Aug 22 15:06:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12950731 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 806F4C32774 for ; Mon, 22 Aug 2022 15:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235909AbiHVPKG (ORCPT ); Mon, 22 Aug 2022 11:10:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236121AbiHVPJS (ORCPT ); Mon, 22 Aug 2022 11:09:18 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BEEA3E755 for ; Mon, 22 Aug 2022 08:07:12 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id a4so8074164qto.10 for ; Mon, 22 Aug 2022 08:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=mbSWIhRexmAzDtoQ7NRLqIKYoz1aY3JpVIU/WCcyAoQ=; b=KhNH7ijR0AjDq2lQUAXqpHc802sbjKwOK+dgsZx+iT+9yGxpcLHarLwut7aM+nQEnV d8ZCHGQhKDpWYz2ZxDRGsPY7OaoDcY6uHKSNgZPBp8899ysMx57xD+ldvDRjvIGDvJAs 2ORQh5NNIIBkoi+AjFXqC7/M1kcb4EoYm/Reg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=mbSWIhRexmAzDtoQ7NRLqIKYoz1aY3JpVIU/WCcyAoQ=; b=tJX60TYjlVidq39tyBh3EViIST11ng298G21kJGZ7ArQzXLknU6q6/kV/C+8KKZe6b tWNrdMojpig+YS8XjEhGJPH1a1YeYdYoLZRMfRUZHuw6cmyI9NYK2shtJT3xzZEmFQ4P 9Mz+SfOV0yYMH266K60MAHMMnB0RGCFu+t5eA6OYwaMp3RX00ZLX0DUA/5PEiqCa6gBY IEyVVgj0NgXS+OqpAtQQGXhJUZ40eqpSRuZFmAObcr8yfgoLqesKXkmDQcadIWkw7eA0 wqL4d7bh+RY9P7Vp/A/jy/5pDFJErEuWZRVaCibRgIBISSejembpcIbRjpAo8HVikEgq 31vg== X-Gm-Message-State: ACgBeo3cIdAZcuWdgCJMtuphBtFGSMc8jihSVTjJUGKELFsNAzaAV4yc 0pF01MKDWJWvoOm2eOt0tBuYKg== X-Google-Smtp-Source: AA6agR7AWIrqWtkOkhyIlgWNGcI6vfeEVBUdJFm8EYcequ0KqsnKyJpV9tlzf8oC7BaHMr5p1NMdOQ== X-Received: by 2002:ac8:5fd6:0:b0:343:4b4:1022 with SMTP id k22-20020ac85fd6000000b0034304b41022mr15652769qta.616.1661180830582; Mon, 22 Aug 2022 08:07:10 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f39-20020a05622a1a2700b00342f05defd1sm9380836qtb.66.2022.08.22.08.07.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2022 08:07:10 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, gospo@broadcom.com, Vikas Gupta Subject: [PATCH net 4/4] bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback Date: Mon, 22 Aug 2022 11:06:54 -0400 Message-Id: <1661180814-19350-5-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> References: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta LRO/GRO_HW should be disabled if there is an attached XDP program. BNXT_FLAG_TPA is the current setting of the LRO/GRO_HW. Using BNXT_FLAG_TPA to disable LRO/GRO_HW will cause these features to be permanently disabled once they are disabled. Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff") Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index ba0f1ffac507..f46eefb5a029 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11178,10 +11178,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp)) features &= ~NETIF_F_NTUPLE; - if (bp->flags & BNXT_FLAG_NO_AGG_RINGS) - features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW); - - if (!(bp->flags & BNXT_FLAG_TPA)) + if ((bp->flags & BNXT_FLAG_NO_AGG_RINGS) || bp->xdp_prog) features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW); if (!(features & NETIF_F_GRO))