netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Eric Dumazet <edumazet@google.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	David Miller <davem@davemloft.net>,
	Daniel Borkmann <daniel@iogearbox.net>,
	netdev <netdev@vger.kernel.org>,
	shaoyafang@didiglobal.com
Subject: Re: [net-next 5/5] net: sock: remove the definition of SOCK_DEBUG()
Date: Sat, 16 Feb 2019 10:50:28 +0800	[thread overview]
Message-ID: <CALOAHbA9zUS6YbExz-X3+k1ESZoNWm=9p1Hr3USYfCwf3mrS2g@mail.gmail.com> (raw)
In-Reply-To: <620a93625ac3709bf6df5e31bcdcdd319db140ef.camel@perches.com>

On Sat, Feb 16, 2019 at 2:51 AM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2019-02-15 at 10:22 -0800, Eric Dumazet wrote:
> > On Fri, Feb 15, 2019 at 10:13 AM Cong Wang <xiyou.wangcong@gmail.com> wrote:
> > > On Fri, Feb 15, 2019 at 8:26 AM Eric Dumazet <edumazet@google.com> wrote:
> > > > On Fri, Feb 15, 2019 at 6:50 AM Yafang Shao <laoar.shao@gmail.com> wrote:
> > > > > As SOCK_DEBUG() isn't used any more, we can get ride of it now.
> > > > >
> > > >
> > > > No, we are still using this infrastructure from time to time.
> > > >
> > > > I told you I agreed to remove the current (obsolete) TCP call sites,
> > > >  I never suggested to remove SOCK_DEBUG() completely.
> > >
> > > Since when do we upstream care about any out-of-tree users?
> > >
> > > You can always carry a patch to keep it downstream if you want,
> > > no one can stop you doing it.
> >
> > Somehow the patch series seems to present things in this way :
> >
> > Eric Dumazet suggested to remove completely the SOCK_DEBUG() interface.
>
> Well, you kinda did.
> It's certainly reasonable to interpret what you wrote as such.
>
> On Tue, 2019-02-12 at 18:15 -0800, Eric Dumazet wrote:
> > Just remove all SOCK_DEBUG() calls, there are leftovers of very ancient times.
>
> My suggestion would be to undefine SOCK_DEBUGGING.
>

This seems like a reasonable trade-off decision.
I will change it like this.

> Something like:
> ---
>  include/net/sock.h | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 328cb7cb7b0b..7e39bdfa342a 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -81,14 +81,17 @@
>   */
>
>  /* Define this to get the SOCK_DBG debugging facility. */
> -#define SOCK_DEBUGGING
> +/* #define SOCK_DEBUGGING */
>  #ifdef SOCK_DEBUGGING
> -#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \
> -                                       printk(KERN_DEBUG msg); } while (0)
> +#define SOCK_DEBUG(sk, fmt, ...)                               \
> +do {                                                           \
> +       if ((sk) && sock_flag((sk), SOCK_DBG))                  \
> +               printk(KERN_DEBUG fmt, ##__VA_ARGS__);          \
> +} while (0)
>  #else
>  /* Validate arguments and do nothing */
> -static inline __printf(2, 3)
> -void SOCK_DEBUG(const struct sock *sk, const char *msg, ...)
> +__printf(2, 3)
> +static inline void SOCK_DEBUG(const struct sock *sk, const char *fmt, ...)
>  {
>  }
>  #endif
>
>

Thanks
Yafang

      reply	other threads:[~2019-02-16  2:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 14:49 [net-next 0/5] clean up SOCK_DEBUG() Yafang Shao
2019-02-15 14:49 ` [net-next 1/5] tcp: " Yafang Shao
2019-02-15 14:49 ` [net-next 2/5] x25: " Yafang Shao
2019-02-15 14:49 ` [net-next 3/5] appletalk: " Yafang Shao
2019-02-15 14:49 ` [net-next 4/5] dccp: " Yafang Shao
2019-02-15 14:49 ` [net-next 5/5] net: sock: remove the definition of SOCK_DEBUG() Yafang Shao
2019-02-15 14:58   ` Eric Dumazet
2019-02-15 15:41     ` Yafang Shao
2019-02-15 15:54       ` Eric Dumazet
2019-02-15 18:12     ` Cong Wang
2019-02-15 18:22       ` Eric Dumazet
2019-02-15 18:51         ` Joe Perches
2019-02-16  2:50           ` Yafang Shao [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='CALOAHbA9zUS6YbExz-X3+k1ESZoNWm=9p1Hr3USYfCwf3mrS2g@mail.gmail.com' \
    --to=laoar.shao@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joe@perches.com \
    --cc=netdev@vger.kernel.org \
    --cc=shaoyafang@didiglobal.com \
    --cc=xiyou.wangcong@gmail.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).