Netdev Archive on lore.kernel.org help / color / mirror / Atom feed
From: Menglong Dong <menglong8.dong@gmail.com> To: Jon Maloy <jmaloy@redhat.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: Sat, 5 Jun 2021 09:28:44 +0800 [thread overview] Message-ID: <CADxym3ZostCAY0GwUpTxEHcOPyOj5Lmv4F7xP-Q4=AEAVaEAxw@mail.gmail.com> (raw) In-Reply-To: <e997a058-9f6e-86a0-8591-56b0b89441aa@redhat.com> Hello Maloy, On Sat, Jun 5, 2021 at 3:20 AM Jon Maloy <jmaloy@redhat.com> wrote: > > [...] > Please don't add any extra file just for this little fix. We have enough > files. > Keep the macros in msg.h/c where they used to be. You can still add > your copyright line to those files. > Regarding the macros kept inside msg.c, they are there because we design > by the principle of minimal exposure, even among our module internal files. > Otherwise it is ok. > I don't want to add a new file too, but I found it's hard to define FB_MTU. I tried to define it in msg.h, and 'crypto.h' should be included, which 'BUF_HEADROOM' is defined in. However, 'msg.h' is already included in 'crypto.h', so it doesn't work. I tried to define FB_MTU in 'crypto.h', but it feels weird to define it here. And FB_MTU is also used in 'bcast.c', so it can't be defined in 'msg.c'. I will see if there is a better solution. Thanks! Menglong Dong > > @@ -0,0 +1,55 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +/* > > + * Copyright 2021 ZTE Corporation. > > + * All rights reserved. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions are met: > > + * > > + * 1. Redistributions of source code must retain the above copyright > > + * notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above copyright > > + * notice, this list of conditions and the following disclaimer in the > > + * documentation and/or other materials provided with the distribution. > > + * 3. Neither the names of the copyright holders nor the names of its > > + * contributors may be used to endorse or promote products derived from > > + * this software without specific prior written permission. > > + * > > + * Alternatively, this software may be distributed under the terms of the > > + * GNU General Public License ("GPL") version 2 as published by the Free > > + * Software Foundation. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > > + * POSSIBILITY OF SUCH DAMAGE. > > + */ > > + > > +#ifndef _TIPC_MTU_H > > +#define _TIPC_MTU_H > > + > > +#include <linux/tipc.h> > > +#include "crypto.h" > > + > > +#ifdef CONFIG_TIPC_CRYPTO > > +#define BUF_HEADROOM ALIGN(((LL_MAX_HEADER + 48) + EHDR_MAX_SIZE), 16) > > +#define BUF_TAILROOM (TIPC_AES_GCM_TAG_SIZE) > > +#define FB_MTU (PAGE_SIZE - \ > > + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) - \ > > + SKB_DATA_ALIGN(BUF_HEADROOM + BUF_TAILROOM + 3)) > > +#else > > +#define BUF_HEADROOM (LL_MAX_HEADER + 48) > > +#define BUF_TAILROOM 16 > > +#define FB_MTU (PAGE_SIZE - \ > > + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) - \ > > + SKB_DATA_ALIGN(BUF_HEADROOM + 3)) > > +#endif > > + > > +#endif >
next prev parent reply other threads:[~2021-06-05 1:29 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-04 7:44 [PATCH net-next] net: tipc: fix FB_MTU eat two pages menglong8.dong 2021-06-04 19:20 ` Jon Maloy 2021-06-05 1:28 ` Menglong Dong [this message] 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 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='CADxym3ZostCAY0GwUpTxEHcOPyOj5Lmv4F7xP-Q4=AEAVaEAxw@mail.gmail.com' \ --to=menglong8.dong@gmail.com \ --cc=davem@davemloft.net \ --cc=dong.menglong@zte.com.cn \ --cc=jmaloy@redhat.com \ --cc=kuba@kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=netdev@vger.kernel.org \ --cc=tipc-discussion@lists.sourceforge.net \ --cc=ying.xue@windriver.com \ --cc=zealci@zte.com.cn \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).