public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind•com>
To: roopa@cumulusnetworks•com, davem@davemloft•net,
	stephen@networkplumber•org, netdev@vger•kernel.org
Cc: shm@cumulusnetworks•com, nolan@cumulusnetworks•com,
	sfeldma@cumulusnetworks•com, jhs@mojatatu•com
Subject: Re: [PATCH iproute2 v1] link dump filter
Date: Wed, 16 Jul 2014 10:26:07 +0200	[thread overview]
Message-ID: <53C6371F.5070200@6wind.com> (raw)
In-Reply-To: <1405481313-26360-1-git-send-email-roopa@cumulusnetworks.com>

Le 16/07/2014 05:28, roopa@cumulusnetworks•com a écrit :
> From: Roopa Prabhu <roopa@cumulusnetworks•com>
>
> This patch avoids a full link wildump request when the user has specified
> a single link. Uses RTM_GETLINK without the NLM_F_DUMP flag.
>
> This helps on a system with large number of interfaces.
>
> This patch currently only uses the link ifindex in the filter.
> Hoping to provide a subsequent kernel patch to do link dump filtering on
> other attributes in the kernel.
>
> In iplink_get, to be safe, this patch currently sets the answer buffer
> size to the max size that libnetlink rtnl_talk can copy. The current api
> does not seem to provide a way to indicate the answer buf size.
>
> changelog from RFC to v1:
>      - incorporated comments from stephen (fixed comment and fixed if/else block)
>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks•com>
> ---
>   ip/ip_common.h |    1 +
>   ip/ipaddress.c |   13 +++++++++++++
>   ip/iplink.c    |   32 ++++++++++++++++++++++++++++++++
>   3 files changed, 46 insertions(+)
>
> diff --git a/ip/ip_common.h b/ip/ip_common.h
> index ac1e4c1..e56d1ac 100644
> --- a/ip/ip_common.h
> +++ b/ip/ip_common.h
> @@ -51,6 +51,7 @@ extern int do_ipl2tp(int argc, char **argv);
>   extern int do_tcp_metrics(int argc, char **argv);
>   extern int do_ipnetconf(int argc, char **argv);
>   extern int do_iptoken(int argc, char **argv);
> +extern int iplink_get(unsigned int flags, char *name, __u32 filt_mask);
>
>   static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb)
>   {
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index 8138e86..f64c0ed 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -1241,6 +1241,19 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
>   		exit(0);
>   	}
>
> +    /*
> +     * If only filter_dev present and none of the other
> +     * link filters are present, use RTM_GETLINK to get
> +     * the link device
> +     */
The comment is indented with spaces instead tabs.

      reply	other threads:[~2014-07-16  8:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16  3:28 [PATCH iproute2 v1] link dump filter roopa
2014-07-16  8:26 ` Nicolas Dichtel [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=53C6371F.5070200@6wind.com \
    --to=nicolas.dichtel@6wind$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=jhs@mojatatu$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nolan@cumulusnetworks$(echo .)com \
    --cc=roopa@cumulusnetworks$(echo .)com \
    --cc=sfeldma@cumulusnetworks$(echo .)com \
    --cc=shm@cumulusnetworks$(echo .)com \
    --cc=stephen@networkplumber$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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