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

Commit de4784ca authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: sched: get rid of struct tc_to_netdev



Get rid of struct tc_to_netdev which is now just unnecessary container
and rather pass per-type structures down to drivers directly.
Along with that, consolidate the naming of per-type structure variables
in cls_*.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38cf0426
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1919,16 +1919,17 @@ static void xgbe_poll_controller(struct net_device *netdev)
#endif /* End CONFIG_NET_POLL_CONTROLLER */

static int xgbe_setup_tc(struct net_device *netdev, enum tc_setup_type type,
			 struct tc_to_netdev *tc_to_netdev)
			 void *type_data)
{
	struct xgbe_prv_data *pdata = netdev_priv(netdev);
	struct tc_mqprio_qopt *mqprio = type_data;
	u8 tc;

	if (type != TC_SETUP_MQPRIO)
		return -EOPNOTSUPP;

	tc_to_netdev->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
	tc = tc_to_netdev->mqprio->num_tc;
	mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
	tc = mqprio->num_tc;

	if (tc > pdata->hw_feat.tc_cnt)
		return -EINVAL;
+5 −3
Original line number Diff line number Diff line
@@ -4285,14 +4285,16 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
}

int __bnx2x_setup_tc(struct net_device *dev, enum tc_setup_type type,
		     struct tc_to_netdev *tc)
		     void *type_data)
{
	struct tc_mqprio_qopt *mqprio = type_data;

	if (type != TC_SETUP_MQPRIO)
		return -EOPNOTSUPP;

	tc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
	mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

	return bnx2x_setup_tc(dev, tc->mqprio->num_tc);
	return bnx2x_setup_tc(dev, mqprio->num_tc);
}

/* called with rtnl_lock */
+1 −1
Original line number Diff line number Diff line
@@ -487,7 +487,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev);
/* setup_tc callback */
int bnx2x_setup_tc(struct net_device *dev, u8 num_tc);
int __bnx2x_setup_tc(struct net_device *dev, enum tc_setup_type type,
		     struct tc_to_netdev *tc);
		     void *type_data);

int bnx2x_get_vf_config(struct net_device *dev, int vf,
			struct ifla_vf_info *ivi);
+5 −3
Original line number Diff line number Diff line
@@ -7238,14 +7238,16 @@ int bnxt_setup_mq_tc(struct net_device *dev, u8 tc)
}

static int bnxt_setup_tc(struct net_device *dev, enum tc_setup_type type,
			 struct tc_to_netdev *ntc)
			 void *type_data)
{
	struct tc_mqprio_qopt *mqprio = type_data;

	if (type != TC_SETUP_MQPRIO)
		return -EOPNOTSUPP;

	ntc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
	mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

	return bnxt_setup_mq_tc(dev, ntc->mqprio->num_tc);
	return bnxt_setup_mq_tc(dev, mqprio->num_tc);
}

#ifdef CONFIG_RFS_ACCEL
+2 −2
Original line number Diff line number Diff line
@@ -2908,7 +2908,7 @@ static int cxgb_setup_tc_cls_u32(struct net_device *dev,
}

static int cxgb_setup_tc(struct net_device *dev, enum tc_setup_type type,
			 struct tc_to_netdev *tc)
			 void *type_data)
{
	struct port_info *pi = netdev2pinfo(dev);
	struct adapter *adap = netdev2adap(dev);
@@ -2922,7 +2922,7 @@ static int cxgb_setup_tc(struct net_device *dev, enum tc_setup_type type,

	switch (type) {
	case TC_SETUP_CLSU32:
		return cxgb_setup_tc_cls_u32(dev, tc->cls_u32);
		return cxgb_setup_tc_cls_u32(dev, type_data);
	default:
		return -EOPNOTSUPP;
	}
Loading