netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Leon Romanovsky <leon@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH net-next] net: make sure we never create ifindex = 0
Date: Mon, 31 Jul 2023 09:03:05 -0700	[thread overview]
Message-ID: <20230731090305.0c5fe7a1@kernel.org> (raw)
In-Reply-To: <20230730133219.GG94048@unreal>

On Sun, 30 Jul 2023 16:32:19 +0300 Leon Romanovsky wrote:
> > @@ -11271,7 +11272,6 @@ static int __net_init netdev_init(struct net *net)
> >  	if (net->dev_index_head == NULL)
> >  		goto err_idx;
> >  
> > -	net->ifindex = 1;
> >  	xa_init_flags(&net->dev_by_index, XA_FLAGS_ALLOC);  
> 
> You don't need to change xa_limit_31b, just change XA_FLAGS_ALLOC to be XA_FLAGS_ALLOC1
> and allocations will start from 1.

Because obviously there is a magic flag for this...

      reply	other threads:[~2023-07-31 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-29  1:56 [PATCH net-next] net: make sure we never create ifindex = 0 Jakub Kicinski
2023-07-30 13:32 ` Leon Romanovsky
2023-07-31 16:03   ` Jakub Kicinski [this message]

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=20230731090305.0c5fe7a1@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    /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).