aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-08-07 09:42:37 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-07 09:42:37 -0700
commit71feeef678056a640466a6d1faee3a7bcbbccab9 (patch)
tree7e49037950eb4ac5cbf296134e5a0e3b7fe456ac /include/linux/netdevice.h
parentMerge branch 'sctp-remove-typedefs-from-structures-part-5' (diff)
parentnet: sched: get rid of struct tc_to_netdev (diff)
downloadlinux-dev-71feeef678056a640466a6d1faee3a7bcbbccab9.tar.xz
linux-dev-71feeef678056a640466a6d1faee3a7bcbbccab9.zip
Merge branch 'net-sched-summer-cleanup-part-2-ndo_setup_tc'
Jiri Pirko says: ==================== net: sched: summer cleanup part 2, ndo_setup_tc This patchset focuses on ndo_setup_tc and its args. Currently there are couple of things that do not make much sense. The type is passed in struct tc_to_netdev, but as it is always required, should be arg of the ndo. Other things are passed as args but they are only relevant for cls offloads and not mqprio. Therefore, they should be pushed to struct. As the tc_to_netdev struct in the end is just a container of single pointer, we get rid of it and pass the struct according to type. So in the end, we have: ndo_setup_tc(dev, type, type_data_struct) There are couple of cosmetics done on the way to make things smooth. Also, reported error is consolidated to eopnotsupp in case the asked offload is not supported. v1->v2: - added forgotten hns3pf bits ==================== Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h30
1 files changed, 6 insertions, 24 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3a3cdc1b1f31..1d238d54c484 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -771,31 +771,14 @@ static inline bool netdev_phys_item_id_same(struct netdev_phys_item_id *a,
typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
struct sk_buff *skb);
-/* These structures hold the attributes of qdisc and classifiers
- * that are being passed to the netdevice through the setup_tc op.
- */
-enum {
+enum tc_setup_type {
TC_SETUP_MQPRIO,
TC_SETUP_CLSU32,
TC_SETUP_CLSFLOWER,
- TC_SETUP_MATCHALL,
+ TC_SETUP_CLSMATCHALL,
TC_SETUP_CLSBPF,
};
-struct tc_cls_u32_offload;
-
-struct tc_to_netdev {
- unsigned int type;
- union {
- struct tc_cls_u32_offload *cls_u32;
- struct tc_cls_flower_offload *cls_flower;
- struct tc_cls_matchall_offload *cls_mall;
- struct tc_cls_bpf_offload *cls_bpf;
- struct tc_mqprio_qopt *mqprio;
- };
- bool egress_dev;
-};
-
/* These structures hold the attributes of xdp state that are being passed
* to the netdevice through the xdp op.
*/
@@ -978,8 +961,8 @@ struct xfrmdev_ops {
* with PF and querying it may introduce a theoretical security risk.
* int (*ndo_set_vf_rss_query_en)(struct net_device *dev, int vf, bool setting);
* int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb);
- * int (*ndo_setup_tc)(struct net_device *dev, u32 handle, u32 chain_index,
- * __be16 protocol, struct tc_to_netdev *tc);
+ * int (*ndo_setup_tc)(struct net_device *dev, enum tc_setup_type type,
+ * void *type_data);
* Called to setup any 'tc' scheduler, classifier or action on @dev.
* This is always called from the stack with the rtnl lock held and netif
* tx queues stopped. This allows the netdevice to perform queue
@@ -1227,9 +1210,8 @@ struct net_device_ops {
struct net_device *dev,
int vf, bool setting);
int (*ndo_setup_tc)(struct net_device *dev,
- u32 handle, u32 chain_index,
- __be16 protocol,
- struct tc_to_netdev *tc);
+ enum tc_setup_type type,
+ void *type_data);
#if IS_ENABLED(CONFIG_FCOE)
int (*ndo_fcoe_enable)(struct net_device *dev);
int (*ndo_fcoe_disable)(struct net_device *dev);