Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1583758

Re: [PATCH net-next v2 5/6] net: dsa: mv88e6xxx: add VTU ops

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH net-next v2 5/6] net: dsa: mv88e6xxx: add VTU ops
Date 2017-02-17 22:50 +0100
Message-ID <tbYzD-1jV-9@gated-at.bofh.it> (permalink)
References <tbSky-5TK-21@gated-at.bofh.it> <tbSky-5TK-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Feb 17, 2017 at 10:05:30AM -0500, Vivien Didelot wrote:
> Because there are several variant of the VTU operations and because
> checking for the presence of an STU is not enough, add new ops to the
> info structure to describe the VTU operations that a chip supports.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c      | 58 +++++++++++++++++++++++++----------
>  drivers/net/dsa/mv88e6xxx/mv88e6xxx.h |  8 ++++-
>  2 files changed, 49 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 7010c3313e35..256a209eef9b 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -1220,33 +1220,19 @@ static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port)
>  static int mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
>  				 struct mv88e6xxx_vtu_entry *entry)
>  {
> -	int err;
> -
>  	if (!mv88e6xxx_has_vtu(chip))
>  		return -EOPNOTSUPP;
>  
> -	if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_STU))
> -		err = mv88e6352_g1_vtu_getnext(chip, entry);
> -	else
> -		err = mv88e6185_g1_vtu_getnext(chip, entry);
> -
> -	return err;
> +	return chip->info->ops->vtu_getnext(chip, entry);
>  }

You appear to be taking out code you just added in the previous patch.

Please think about structuring these patches different. We want these
ops, but i don't think you have the best way of getting there.

     Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next v2 5/6] net: dsa: mv88e6xxx: add VTU ops Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-02-17 16:10 +0100
  Re: [PATCH net-next v2 5/6] net: dsa: mv88e6xxx: add VTU ops Andrew Lunn <andrew@lunn.ch> - 2017-02-17 22:50 +0100

csiph-web