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: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko
2017-08-07 10:15:17 +02:00
committed by David S. Miller
parent 1afec92be0
commit 2572ac53c4
32 changed files with 125 additions and 113 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;