From patchwork Sat Apr 2 00:21:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12798872 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 C5BB4C43217 for ; Sat, 2 Apr 2022 00:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353567AbiDBAXT (ORCPT ); Fri, 1 Apr 2022 20:23:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234770AbiDBAXQ (ORCPT ); Fri, 1 Apr 2022 20:23:16 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E241AC430 for ; Fri, 1 Apr 2022 17:21:25 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id t4so3561757pgc.1 for ; Fri, 01 Apr 2022 17:21:25 -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=UoCzq94MXVcOlUN/6wORFWX01+cATfQvzmGgy4cwnmY=; b=TIA3nvjrMWNJo+pdvAb16CeuUfx069MT93AIKLOMWSLD4SHdnvOAeDlo9+WDVmB78V NAHS9Nvs1acA6HDuKaUV5T+VBCgCXJBJCvYtfjoSk9dEwC6woMlxzuG/uH0AnicX+UaQ JngovlfJicueozbdWXN4tRLxnOCvj64TcF78s= 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=UoCzq94MXVcOlUN/6wORFWX01+cATfQvzmGgy4cwnmY=; b=shnR1QzFIFzMrmAwLa+r0GNe3X2XQVTVDBHUVGjMHmXS7eaByULg1agdMX4aGq8L1/ HUVTtJ7FQDcpINnt9bdOSumWMw39DCeSC/5EhRzsZOBuzQDE9Wuwrv6+tNjvl8LSmjcy 3fiKqYajht41nuFQG/c0LID77TccYdVzCcKMr+OrbiV9dBH/s8V8yePxvw5wecZXxI6s v36feWAjPxPG2t5Mobyt65b3sTXYbWC1ib1Dw6yzsUBN2GzlF+nubY38tebeKbR1kWDq 0DJkMrPwpE4cEffto7fBm0uFW577qp8ajEyejy7Wl2Mu2gQHM7M0OMtm01hHMzc13cjk 7y1w== X-Gm-Message-State: AOAM532IMrvnK1vbx+Mp0DSPRqGuKndyhNEs25XEOesNt4gFKFKrg6Jl VPtIMwTy3tvQ9+K5K1g2g1KxdQ== X-Google-Smtp-Source: ABdhPJzsUqEu+w84DLdBr69wJOlXHGu7hB6DSAgppcb/GktobFXVx2JLqnIajZ8F6jsIntOdJCyFfg== X-Received: by 2002:a63:ba07:0:b0:382:4739:8941 with SMTP id k7-20020a63ba07000000b0038247398941mr17181809pgf.293.1648858884927; Fri, 01 Apr 2022 17:21:24 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id k10-20020a056a00168a00b004f7e2a550ccsm4295050pfc.78.2022.04.01.17.21.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Apr 2022 17:21:24 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com, bpf@vger.kernel.org Subject: [PATCH net 2/3] bnxt_en: reserve space inside receive page for skb_shared_info Date: Fri, 1 Apr 2022 20:21:11 -0400 Message-Id: <1648858872-14682-3-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1648858872-14682-1-git-send-email-michael.chan@broadcom.com> References: <1648858872-14682-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 Insufficient space was being reserved in the page used for packet reception, so the interface MTU could be set too large to still have room for the contents of the packet when doing XDP redirect. This resulted in the following message when redirecting a packet between 3520 and 3822 bytes with an MTU of 3822: [311815.561880] XDP_WARN: xdp_update_frame_from_buff(line:200): Driver BUG: missing reserved tailroom Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support") Reviewed-by: Somnath Kotur Reviewed-by: Pavan Chebbi Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index b4d3d051463b..98453a78cbd0 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -593,7 +593,8 @@ struct nqe_cn { #define BNXT_MAX_MTU 9500 #define BNXT_MAX_PAGE_MODE_MTU \ ((unsigned int)PAGE_SIZE - VLAN_ETH_HLEN - NET_IP_ALIGN - \ - XDP_PACKET_HEADROOM) + XDP_PACKET_HEADROOM - \ + SKB_DATA_ALIGN((unsigned int)sizeof(struct skb_shared_info))) #define BNXT_MIN_PKT_SIZE 52