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

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

net: sched: make type an argument for ndo_setup_tc



Since the type is always present, push it to be a separate argument to
ndo_setup_tc. On the way, name the type enum and use it for arg type.

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 1afec92b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1918,14 +1918,14 @@ static void xgbe_poll_controller(struct net_device *netdev)
}
#endif /* End CONFIG_NET_POLL_CONTROLLER */

static int xgbe_setup_tc(struct net_device *netdev, u32 handle, u32 chain_index,
			 __be16 proto,
static int xgbe_setup_tc(struct net_device *netdev, enum tc_setup_type type,
			 u32 handle, u32 chain_index, __be16 proto,
			 struct tc_to_netdev *tc_to_netdev)
{
	struct xgbe_prv_data *pdata = netdev_priv(netdev);
	u8 tc;

	if (tc_to_netdev->type != TC_SETUP_MQPRIO)
	if (type != TC_SETUP_MQPRIO)
		return -EINVAL;

	tc_to_netdev->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
+4 −3
Original line number Diff line number Diff line
@@ -4284,10 +4284,11 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
	return 0;
}

int __bnx2x_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
		     __be16 proto, struct tc_to_netdev *tc)
int __bnx2x_setup_tc(struct net_device *dev, enum tc_setup_type type,
		     u32 handle, u32 chain_index, __be16 proto,
		     struct tc_to_netdev *tc)
{
	if (tc->type != TC_SETUP_MQPRIO)
	if (type != TC_SETUP_MQPRIO)
		return -EINVAL;

	tc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
+3 −2
Original line number Diff line number Diff line
@@ -486,8 +486,9 @@ 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, u32 handle, u32 chain_index,
		     __be16 proto, struct tc_to_netdev *tc);
int __bnx2x_setup_tc(struct net_device *dev, enum tc_setup_type type,
		     u32 handle, u32 chain_index, __be16 proto,
		     struct tc_to_netdev *tc);

int bnx2x_get_vf_config(struct net_device *dev, int vf,
			struct ifla_vf_info *ivi);
+4 −3
Original line number Diff line number Diff line
@@ -7237,10 +7237,11 @@ int bnxt_setup_mq_tc(struct net_device *dev, u8 tc)
	return 0;
}

static int bnxt_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
			 __be16 proto, struct tc_to_netdev *ntc)
static int bnxt_setup_tc(struct net_device *dev, enum tc_setup_type type,
			 u32 handle, u32 chain_index, __be16 proto,
			 struct tc_to_netdev *ntc)
{
	if (ntc->type != TC_SETUP_MQPRIO)
	if (type != TC_SETUP_MQPRIO)
		return -EINVAL;

	ntc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
+4 −3
Original line number Diff line number Diff line
@@ -2889,8 +2889,9 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
	return err;
}

static int cxgb_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
			 __be16 proto, struct tc_to_netdev *tc)
static int cxgb_setup_tc(struct net_device *dev, enum tc_setup_type type,
			 u32 handle, u32 chain_index, __be16 proto,
			 struct tc_to_netdev *tc)
{
	struct port_info *pi = netdev2pinfo(dev);
	struct adapter *adap = netdev2adap(dev);
@@ -2906,7 +2907,7 @@ static int cxgb_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
	}

	if (TC_H_MAJ(handle) == TC_H_MAJ(TC_H_INGRESS) &&
	    tc->type == TC_SETUP_CLSU32) {
	    type == TC_SETUP_CLSU32) {
		switch (tc->cls_u32->command) {
		case TC_CLSU32_NEW_KNODE:
		case TC_CLSU32_REPLACE_KNODE:
Loading