Subject: Re: [RFC net-next 1/5] net: dsa: Add infrastructure to support LAG

From: Ido Schimmel <[email-masked]>
Date: Mon, 2 Oct 2017 10:05:36 +0300

On Mon, Oct 02, 2017 at 04:03:27AM +0200, Andrew Lunn wrote:
> On Sun, Oct 01, 2017 at 12:46:35PM -0700, Florian Fainelli wrote:
> > +static bool dsa_slave_lag_check(struct net_device *dev, struct net_device *lag_dev,
> > +				struct netdev_lag_upper_info *lag_upper_info)
> > +{
> > +	struct dsa_slave_priv *p = netdev_priv(dev);
> > +	u8 lag_id;
> > +
> > +	/* No more lag identifiers available or already in use */
> > +	if (dsa_switch_lag_get_index(p->dp->ds, lag_dev, &lag_id) != 0)
> > +		return false;
> > +
> > +	if (lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH)
> > +		return false;
> 
> I wounder if the driver needs to decide this? Can different hardware
> support different tx_types?

FWIW, the same check exists in mlxsw, but maybe other devices support
more methods, so I think it makes sense to have the driver decide this.