lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoD9nE-Ad7+XoshoQ8qp7C0H+McKX=F6xt2+UF1BeWXKbg@mail.gmail.com>
Date:   Thu, 9 Feb 2023 08:47:09 +0800
From:   Jason Xing <kerneljasonxing@...il.com>
To:     jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, richardcochran@...il.com, ast@...nel.org,
        daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
        alexandr.lobakin@...el.com, maciej.fijalkowski@...el.com,
        alexander.duyck@...il.com
Cc:     intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
        Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net 3/3] ixgbe: add double of VLAN header when computing
 the max MTU

CC Alexander Duyck

Hello Alexander, thanks for reviewing the other two patches of this
patchset last night. Would you mind reviewing the last one? :)

Thanks,
Jason

On Sat, Feb 4, 2023 at 9:36 PM Jason Xing <kerneljasonxing@...il.com> wrote:
>
> From: Jason Xing <kernelxing@...cent.com>
>
> Include the second VLAN HLEN into account when computing the maximum
> MTU size as other drivers do.
>
> Fixes: fabf1bce103a ("ixgbe: Prevent unsupported configurations with XDP")
> Signed-off-by: Jason Xing <kernelxing@...cent.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe.h      | 2 ++
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +--
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> index bc68b8f2176d..8736ca4b2628 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> @@ -73,6 +73,8 @@
>  #define IXGBE_RXBUFFER_4K    4096
>  #define IXGBE_MAX_RXBUFFER  16384  /* largest size for a single descriptor */
>
> +#define IXGBE_PKT_HDR_PAD   (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2))
> +
>  /* Attempt to maximize the headroom available for incoming frames.  We
>   * use a 2K buffer for receives and need 1536/1534 to store the data for
>   * the frame.  This leaves us with 512 bytes of room.  From that we need
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 2c1b6eb60436..149f7baf40fe 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -6801,8 +6801,7 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
>         struct ixgbe_adapter *adapter = netdev_priv(netdev);
>
>         if (ixgbe_enabled_xdp_adapter(adapter)) {
> -               int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN +
> -                                    VLAN_HLEN;
> +               int new_frame_size = new_mtu + IXGBE_PKT_HDR_PAD;
>
>                 if (new_frame_size > ixgbe_max_xdp_frame_size(adapter)) {
>                         e_warn(probe, "Requested MTU size is not supported with XDP\n");
> --
> 2.37.3
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ