netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH v3] net: #ifdef inet_bind_bucket::ib_net
Date: Fri, 14 Nov 2008 00:09:47 +0100	[thread overview]
Message-ID: <491CB3BB.5030602@cosmosbay.com> (raw)
In-Reply-To: <b6fcc0a0811131453l4c111135p7b58453a533693ea@mail.gmail.com>

Alexey Dobriyan a écrit :
> On Wed, Nov 12, 2008 at 04:24:23AM -0800, David Miller wrote:
>> From: Alexey Dobriyan <adobriyan@gmail.com>
>> Date: Wed, 12 Nov 2008 15:24:48 +0300
>>
>>> +static inline void ib_net_set(struct inet_bind_bucket *ib, struct net *net)
>>> +{
>>> +#ifdef CONFIG_NET_NS
>>> +   ib->ib_net = net;
>>> +#endif
>>> +}
>>> +
>> It's basically read_pnet() hidden behind another name.
>> And you'll add new "aliases" for read_pnet() over and over
>> again.
>>
>> That makes no sense to me.
> 
> It also make no sense to expose write_pnet() for one(!) user and
> simultaneously hide read_pnet() under ib_net() as committed patches do.
> 
> Something is wrong with read_pnet() as nobody suggested to mass use it
> or send a patch doing it.

I did. My plan is to zap all superflous #ifdef CONFIG_NET_NS if possible.


> 
> 
>         #ifdef CONFIG_NET_NS
>                 ib->ib_net = net;
>         #endif
> 
> It's _obvious_ from this code that it's a C assignment or nop. It's also
> obvious depending on what config option.
> 
>         write_pnet(&ib->ib_net, net);
> 
> What is & operator doing here? Is it important? '&' is syntaxic noise.
> 
> And netns assignments are exactly this: assigment or a nop.

You obviously didnt read my patches.

How do you want to implement a C function that can write to ib->ib_net ?

Yes, I prefer a function over a macro, as most kernel developpers,
for obvious reasons.

Only sane way is :

static inline void write_pnet(struct net **pnet, struct net *net)
{
	*pnet = net;
}

and call write_pnet(&ip->ib_net, net);

Strange, this is what I did.

Take the time to read the patch, please.

Thank you


  parent reply	other threads:[~2008-11-13 23:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 22:53 [PATCH v3] net: #ifdef inet_bind_bucket::ib_net Alexey Dobriyan
2008-11-13 23:03 ` David Miller
2008-11-13 23:09 ` Eric Dumazet [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-11-13 23:21 Alexey Dobriyan
2008-11-14  4:36 ` Eric Dumazet
2008-11-14  4:40   ` David Miller
2008-11-14  4:54     ` Eric Dumazet
2008-11-14  6:14       ` Alexey Dobriyan
2008-11-14  6:21         ` Eric Dumazet
2008-11-14  6:41           ` Alexey Dobriyan
2008-11-11  0:44 [PATCH] net: introduce read_pnet() and write_pnet() functions David Miller
2008-11-11 11:08 ` [PATCH] net: #ifdef inet_bind_bucket::ib_net Alexey Dobriyan
2008-11-11 11:19   ` [PATCH v2] " Alexey Dobriyan
2008-11-12  0:45     ` David Miller
2008-11-12 10:44       ` Alexey Dobriyan
2008-11-12 10:50         ` Eric Dumazet
2008-11-12 12:24           ` [PATCH v3] " Alexey Dobriyan
2008-11-12 12:24             ` David Miller

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=491CB3BB.5030602@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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).