From patchwork Wed Apr 6 02:53: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: 12802731 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 8489DC433F5 for ; Wed, 6 Apr 2022 08:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234146AbiDFJB2 (ORCPT ); Wed, 6 Apr 2022 05:01:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452993AbiDFI6k (ORCPT ); Wed, 6 Apr 2022 04:58:40 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6230732FDFF for ; Tue, 5 Apr 2022 19:54:38 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id a16-20020a17090a6d9000b001c7d6c1bb13so1368125pjk.4 for ; Tue, 05 Apr 2022 19:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pOs06JOLSJ18Sili3jIBbu/NoZr30mqQJP786fL/rmU=; b=bwc8R2cJoR4I2lc4t6tqEQJjPoqCxBYfjmTGkZ7a62f55gwIhNA5AS9RL/7yMFoUPo CKewgwy50H91FdgiJSzdohy2tz3SkOV6Clrgq4DRlmxwsw+IOon7p+F4yFoHXpo178g+ lMaMplrT7KR3/VzY2yynwHh2slpJ8TP3/Zit8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pOs06JOLSJ18Sili3jIBbu/NoZr30mqQJP786fL/rmU=; b=kh5sGJdBO+zxGdow5U0w3agIum8UEVpQVNYrj3aZSKFAViJzEq2rFYFzk7lAV3yY+w aHRaTAfuDPh+dn9SnvuTU0cEslqh91ztBuCZMPtEjAu9DwqkjUEpv+Zabb3zAMM6OI/o k3JJZp6mj3F7zutJx1pGWLuJuDo9FEDmDyOde6leXf3nTkw8AfWSmtx0eXag48/j+VQQ 2G5sM9EX+vSHSWHXKbqoAQ2PqdWnkpVHBOmGc40WnJtzD8qhtikvXdB7Aau1DrUHza5Y kuJqbilci6JbgsEa6fs2/IyRp1pd6ofia0i9bRXP1LF/Fqj5xgdOBG8uP7Rc0whDdx/i go8Q== X-Gm-Message-State: AOAM530TCJNBYcMk+khsoCU7Dr8AnzhPIvGTLpS5Ff2FakBcYy1cmk37 CQJnmtLPCsU39qXTXXOzCy5Npw== X-Google-Smtp-Source: ABdhPJwI9CIHJjTrJp8o1dVvk1xL2nmHS6/LLekZj9CCrzurcKz6Ml4mujAckFP+yQhb9B6nsg841g== X-Received: by 2002:a17:90b:4f41:b0:1c7:928d:196e with SMTP id pj1-20020a17090b4f4100b001c7928d196emr7527886pjb.47.1649213672121; Tue, 05 Apr 2022 19:54:32 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x9-20020a17090a970900b001ca6c59b350sm3395111pjo.2.2022.04.05.19.54.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 19:54:31 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com, bpf@vger.kernel.org, john.fastabend@gmail.com, toke@redhat.com, lorenzo@kernel.org, ast@kernel.org, daniel@iogearbox.net, echaudro@redhat.com, pabeni@redhat.com, Michael Chan Subject: [PATCH net-next v3 11/11] bnxt: XDP multibuffer enablement Date: Tue, 5 Apr 2022 22:53:53 -0400 Message-Id: <1649213633-7662-12-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1649213633-7662-1-git-send-email-michael.chan@broadcom.com> References: <1649213633-7662-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: Andy Gospodarek Allow aggregation buffers to be in place in the receive path and allow XDP programs to be attached when using a larger than 4k MTU. v3: Add a check to sure XDP program supports multipage packets. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +-- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 25d74c9030fd..0489c1c2e7dd 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1939,8 +1939,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, xdp_active = true; } - /* skip running XDP prog if there are aggregation bufs */ - if (!agg_bufs && xdp_active) { + if (xdp_active) { if (bnxt_rx_xdp(bp, rxr, cons, xdp, data, &len, event)) { rc = 1; goto next_rx; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c index c2905f0a8c6c..f02fe906dedb 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c @@ -387,8 +387,9 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) int tx_xdp = 0, rc, tc; struct bpf_prog *old; - if (prog && bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) { - netdev_warn(dev, "MTU %d larger than largest XDP supported MTU %d.\n", + if (prog && !prog->aux->xdp_has_frags && + bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) { + netdev_warn(dev, "MTU %d larger than %d without XDP frag support.\n", bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU); return -EOPNOTSUPP; }