From patchwork Fri Apr 8 07:59:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12806233 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 76646C433EF for ; Fri, 8 Apr 2022 08:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230474AbiDHIDM (ORCPT ); Fri, 8 Apr 2022 04:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbiDHICG (ORCPT ); Fri, 8 Apr 2022 04:02:06 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B3C1700B8 for ; Fri, 8 Apr 2022 00:59:54 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id t4so7144308pgc.1 for ; Fri, 08 Apr 2022 00:59:54 -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=KT2eCTb/P9+KWwOxO0EfTCZtVO4Ep+qzffLmuHy6fn4=; b=Dpi4v1BqtIhkF/cZ2wMib0Zzg9Qd040ZEYBG1poCXvvu0qTd88HM18w75HmbWuUiVM qwm1zW1PbYBMO2U9ogWFIqoexYyrkUuMa2ugHhXO95eByLfSNo+dBy7Wh13VGHVIzham 9GPcOpB6oYZA26A4BLRyAu54QVu0pf5lX9q9k= 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=KT2eCTb/P9+KWwOxO0EfTCZtVO4Ep+qzffLmuHy6fn4=; b=l5IIfMc44b12seskk4pwZdJDrmA3HPG7DT4exF8r1VAlhbnY7wwpZ5hg+wPPapac/r bucLZiLMopOGEG892zT5ML0GnkNOicdFacdJp/+1ycwQAf08lCTzK+Apon616w63mlXA wahg/hKZXINNaaWKZhlVwfbU3k0roBbnX/BP5oj9OUCK0v8OvgUd4euROGhjnxQ4Lrfm Mpm2XI1xyRf4Eq1A/rdilvLz0HbTekvW3ws9E+T/8Nlh9iinjdPchKg6i36WIqxj7PG0 PaSLNfm20ylBkYxhOtB4mvmEq0nRPdc8VatDhddri3gxp6ol2Bwl0cgreXXsu5TYvLQ4 92nQ== X-Gm-Message-State: AOAM530K+nGihMZmZ4YInvry3l5ck2s9z9x6v6gcxYccwyCxQ5XDsp9H PuwTe1LYP7swIq9bmlCXz1ASrg== X-Google-Smtp-Source: ABdhPJyFMYPo93Vu6Ba/+dv2PVJKdeZVB6PSsC4h0fA75QqQBwQa464V1W8FGFI6FtSDEJadDnSJbQ== X-Received: by 2002:a63:680a:0:b0:383:dd15:fe68 with SMTP id d10-20020a63680a000000b00383dd15fe68mr14687416pgc.467.1649404793804; Fri, 08 Apr 2022 00:59:53 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id l2-20020a637c42000000b003644cfa0dd1sm20507448pgn.79.2022.04.08.00.59.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2022 00:59:53 -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 Subject: [PATCH net-next v4 11/11] bnxt: XDP multibuffer enablement Date: Fri, 8 Apr 2022 03:59:06 -0400 Message-Id: <1649404746-31033-12-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1649404746-31033-1-git-send-email-michael.chan@broadcom.com> References: <1649404746-31033-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; }