Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jon Maloy <jmaloy@redhat.com>
To: Menglong Dong <menglong8.dong@gmail.com>
Cc: ying.xue@windriver.com, David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
tipc-discussion@lists.sourceforge.net,
Menglong Dong <dong.menglong@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH net-next] net: tipc: fix FB_MTU eat two pages
Date: Tue, 8 Jun 2021 18:37:38 -0400 [thread overview]
Message-ID: <46d2a694-6a85-0f8e-4156-9bb1c4dbdb69@redhat.com> (raw)
In-Reply-To: <20210607125120.GA4262@www>
On 6/7/21 8:51 AM, Menglong Dong wrote:
> On Sat, Jun 05, 2021 at 10:25:53AM -0400, Jon Maloy wrote:
>>
>> On 6/4/21 9:28 PM, Menglong Dong wrote:
>>> Hello Maloy,
>>>
>>> On Sat, Jun 5, 2021 at 3:20 AM Jon Maloy <jmaloy@redhat.com> wrote:
>>>> [...]
>>>
>>> So if I use the non-crypto version, the size allocated will be:
>>>
>>> PAGE_SIZE - BUF_HEADROOM_non-crypto - BUF_TAILROOM_non-crypt +
>>> BUF_HEADROOM_crypto + BUF_TAILROOM_crypto
>>>
>>> which is larger than PAGE_SIZE.
>>>
>>> So, I think the simple way is to define FB_MTU in 'crypto.h'. Is this
>>> acceptable?
>>>
>>> Thanks!
>>> Menglong Dong
>>>
I spent a little more time looking into this. I think the best we can do
is to keep FB_MTU internal to msg.c, and then add an outline function to
msg.c that can be used by bcast.c. The way it is used is never time
critical.
I also see that we could need a little cleanup around this. There is a
redundant align() function that should be removed and replaced with the
global ALIGN() macro.
Even tipc_buf_acquire() should use this macro instead of the explicit
method that is used now.
In general, I stongly dislike conditional code, and it is not necessary
in this function. If we redefine the non-crypto BUF_TAILROOM to 0
instead of 16 (it is not used anywhere else) we could get rid of this too.
But I leave that to you. If you only fix the FB_MTU macro I am content.
///jon
next prev parent reply other threads:[~2021-06-08 22:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 7:44 menglong8.dong
2021-06-04 19:20 ` Jon Maloy
2021-06-05 1:28 ` Menglong Dong
2021-06-05 14:25 ` Jon Maloy
2021-06-06 14:40 ` Menglong Dong
2021-06-07 12:51 ` Menglong Dong
2021-06-08 22:37 ` Jon Maloy [this message]
2021-06-09 2:54 ` Menglong Dong
2021-06-09 7:34 ` Jon Maloy
2021-06-09 10:53 ` Menglong Dong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46d2a694-6a85-0f8e-4156-9bb1c4dbdb69@redhat.com \
--to=jmaloy@redhat.com \
--cc=davem@davemloft.net \
--cc=dong.menglong@zte.com.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menglong8.dong@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.com \
--cc=zealci@zte.com.cn \
--subject='Re: [PATCH net-next] net: tipc: fix FB_MTU eat two pages' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).