Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d853d112 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'net-sched-let-the-offloader-decide-what-to-offload'



Jiri Pirko says:

====================
net: sched: let the offloader decide what to offload

Currently there is a Qdisc_class_ops->tcf_cl_offload callback
that is called to find out if cls would offload rule or not.
This is only supported by sch_ingress and sch_clsact.
So the Qdisc are to decide. However, the driver knows what is he
able to offload, so move the decision making to drivers completely.
Just pass classid there and provide set of helpers to allow
identification of qdisc.

As a side effect, this actually allows clsact egress rules
offload in mlxsw.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c5ebc440 7b06e8ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2892,7 +2892,7 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
static int cxgb_setup_tc_cls_u32(struct net_device *dev,
				 struct tc_cls_u32_offload *cls_u32)
{
	if (TC_H_MAJ(cls_u32->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
	if (is_classid_clsact_ingress(cls_u32->common.classid) ||
	    cls_u32->common.chain_index)
		return -EOPNOTSUPP;

+1 −1
Original line number Diff line number Diff line
@@ -9230,7 +9230,7 @@ static int ixgbe_setup_tc_cls_u32(struct net_device *dev,
{
	struct ixgbe_adapter *adapter = netdev_priv(dev);

	if (TC_H_MAJ(cls_u32->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
	if (is_classid_clsact_ingress(cls_u32->common.classid) ||
	    cls_u32->common.chain_index)
		return -EOPNOTSUPP;

+1 −1
Original line number Diff line number Diff line
@@ -3031,7 +3031,7 @@ static int mlx5e_setup_tc_cls_flower(struct net_device *dev,
{
	struct mlx5e_priv *priv = netdev_priv(dev);

	if (TC_H_MAJ(cls_flower->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
	if (is_classid_clsact_ingress(cls_flower->common.classid) ||
	    cls_flower->common.chain_index)
		return -EOPNOTSUPP;

+1 −1
Original line number Diff line number Diff line
@@ -657,7 +657,7 @@ mlx5e_rep_setup_tc_cls_flower(struct net_device *dev,
{
	struct mlx5e_priv *priv = netdev_priv(dev);

	if (TC_H_MAJ(cls_flower->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
	if (is_classid_clsact_ingress(cls_flower->common.classid) ||
	    cls_flower->common.chain_index)
		return -EOPNOTSUPP;

+16 −2
Original line number Diff line number Diff line
@@ -1696,7 +1696,14 @@ static void mlxsw_sp_port_del_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
static int mlxsw_sp_setup_tc_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
					  struct tc_cls_matchall_offload *f)
{
	bool ingress = TC_H_MAJ(f->common.handle) == TC_H_MAJ(TC_H_INGRESS);
	bool ingress;

	if (is_classid_clsact_ingress(f->common.classid))
		ingress = true;
	else if (is_classid_clsact_egress(f->common.classid))
		ingress = false;
	else
		return -EOPNOTSUPP;

	if (f->common.chain_index)
		return -EOPNOTSUPP;
@@ -1717,7 +1724,14 @@ static int
mlxsw_sp_setup_tc_cls_flower(struct mlxsw_sp_port *mlxsw_sp_port,
			     struct tc_cls_flower_offload *f)
{
	bool ingress = TC_H_MAJ(f->common.handle) == TC_H_MAJ(TC_H_INGRESS);
	bool ingress;

	if (is_classid_clsact_ingress(f->common.classid))
		ingress = true;
	else if (is_classid_clsact_egress(f->common.classid))
		ingress = false;
	else
		return -EOPNOTSUPP;

	if (f->common.chain_index)
		return -EOPNOTSUPP;
Loading