[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iLTGFkZaZJHP08DPL7QCeAq11WCMfPwpvMAti6aEruJ2Q@mail.gmail.com>
Date: Wed, 7 Dec 2022 16:41:24 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Tariq Toukan <ttoukan.linux@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Tariq Toukan <tariqt@...dia.com>, Wei Wang <weiwan@...gle.com>,
netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 2/3] net/mlx4: MLX4_TX_BOUNCE_BUFFER_SIZE depends
on MAX_SKB_FRAGS
On Wed, Dec 7, 2022 at 4:14 PM Tariq Toukan <ttoukan.linux@...il.com> wrote:
>
> So what you're saying is, if all the elements of
> MLX4_TX_BOUNCE_BUFFER_SIZE co-exist together for a TX descriptor, then
> the actual "headers" part can go only up to 208 (similar to today), not
> the whole 256 (as the new define documentation says).
>
> This keeps the current behavior, but makes the code a bit more confusing.
>
> IMO it is cleaner to have MLX4_TX_BOUNCE_BUFFER_SIZE explicitly defined
> as a multiple of TXBB_SIZE in the first place. This way, both the
> allocation size and the desc size limit will be in perfect sync, without
> having assumptions on the amount X lost in the division.
>
> How about the below, to keep today's values for the defines?
>
> #define MLX4_TX_BOUNCE_BUFFER_SIZE \
> ALIGN(208 + CTRL_SIZE + DS_SIZE + \
> MAX_SKB_FRAGS * DS_SIZE, TXBB_SIZE)
I already sent a v2, with:
+#define MLX4_TX_BOUNCE_BUFFER_SIZE \
+ ALIGN(256 + CTRL_SIZE + DS_SIZE + MAX_SKB_FRAGS * DS_SIZE, TXBB_SIZE)
+
Please take a look, thanks.
Powered by blists - more mailing lists