All of lore.kernel.org
 help / color / mirror / Atom feed
From: Serhey Popovych <serhe.popovych@gmail.com>
To: David Ahern <dsahern@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse()
Date: Mon, 26 Feb 2018 18:07:24 +0200	[thread overview]
Message-ID: <e92cca15-21d7-e71b-ae7d-617263c68a45@gmail.com> (raw)
In-Reply-To: <8f84887e-e0a7-fe3a-d2a3-21ab7544133a@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1940 bytes --]

David Ahern wrote:
> On 2/22/18 6:02 AM, Serhey Popovych wrote:
>> Introduce new @struct iplink_parse_args data structure to consolidate
>> arguments to iplink_parse(). This will reduce number of arguments
>> passed to it.
>>
>> Pass this data structure to ->parse_opt() in iplink specific modules:
>> it may be used to get network device name and other information.
>>
>> Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
>> ---
>>  ip/ip_common.h           |   16 +++++++++++++---
>>  ip/iplink.c              |   34 ++++++++++++++++++++++------------
>>  ip/iplink_bond.c         |    4 +++-
>>  ip/iplink_bond_slave.c   |    4 +++-
>>  ip/iplink_bridge.c       |    4 +++-
>>  ip/iplink_bridge_slave.c |    4 +++-
>>  ip/iplink_can.c          |    4 +++-
>>  ip/iplink_geneve.c       |    4 +++-
>>  ip/iplink_hsr.c          |    4 +++-
>>  ip/iplink_ipoib.c        |    4 +++-
>>  ip/iplink_ipvlan.c       |    4 +++-
>>  ip/iplink_macvlan.c      |    4 +++-
>>  ip/iplink_vlan.c         |    4 +++-
>>  ip/iplink_vrf.c          |    5 ++++-
>>  ip/iplink_vxcan.c        |   14 ++++++--------
>>  ip/iplink_vxlan.c        |    4 +++-
>>  ip/ipmacsec.c            |    4 +++-
>>  ip/link_gre.c            |    6 ++++--
>>  ip/link_gre6.c           |    6 ++++--
>>  ip/link_ip6tnl.c         |    6 ++++--
>>  ip/link_iptnl.c          |    6 ++++--
>>  ip/link_veth.c           |   14 ++++++--------
>>  ip/link_vti.c            |    6 ++++--
>>  ip/link_vti6.c           |    6 ++++--
>>  24 files changed, 114 insertions(+), 57 deletions(-)
>>
> 
> Seems like a lot of churn for no benefit.

Real benefit at the moment: reduce number of parameters in function
iplink_parse() that has trend to grow. Someone needs something in
->parse_opt() that is in netlink buffer. How to provide this best?

In my opinion is to add field to struct rather than argument to a function.

> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2018-02-26 16:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 13:01 [PATCH iproute2-next v3 0/8] iplink: Improve iplink_parse() Serhey Popovych
2018-02-22 13:01 ` [PATCH iproute2-next v3 1/8] utils: Introduce and use nodev() helper routine Serhey Popovych
2018-02-22 13:02 ` [PATCH iproute2-next v3 2/8] iplink: Correctly report error when network device isn't found Serhey Popovych
2018-02-23 23:41   ` David Ahern
2018-02-25 12:07     ` Serhey Popovych
2018-02-22 13:02 ` [PATCH iproute2-next v3 3/8] iplink: Use "dev" and "name" parameters interchangeable when possible Serhey Popovych
2018-02-22 13:02 ` [PATCH iproute2-next v3 4/8] iplink: Follow documented behaviour when "index" is given Serhey Popovych
2018-02-22 13:02 ` [PATCH iproute2-next v3 5/8] veth,vxcan: Save/reinitialize/restore whole @struct ifinfomsg Serhey Popovych
2018-02-26  3:28   ` David Ahern
2018-02-26 15:48     ` Serhey Popovych
2018-02-26 15:57     ` Serhey Popovych
2018-02-22 13:02 ` [PATCH iproute2-next v3 6/8] iplink: Perform most of request buffer setups and checks in iplink_parse() Serhey Popovych
2018-02-26  3:31   ` David Ahern
2018-02-26 15:51     ` Serhey Popovych
2018-02-22 13:02 ` [PATCH iproute2-next v3 7/8] iplink: Move data structures to block of their users Serhey Popovych
2018-02-22 13:02 ` [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse() Serhey Popovych
2018-02-26  3:35   ` David Ahern
2018-02-26 15:44     ` Serhey Popovych
2018-02-26 16:07     ` Serhey Popovych [this message]
2018-02-26 18:06   ` Stephen Hemminger
2018-02-26 18:20     ` Serhey Popovych
2018-02-26 18:27       ` David Ahern
2018-02-26 18:38         ` Serhey Popovych
2018-02-26 20:09           ` Serhey Popovych
2018-02-26 21:35             ` Stephen Hemminger

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=e92cca15-21d7-e71b-ae7d-617263c68a45@gmail.com \
    --to=serhe.popovych@gmail.com \
    --cc=dsahern@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.