netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arnaldo Carvalho de Melo" <acme@redhat.com>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>,
	devel@openvz.org
Subject: Re: [PATCH][PACKET] Remove unneeded packet_socks_nr variable
Date: Wed, 7 Nov 2007 14:26:35 -0200	[thread overview]
Message-ID: <20071107162635.GN27345@ghostprotocols.net> (raw)
In-Reply-To: <4731E4CE.6030603@openvz.org>

Em Wed, Nov 07, 2007 at 07:16:14PM +0300, Pavel Emelyanov escreveu:
> Arnaldo Carvalho de Melo wrote:
> > Em Wed, Nov 07, 2007 at 01:50:04PM -0200, Arnaldo Carvalho de Melo escreveu:
> >> Em Wed, Nov 07, 2007 at 06:32:51PM +0300, Pavel Emelyanov escreveu:
> >>> This one is used only under ifdef PACKET_REFCNT_DEBUG in
> >>> printk and is not needed otherwise. So hide all this stuff
> >>> under the PACKET_REFCNT_DEBUG.
> >>>
> >>> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> >> Look at sk_refcnt_debug_inc, etc and you'll se a more standard way. I
> >> forgot to make this when making all protocol families use sk_prot, even
> >> if just partially :-)
> > 
> > As a bonus you'll get this information on /proc/net/protocols, removing
> > '-1' from PACKET column for "sockets".
> 
> Hm... I actually thought about this, but I decided that packet
> sockets were not accounted in this way deliberately.
> 
> So, shall I break this "compatibility" (-1 in proc) and provide
> a packet socket number in this file?

Humm, my bad, the sockets column in /proc/net/protocols doesn't come
from prot->socks, it comes from prot->sockets_allocated. But the
suggestion for using sk_refcnt_debug_inc stands, it is there for when we
want to do what the code in pf_packet does: refcount debugging, in fact
that code most probably was copy'n'pasted from other, older protocols.

BTW, IPX also uses this technique, patches are welcome to make it also
use common infrastructure :-)

- Arnaldo

      reply	other threads:[~2007-11-07 16:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 15:32 [PATCH][PACKET] Remove unneeded packet_socks_nr variable Pavel Emelyanov
2007-11-07 15:50 ` Arnaldo Carvalho de Melo
2007-11-07 15:53   ` Arnaldo Carvalho de Melo
2007-11-07 16:16     ` Pavel Emelyanov
2007-11-07 16:26       ` Arnaldo Carvalho de Melo [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=20071107162635.GN27345@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=davem@davemloft.net \
    --cc=devel@openvz.org \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.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).