lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Feb 2016 07:30:03 -0800
From:	John Fastabend <john.fastabend@...il.com>
To:	Saeed Mahameed <saeedm@...lanox.com>,
	"David S. Miller" <davem@...emloft.net>
CC:	netdev@...r.kernel.org, Or Gerlitz <ogerlitz@...lanox.com>,
	Tal Alon <talal@...lanox.com>,
	Eran Ben Elisha <eranbe@...lanox.com>,
	Tariq Toukan <tariqt@...lanox.com>,
	Rana Shahout <ranas@...lanox.com>,
	Yevgeny Petrilin <yevgenyp@...lanox.com>,
	Matthew Finlay <matt@...lanox.com>
Subject: Re: [PATCH net-next V1 04/12] net/mlx5e: Support DCBNL IEEE ETS

On 16-02-18 02:32 AM, Saeed Mahameed wrote:
> Support the ndo_setup_tc callback and the needed methods
> for multi TC/UP support, and removed the default_vlan_prio
> from mlx5e_priv which is always 0, it was replaced with
> hardcoded "0" in the new select queue method.
> 
> For that we now create MAX_NUM_TC num of TISs (one per prio)
> on netdevice creation instead of priv->params.num_tc which
> was always 1.
> 
> So far each channel had a single TXQ, Now each channel has a
> TXQ per TC (Traffic Class).
> 
> Added en_dcbnl.c which implements the set/get DCBNL IEEE ETS,
> set/get dcbx and registers the mlx5e dcbnl ops.
> 
> We still use the kernel's default TXQ selection method to select the
> channel to transmit through but now we use our own method to select
> the TXQ inside the channel based on VLAN priority.
> 
> In mlx5, as opposed to mlx4, tc group N gets lower priority than
> tc group N+1.
> 
> Signed-off-by: Saeed Mahameed <saeedm@...lanox.com>
> Signed-off-by: Rana Shahout <ranas@...lanox.com>
> ---


[...]

>  
> +static int mlx5e_setup_tc(struct net_device *netdev, u8 tc)
> +{
> +	struct mlx5e_priv *priv = netdev_priv(netdev);
> +	bool was_opened;
> +	int err = 0;
> +
> +	if (tc && tc != MLX5E_MAX_NUM_TC)
> +		return -EINVAL;
> +
> +	mutex_lock(&priv->state_lock);
> +
> +	was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state);
> +	if (was_opened)
> +		mlx5e_close_locked(priv->netdev);
> +
> +	priv->params.num_tc = tc ? tc : 1;
> +
> +	if (was_opened)
> +		err = mlx5e_open_locked(priv->netdev);
> +
> +	mutex_unlock(&priv->state_lock);
> +
> +	return err;
> +}
> +

Hi Saeed,

I just changed the signature on the setup_tc ndo hook so you will
need to change this to something like,

static int __mlx5e_setup_tc(struct net_device *dev, u32 handle,
			    __be16 proto, struct tc_to_netdev *tc)
{
	if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
		return -EINVAL;
	return mlx5e_setup_tc(dev, tc->tc)
}


and then use __mlx5e_setup_tc() to populate the ndo op hook. If you
look at the mlx4 drivers I did this change there already.

Other than that nice to see another dcb supporting driver.

Thanks,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ