netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Cc: netdev@vger.kernel.org, Jiri Pirko <jpirko@redhat.com>
Subject: Re: [patch net-next v2] nlmon: use standard rtnetlink link api for add/del devices
Date: Tue, 16 Jul 2013 18:10:03 +0200	[thread overview]
Message-ID: <51E5705B.9070206@redhat.com> (raw)
In-Reply-To: <1561418.Jq9drZzso6@lx-vladimir>

On 07/16/2013 05:59 PM, Vladimir Kondratiev wrote:
> On Tuesday, July 16, 2013 04:49:53 PM Daniel Borkmann wrote:
>> On 07/16/2013 04:08 PM, Vladimir Kondratiev wrote:
>>> Jiri Pirko <jiri <at> resnulli.us> writes:
>>>
>>>> It is not nice when netdev is created right after module load and with
>>>> some implicit name. So rather change nlmon to use standard rtnl link API.
>>>
>>> Could you please elaborate a bit - how to capture netlink skb's after your
>>> patch? Before, it was netdev that may be used with tcpdump. Now, there is
>>> no such netdev. How to create it?
>>
>> modprobe nlmon
>> ip link add type nlmon
>> ip link set nlmon0 up
>>
>> tcpdump -i nlmon0 ....
>>
>> ip link set nlmon0 down
>> ip link del dev nlmon0
>> rmmod nlmon
>
> Thanks a lot! I guess it is worth to have this mentioned somewhere.
> It will save lots of questions. For example, in Kconfig:

Ok, I don't have a strong opinion on the below patch, I'm fine either way.

But, given that for such devices it is *common* to use the standard rtnl
link API (Jiri is right that this is a better/cleaner approach), I'm not
sure if this needs to be documented then ...

> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index b45b240..13acea2 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -247,8 +247,18 @@ config NLMON
>            purpose of this is to analyze netlink messages with packet sockets.
>            Thus applications like tcpdump will be able to see local netlink
>            messages if they tap into the netlink device, record pcaps for further
> -         diagnostics, etc. This is mostly intended for developers or support
> -         to debug netlink issues. If unsure, say N.
> +         diagnostics, etc. Typical flow is:
> +
> +           modprobe nlmon
> +           ip link add type nlmon
> +           ip link set nlmon0 up
> +           tcpdump -i nlmon0 ....
> +           ip link set nlmon0 down
> +           ip link del dev nlmon0
> +           rmmod nlmon
> +
> +         This is mostly intended for developers or support to debug netlink
> +         issues. If unsure, say N.
>
>   endif # NET_CORE
>

  reply	other threads:[~2013-07-16 16:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02  8:55 [patch net-next v2] nlmon: use standard rtnetlink link api for add/del devices Jiri Pirko
2013-07-02 19:47 ` Daniel Borkmann
2013-07-02 19:53 ` David Miller
2013-07-16 14:08 ` Vladimir Kondratiev
2013-07-16 14:49   ` Daniel Borkmann
2013-07-16 15:59     ` Vladimir Kondratiev
2013-07-16 16:10       ` Daniel Borkmann [this message]
2013-07-16 16:41         ` Jiri Pirko

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=51E5705B.9070206@redhat.com \
    --to=dborkman@redhat.com \
    --cc=jpirko@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=qca_vkondrat@qca.qualcomm.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).