From: Eric Dumazet <eric.dumazet@gmail.com>
To: Li RongQing <lirongqing@baidu.com>, netdev@vger.kernel.org
Cc: edumazet@google.com, sbrivio@redhat.com
Subject: Re: [PATCH][net-next][v2] net: convert gro_count to bitmask
Date: Mon, 16 Jul 2018 16:40:52 -0700 [thread overview]
Message-ID: <80f69d24-bf80-c8ac-7d16-a8d6b91e2448@gmail.com> (raw)
In-Reply-To: <1531464096-11319-1-git-send-email-lirongqing@baidu.com>
On 07/12/2018 11:41 PM, Li RongQing wrote:
> gro_hash size is 192 bytes, and uses 3 cache lines, if there is few
*/
> @@ -9264,6 +9273,9 @@ static struct hlist_head * __net_init netdev_create_hash(void)
> /* Initialize per network namespace state */
> static int __net_init netdev_init(struct net *net)
> {
> + BUILD_BUG_ON(GRO_HASH_BUCKETS >
> + FIELD_SIZEOF(struct napi_struct, gro_bitmask));
> +
Sorry for the delay (patch is already merged)
This looks wrong to me.
FIELD_SIZEOF() is in bytes not bits.
I guess we could either use BITS_PER_LONG or :
diff --git a/net/core/dev.c b/net/core/dev.c
index c883b17ee0fe2c8a7ca2f2867560ba74004790a7..4f8b92d81d107fc9acd2499297435cbd9e9b5c67 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9282,7 +9282,7 @@ static struct hlist_head * __net_init netdev_create_hash(void)
static int __net_init netdev_init(struct net *net)
{
BUILD_BUG_ON(GRO_HASH_BUCKETS >
- FIELD_SIZEOF(struct napi_struct, gro_bitmask));
+ 8 * FIELD_SIZEOF(struct napi_struct, gro_bitmask));
if (net != &init_net)
INIT_LIST_HEAD(&net->dev_base_head);
next prev parent reply other threads:[~2018-07-17 0:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 6:41 [PATCH][net-next][v2] net: convert gro_count to bitmask Li RongQing
2018-07-16 20:41 ` David Miller
2018-07-16 23:40 ` Eric Dumazet [this message]
2018-07-17 0:02 ` David Miller
2018-07-17 1:04 ` kbuild test robot
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=80f69d24-bf80-c8ac-7d16-a8d6b91e2448@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=edumazet@google.com \
--cc=lirongqing@baidu.com \
--cc=netdev@vger.kernel.org \
--cc=sbrivio@redhat.com \
/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
Be 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).