net: sched: push cls related args into cls_common structure
authorJiri Pirko <jiri@mellanox.com>
Mon, 7 Aug 2017 08:15:29 +0000 (10:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Aug 2017 16:42:37 +0000 (09:42 -0700)
As ndo_setup_tc is generic offload op for whole tc subsystem, does not
really make sense to have cls-specific args. So move them under
cls_common structurure which is embedded in all cls structs.

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>
39 files changed:
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.h
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/flower/main.h
drivers/net/ethernet/netronome/nfp/flower/offload.c
drivers/net/ethernet/netronome/nfp/nfp_app.h
drivers/net/ethernet/netronome/nfp/nfp_port.c
drivers/net/ethernet/netronome/nfp/nfp_port.h
drivers/net/ethernet/sfc/efx.h
drivers/net/ethernet/sfc/falcon/efx.h
drivers/net/ethernet/sfc/falcon/tx.c
drivers/net/ethernet/sfc/tx.c
drivers/net/ethernet/ti/netcp_core.c
include/linux/netdevice.h
include/net/pkt_cls.h
net/dsa/slave.c
net/sched/cls_bpf.c
net/sched/cls_flower.c
net/sched/cls_matchall.c
net/sched/cls_u32.c
net/sched/sch_mqprio.c

index 6a6ea3bdd056e5a8adaf6bcd840ab82355334802..bbb7bfe0be7f1189cc1984f4b68b3db9f7290e2e 100644 (file)
@@ -1919,7 +1919,6 @@ 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,
-                        u32 handle, u32 chain_index, __be16 proto,
                         struct tc_to_netdev *tc_to_netdev)
 {
        struct xgbe_prv_data *pdata = netdev_priv(netdev);
index 4395d1cac86fafbe5cd797dcf0a5477b0d0d1e07..257cf4be01622ecdcd0aa7df4f29b506e66f59d0 100644 (file)
@@ -4285,7 +4285,6 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_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 (type != TC_SETUP_MQPRIO)
index 1ac4eb0d341307aa278d8b168ab624e45b711a86..04eb950430232c16f2961b6812fa47db2a703724 100644 (file)
@@ -487,7 +487,6 @@ 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,
-                    u32 handle, u32 chain_index, __be16 proto,
                     struct tc_to_netdev *tc);
 
 int bnx2x_get_vf_config(struct net_device *dev, int vf,
index b98d9f33d9af5ead84a90a5eba16f7f3039ec34b..1545b88c545deb6f287fadae1cb6f689056631f4 100644 (file)
@@ -7238,7 +7238,6 @@ 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,
-                        u32 handle, u32 chain_index, __be16 proto,
                         struct tc_to_netdev *ntc)
 {
        if (type != TC_SETUP_MQPRIO)
index 651229070113d71c83cf1b537b469727dd62a9cc..13199317c8e00336f0eb2962ffb852f16d0009a8 100644 (file)
@@ -2890,27 +2890,24 @@ 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,
-                                enum tc_setup_type type,
-                                u32 handle, u32 chain_index, __be16 proto,
                                 struct tc_cls_u32_offload *cls_u32)
 {
-       if (TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS) ||
-           chain_index)
+       if (TC_H_MAJ(cls_u32->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
+           cls_u32->common.chain_index)
                return -EOPNOTSUPP;
 
        switch (cls_u32->command) {
        case TC_CLSU32_NEW_KNODE:
        case TC_CLSU32_REPLACE_KNODE:
-               return cxgb4_config_knode(dev, proto, cls_u32);
+               return cxgb4_config_knode(dev, cls_u32);
        case TC_CLSU32_DELETE_KNODE:
-               return cxgb4_delete_knode(dev, proto, cls_u32);
+               return cxgb4_delete_knode(dev, cls_u32);
        default:
                return -EOPNOTSUPP;
        }
 }
 
 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);
@@ -2925,8 +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, type, handle, chain_index,
-                                            proto, tc->cls_u32);
+               return cxgb_setup_tc_cls_u32(dev, tc->cls_u32);
        default:
                return -EOPNOTSUPP;
        }
index 6f734c52ef2565d6e9be7f83c09d26b52617f69d..48970ba08bdc14623f0d15866731169e5755c7a4 100644 (file)
@@ -146,11 +146,11 @@ static int fill_action_fields(struct adapter *adap,
        return 0;
 }
 
-int cxgb4_config_knode(struct net_device *dev, __be16 protocol,
-                      struct tc_cls_u32_offload *cls)
+int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls)
 {
        const struct cxgb4_match_field *start, *link_start = NULL;
        struct adapter *adapter = netdev2adap(dev);
+       __be16 protocol = cls->common.protocol;
        struct ch_filter_specification fs;
        struct cxgb4_tc_u32_table *t;
        struct cxgb4_link *link;
@@ -338,8 +338,7 @@ out:
        return ret;
 }
 
-int cxgb4_delete_knode(struct net_device *dev, __be16 protocol,
-                      struct tc_cls_u32_offload *cls)
+int cxgb4_delete_knode(struct net_device *dev, struct tc_cls_u32_offload *cls)
 {
        struct adapter *adapter = netdev2adap(dev);
        unsigned int filter_id, max_tids, i, j;
index 021261a41c1312f6bd43fa3cc58dddc73eb023db..70a07b7cca56e0eab5f12042ecc9e6a18a0eba53 100644 (file)
@@ -44,10 +44,8 @@ static inline bool can_tc_u32_offload(struct net_device *dev)
        return (dev->features & NETIF_F_HW_TC) && adap->tc_u32 ? true : false;
 }
 
-int cxgb4_config_knode(struct net_device *dev, __be16 protocol,
-                      struct tc_cls_u32_offload *cls);
-int cxgb4_delete_knode(struct net_device *dev, __be16 protocol,
-                      struct tc_cls_u32_offload *cls);
+int cxgb4_config_knode(struct net_device *dev, struct tc_cls_u32_offload *cls);
+int cxgb4_delete_knode(struct net_device *dev, struct tc_cls_u32_offload *cls);
 
 void cxgb4_cleanup_tc_u32(struct adapter *adapter);
 struct cxgb4_tc_u32_table *cxgb4_init_tc_u32(struct adapter *adap);
index d86d766777c873548dc57914df0eae5bb22ed832..3827608cec29bf08b2d5e860c54c82dc5f454d68 100644 (file)
@@ -343,7 +343,6 @@ static void dpaa_get_stats64(struct net_device *net_dev,
 }
 
 static int dpaa_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
-                        u32 handle, u32 chain_index, __be16 proto,
                         struct tc_to_netdev *tc)
 {
        struct dpaa_priv *priv = netdev_priv(net_dev);
index ef5795923b0cf7e4068490f8068aad36c2224509..dc64d751db24ccf17c42b0a396dbe4f059f50d0f 100644 (file)
@@ -1220,7 +1220,6 @@ static int hns3_setup_tc(struct net_device *netdev, u8 tc)
 }
 
 static int hns3_nic_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                            u32 handle, u32 chain_index, __be16 protocol,
                             struct tc_to_netdev *tc)
 {
        if (type != TC_SETUP_MQPRIO)
index b30190639e78c3635f40a6fdac9ae7fa3888ea18..71004b8eff95f4b1efcce7478e0c383b5e36c330 100644 (file)
@@ -1266,7 +1266,6 @@ err_queueing_scheme:
 }
 
 static int __fm10k_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                           u32 handle, u32 chain_index, __be16 proto,
                            struct tc_to_netdev *tc)
 {
        if (type != TC_SETUP_MQPRIO)
index 7d47a718f92226fdec6c669a4904c12d48c461bd..97d8bb2e83207ab95622bdc94bd3dbe7db46d6ff 100644 (file)
@@ -5657,7 +5657,6 @@ exit:
 }
 
 static int __i40e_setup_tc(struct net_device *netdev, enum tc_setup_type type,
-                          u32 handle, u32 chain_index, __be16 proto,
                           struct tc_to_netdev *tc)
 {
        if (type != TC_SETUP_MQPRIO)
index 35db198199b0d2cd1ae1a63fc959d38a986880e4..0a350314d76bc385460524266bc845e3f5de599c 100644 (file)
@@ -8851,7 +8851,6 @@ static int ixgbe_delete_clsu32(struct ixgbe_adapter *adapter,
 }
 
 static int ixgbe_configure_clsu32_add_hnode(struct ixgbe_adapter *adapter,
-                                           __be16 protocol,
                                            struct tc_cls_u32_offload *cls)
 {
        u32 uhtid = TC_U32_USERHTID(cls->hnode.handle);
@@ -9037,9 +9036,9 @@ static int ixgbe_clsu32_build_input(struct ixgbe_fdir_filter *input,
 }
 
 static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
-                                 __be16 protocol,
                                  struct tc_cls_u32_offload *cls)
 {
+       __be16 protocol = cls->common.protocol;
        u32 loc = cls->knode.handle & 0xfffff;
        struct ixgbe_hw *hw = &adapter->hw;
        struct ixgbe_mat_field *field_ptr;
@@ -9227,25 +9226,23 @@ free_jump:
 }
 
 static int ixgbe_setup_tc_cls_u32(struct net_device *dev,
-                                 u32 handle, u32 chain_index, __be16 proto,
                                  struct tc_cls_u32_offload *cls_u32)
 {
        struct ixgbe_adapter *adapter = netdev_priv(dev);
 
-       if (TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS) ||
-           chain_index)
+       if (TC_H_MAJ(cls_u32->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
+           cls_u32->common.chain_index)
                return -EOPNOTSUPP;
 
        switch (cls_u32->command) {
        case TC_CLSU32_NEW_KNODE:
        case TC_CLSU32_REPLACE_KNODE:
-               return ixgbe_configure_clsu32(adapter, proto, cls_u32);
+               return ixgbe_configure_clsu32(adapter, cls_u32);
        case TC_CLSU32_DELETE_KNODE:
                return ixgbe_delete_clsu32(adapter, cls_u32);
        case TC_CLSU32_NEW_HNODE:
        case TC_CLSU32_REPLACE_HNODE:
-               return ixgbe_configure_clsu32_add_hnode(adapter, proto,
-                                                       cls_u32);
+               return ixgbe_configure_clsu32_add_hnode(adapter, cls_u32);
        case TC_CLSU32_DELETE_HNODE:
                return ixgbe_configure_clsu32_del_hnode(adapter, cls_u32);
        default:
@@ -9261,13 +9258,11 @@ static int ixgbe_setup_tc_mqprio(struct net_device *dev,
 }
 
 static int __ixgbe_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                           u32 handle, u32 chain_index, __be16 proto,
                            struct tc_to_netdev *tc)
 {
        switch (type) {
        case TC_SETUP_CLSU32:
-               return ixgbe_setup_tc_cls_u32(dev, handle, chain_index, proto,
-                                             tc->cls_u32);
+               return ixgbe_setup_tc_cls_u32(dev, tc->cls_u32);
        case TC_SETUP_MQPRIO:
                return ixgbe_setup_tc_mqprio(dev, tc->mqprio);
        default:
index 5c33550765edbb2da540b5255fc7145884cbd2f8..e81083e25ba64c7cae26c336f2a2b1f96e065f26 100644 (file)
@@ -131,7 +131,6 @@ out:
 }
 
 static int __mlx4_en_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                             u32 handle, u32 chain_index, __be16 proto,
                              struct tc_to_netdev *tc)
 {
        if (type != TC_SETUP_MQPRIO)
index adf35da74a85af893a626ad47bcd7fe203055242..15f2a942962a4180254bbad70f938367e97b1760 100644 (file)
@@ -3032,18 +3032,17 @@ out:
 }
 
 static int mlx5e_setup_tc_cls_flower(struct net_device *dev,
-                                    u32 handle, u32 chain_index, __be16 proto,
                                     struct tc_cls_flower_offload *cls_flower)
 {
        struct mlx5e_priv *priv = netdev_priv(dev);
 
-       if (TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS) ||
-           chain_index)
+       if (TC_H_MAJ(cls_flower->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
+           cls_flower->common.chain_index)
                return -EOPNOTSUPP;
 
        switch (cls_flower->command) {
        case TC_CLSFLOWER_REPLACE:
-               return mlx5e_configure_flower(priv, proto, cls_flower);
+               return mlx5e_configure_flower(priv, cls_flower);
        case TC_CLSFLOWER_DESTROY:
                return mlx5e_delete_flower(priv, cls_flower);
        case TC_CLSFLOWER_STATS:
@@ -3054,13 +3053,11 @@ static int mlx5e_setup_tc_cls_flower(struct net_device *dev,
 }
 
 static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                         u32 handle, u32 chain_index, __be16 proto,
                          struct tc_to_netdev *tc)
 {
        switch (type) {
        case TC_SETUP_CLSFLOWER:
-               return mlx5e_setup_tc_cls_flower(dev, handle, chain_index,
-                                                proto, tc->cls_flower);
+               return mlx5e_setup_tc_cls_flower(dev, tc->cls_flower);
        case TC_SETUP_MQPRIO:
                return mlx5e_setup_tc_mqprio(dev, tc->mqprio);
        default:
index e6cc642f6d8cc85b0b173b0d533bebc92b74b361..e5cf2e7ae052526cf95dc0069820620a67e9ef76 100644 (file)
@@ -652,15 +652,13 @@ static int mlx5e_rep_get_phys_port_name(struct net_device *dev,
 }
 
 static int mlx5e_rep_setup_tc_cls_flower(struct net_device *dev,
-                                        u32 handle, u32 chain_index,
-                                        __be16 proto,
                                         struct tc_to_netdev *tc)
 {
        struct tc_cls_flower_offload *cls_flower = tc->cls_flower;
        struct mlx5e_priv *priv = netdev_priv(dev);
 
-       if (TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS) ||
-           chain_index)
+       if (TC_H_MAJ(cls_flower->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
+           cls_flower->common.chain_index)
                return -EOPNOTSUPP;
 
        if (cls_flower->egress_dev) {
@@ -668,13 +666,12 @@ static int mlx5e_rep_setup_tc_cls_flower(struct net_device *dev,
 
                dev = mlx5_eswitch_get_uplink_netdev(esw);
                return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER,
-                                                    handle, chain_index,
-                                                    proto, tc);
+                                                    tc);
        }
 
        switch (cls_flower->command) {
        case TC_CLSFLOWER_REPLACE:
-               return mlx5e_configure_flower(priv, proto, cls_flower);
+               return mlx5e_configure_flower(priv, cls_flower);
        case TC_CLSFLOWER_DESTROY:
                return mlx5e_delete_flower(priv, cls_flower);
        case TC_CLSFLOWER_STATS:
@@ -685,13 +682,11 @@ static int mlx5e_rep_setup_tc_cls_flower(struct net_device *dev,
 }
 
 static int mlx5e_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                             u32 handle, u32 chain_index, __be16 proto,
                              struct tc_to_netdev *tc)
 {
        switch (type) {
        case TC_SETUP_CLSFLOWER:
-               return mlx5e_rep_setup_tc_cls_flower(dev, handle, chain_index,
-                                                    proto, tc);
+               return mlx5e_rep_setup_tc_cls_flower(dev, tc);
        default:
                return -EOPNOTSUPP;
        }
index 78f50d9f621d76750058e92f214cba1d689d6a0d..3b10d3df7627a9fdf9d00953e83cd1c32b91d6a5 100644 (file)
@@ -1939,7 +1939,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
        return err;
 }
 
-int mlx5e_configure_flower(struct mlx5e_priv *priv, __be16 protocol,
+int mlx5e_configure_flower(struct mlx5e_priv *priv,
                           struct tc_cls_flower_offload *f)
 {
        struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
index ecbe30d808ae0c1712a31a0d8b1f425236595255..5a0f4a4878551ced6b755571ebf354b0d40d2e21 100644 (file)
@@ -38,7 +38,7 @@
 int mlx5e_tc_init(struct mlx5e_priv *priv);
 void mlx5e_tc_cleanup(struct mlx5e_priv *priv);
 
-int mlx5e_configure_flower(struct mlx5e_priv *priv, __be16 protocol,
+int mlx5e_configure_flower(struct mlx5e_priv *priv,
                           struct tc_cls_flower_offload *f);
 int mlx5e_delete_flower(struct mlx5e_priv *priv,
                        struct tc_cls_flower_offload *f);
index f333d086932db0cec3459e33c8b1ee7f08c3a137..1ca3204f5543d31e2a45ae42b0dfbd87b32f24f4 100644 (file)
@@ -1617,11 +1617,11 @@ mlxsw_sp_port_del_cls_matchall_sample(struct mlxsw_sp_port *mlxsw_sp_port)
 }
 
 static int mlxsw_sp_port_add_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
-                                         __be16 protocol,
                                          struct tc_cls_matchall_offload *f,
                                          bool ingress)
 {
        struct mlxsw_sp_port_mall_tc_entry *mall_tc_entry;
+       __be16 protocol = f->common.protocol;
        const struct tc_action *a;
        LIST_HEAD(actions);
        int err;
@@ -1694,18 +1694,16 @@ 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,
-                                         u32 handle, u32 chain_index,
-                                         __be16 proto,
                                          struct tc_cls_matchall_offload *f)
 {
-       bool ingress = TC_H_MAJ(handle) == TC_H_MAJ(TC_H_INGRESS);
+       bool ingress = TC_H_MAJ(f->common.handle) == TC_H_MAJ(TC_H_INGRESS);
 
-       if (chain_index)
+       if (f->common.chain_index)
                return -EOPNOTSUPP;
 
        switch (f->command) {
        case TC_CLSMATCHALL_REPLACE:
-               return mlxsw_sp_port_add_cls_matchall(mlxsw_sp_port, proto, f,
+               return mlxsw_sp_port_add_cls_matchall(mlxsw_sp_port, f,
                                                      ingress);
        case TC_CLSMATCHALL_DESTROY:
                mlxsw_sp_port_del_cls_matchall(mlxsw_sp_port, f);
@@ -1717,18 +1715,16 @@ static int mlxsw_sp_setup_tc_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
 
 static int
 mlxsw_sp_setup_tc_cls_flower(struct mlxsw_sp_port *mlxsw_sp_port,
-                            u32 handle, u32 chain_index, __be16 proto,
                             struct tc_cls_flower_offload *f)
 {
-       bool ingress = TC_H_MAJ(handle) == TC_H_MAJ(TC_H_INGRESS);
+       bool ingress = TC_H_MAJ(f->common.handle) == TC_H_MAJ(TC_H_INGRESS);
 
-       if (chain_index)
+       if (f->common.chain_index)
                return -EOPNOTSUPP;
 
        switch (f->command) {
        case TC_CLSFLOWER_REPLACE:
-               return mlxsw_sp_flower_replace(mlxsw_sp_port, ingress,
-                                              proto, f);
+               return mlxsw_sp_flower_replace(mlxsw_sp_port, ingress, f);
        case TC_CLSFLOWER_DESTROY:
                mlxsw_sp_flower_destroy(mlxsw_sp_port, ingress, f);
                return 0;
@@ -1740,19 +1736,16 @@ mlxsw_sp_setup_tc_cls_flower(struct mlxsw_sp_port *mlxsw_sp_port,
 }
 
 static int mlxsw_sp_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                            u32 handle, u32 chain_index, __be16 proto,
                             struct tc_to_netdev *tc)
 {
        struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
 
        switch (type) {
        case TC_SETUP_CLSMATCHALL:
-               return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port, handle,
-                                                     chain_index, proto,
+               return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port,
                                                      tc->cls_mall);
        case TC_SETUP_CLSFLOWER:
-               return mlxsw_sp_setup_tc_cls_flower(mlxsw_sp_port, handle,
-                                                   chain_index, proto,
+               return mlxsw_sp_setup_tc_cls_flower(mlxsw_sp_port,
                                                    tc->cls_flower);
        default:
                return -EOPNOTSUPP;
index e848f06e34e6e678dcc0f9167acf421638d886dc..8452d1db2f3fe685cf9c20070fbf6150af0b4250 100644 (file)
@@ -508,7 +508,7 @@ extern const struct mlxsw_sp_acl_ops mlxsw_sp_acl_tcam_ops;
 
 /* spectrum_flower.c */
 int mlxsw_sp_flower_replace(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
-                           __be16 protocol, struct tc_cls_flower_offload *f);
+                           struct tc_cls_flower_offload *f);
 void mlxsw_sp_flower_destroy(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
                             struct tc_cls_flower_offload *f);
 int mlxsw_sp_flower_stats(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
index 9be48d2e43cabd879b52be02b1bbafa141dd7e67..021b6c0076c04340d0e0564c4e9be5da66863d2d 100644 (file)
@@ -368,7 +368,7 @@ static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp,
 }
 
 int mlxsw_sp_flower_replace(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
-                           __be16 protocol, struct tc_cls_flower_offload *f)
+                           struct tc_cls_flower_offload *f)
 {
        struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
        struct net_device *dev = mlxsw_sp_port->dev;
index d7975dcecb40237c2f7b13360726ecb0078697b1..152a7abb58ed086439b785a845d9665491b47c7f 100644 (file)
@@ -121,20 +121,22 @@ static void nfp_bpf_vnic_clean(struct nfp_app *app, struct nfp_net *nn)
 }
 
 static int nfp_bpf_setup_tc(struct nfp_app *app, struct net_device *netdev,
-                           enum tc_setup_type type, u32 handle, __be16 proto,
+                           enum tc_setup_type type,
                            struct tc_to_netdev *tc)
 {
+       struct tc_cls_bpf_offload *cls_bpf = tc->cls_bpf;
        struct nfp_net *nn = netdev_priv(netdev);
 
        if (type != TC_SETUP_CLSBPF || !nfp_net_ebpf_capable(nn) ||
-           TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS) ||
-           proto != htons(ETH_P_ALL))
+           TC_H_MAJ(cls_bpf->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
+           cls_bpf->common.protocol != htons(ETH_P_ALL) ||
+           cls_bpf->common.chain_index)
                return -EOPNOTSUPP;
 
        if (nn->dp.bpf_offload_xdp)
                return -EBUSY;
 
-       return nfp_net_bpf_offload(nn, tc->cls_bpf);
+       return nfp_net_bpf_offload(nn, cls_bpf);
 }
 
 static bool nfp_bpf_tc_busy(struct nfp_app *app, struct nfp_net *nn)
index 314e6e8ba6498cbb0dbeaebfb47549cc86b6b408..eb94d08e35cf298e774fe88a979824bdab1311eb 100644 (file)
@@ -135,8 +135,7 @@ int nfp_flower_metadata_init(struct nfp_app *app);
 void nfp_flower_metadata_cleanup(struct nfp_app *app);
 
 int nfp_flower_setup_tc(struct nfp_app *app, struct net_device *netdev,
-                       enum tc_setup_type type, u32 handle, __be16 proto,
-                       struct tc_to_netdev *tc);
+                       enum tc_setup_type type, struct tc_to_netdev *tc);
 int nfp_flower_compile_flow_match(struct tc_cls_flower_offload *flow,
                                  struct nfp_fl_key_ls *key_ls,
                                  struct net_device *netdev,
index 58af438a95c19ad74a9b574ed8342f41d48daa7a..8197836c650d9cbc54171a35a8ffb7eea4860e80 100644 (file)
@@ -385,13 +385,15 @@ nfp_flower_repr_offload(struct nfp_app *app, struct net_device *netdev,
 }
 
 int nfp_flower_setup_tc(struct nfp_app *app, struct net_device *netdev,
-                       enum tc_setup_type type, u32 handle, __be16 proto,
-                       struct tc_to_netdev *tc)
+                       enum tc_setup_type type, struct tc_to_netdev *tc)
 {
+       struct tc_cls_flower_offload *cls_flower = tc->cls_flower;
+
        if (type != TC_SETUP_CLSFLOWER ||
-           TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS) ||
-           !eth_proto_is_802_3(proto))
+           TC_H_MAJ(cls_flower->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
+           !eth_proto_is_802_3(cls_flower->common.protocol) ||
+           cls_flower->common.chain_index)
                return -EOPNOTSUPP;
 
-       return nfp_flower_repr_offload(app, netdev, tc->cls_flower);
+       return nfp_flower_repr_offload(app, netdev, cls_flower);
 }
index b3b03bb9d90782cd5a8cbe3c4f5d25d78288e471..7a2f950b149c631451a7df7041c7aa5ebf710e95 100644 (file)
@@ -109,8 +109,7 @@ struct nfp_app_type {
        void (*ctrl_msg_rx)(struct nfp_app *app, struct sk_buff *skb);
 
        int (*setup_tc)(struct nfp_app *app, struct net_device *netdev,
-                       enum tc_setup_type type, u32 handle, __be16 proto,
-                       struct tc_to_netdev *tc);
+                       enum tc_setup_type type, struct tc_to_netdev *tc);
        bool (*tc_busy)(struct nfp_app *app, struct nfp_net *nn);
        int (*xdp_offload)(struct nfp_app *app, struct nfp_net *nn,
                           struct bpf_prog *prog);
@@ -240,12 +239,11 @@ static inline bool nfp_app_tc_busy(struct nfp_app *app, struct nfp_net *nn)
 static inline int nfp_app_setup_tc(struct nfp_app *app,
                                   struct net_device *netdev,
                                   enum tc_setup_type type,
-                                  u32 handle, __be16 proto,
                                   struct tc_to_netdev *tc)
 {
        if (!app || !app->type->setup_tc)
                return -EOPNOTSUPP;
-       return app->type->setup_tc(app, netdev, type, handle, proto, tc);
+       return app->type->setup_tc(app, netdev, type, tc);
 }
 
 static inline int nfp_app_xdp_offload(struct nfp_app *app, struct nfp_net *nn,
index 9d776f9823521d713267a4e99eae5ecb52dd6576..e8abab2b912eb3317bc6975b26f31cc9bafe5bdb 100644 (file)
@@ -89,19 +89,15 @@ const struct switchdev_ops nfp_port_switchdev_ops = {
 };
 
 int nfp_port_setup_tc(struct net_device *netdev, enum tc_setup_type type,
-                     u32 handle, u32 chain_index, __be16 proto,
                      struct tc_to_netdev *tc)
 {
        struct nfp_port *port;
 
-       if (chain_index)
-               return -EOPNOTSUPP;
-
        port = nfp_port_from_netdev(netdev);
        if (!port)
                return -EOPNOTSUPP;
 
-       return nfp_app_setup_tc(port->app, netdev, type, handle, proto, tc);
+       return nfp_app_setup_tc(port->app, netdev, type, tc);
 }
 
 struct nfp_port *
index 239c5401000c431ee95e2c95ed31fbc1d01b0f5a..252f06d4307fdaff2193f6ed1ce2490f088e89dc 100644 (file)
@@ -110,7 +110,6 @@ struct nfp_port {
 extern const struct switchdev_ops nfp_port_switchdev_ops;
 
 int nfp_port_setup_tc(struct net_device *netdev, enum tc_setup_type type,
-                     u32 handle, u32 chain_index, __be16 proto,
                      struct tc_to_netdev *tc);
 
 struct nfp_port *nfp_port_from_netdev(struct net_device *netdev);
index e41a7179bc054aaf484b9fc9f8d8fb61c042222c..b0c6004db13838460f3d62b54585172f06b148a6 100644 (file)
@@ -33,7 +33,6 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb,
 netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
 void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
 int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
-                u32 handle, u32 chain_index, __be16 proto,
                 struct tc_to_netdev *tc);
 unsigned int efx_tx_max_skb_descs(struct efx_nic *efx);
 extern unsigned int efx_piobuf_size;
index f3bc67ec1f301b07c364501b966deffbce825d0c..4497511fc91441dccdf05098caedf5885e18de84 100644 (file)
@@ -33,7 +33,6 @@ netdev_tx_t ef4_hard_start_xmit(struct sk_buff *skb,
 netdev_tx_t ef4_enqueue_skb(struct ef4_tx_queue *tx_queue, struct sk_buff *skb);
 void ef4_xmit_done(struct ef4_tx_queue *tx_queue, unsigned int index);
 int ef4_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
-                u32 handle, u32 chain_index, __be16 proto,
                 struct tc_to_netdev *tc);
 unsigned int ef4_tx_max_skb_descs(struct ef4_nic *efx);
 extern bool ef4_separate_tx_channels;
index 6c4752694c1fd95e5bc6d42328ee8e05e8fea0c2..447519ac3fa4b9c8c0b021291d773209d768c554 100644 (file)
@@ -426,7 +426,6 @@ void ef4_init_tx_queue_core_txq(struct ef4_tx_queue *tx_queue)
 }
 
 int ef4_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
-                u32 handle, u32 chain_index, __be16 proto,
                 struct tc_to_netdev *ntc)
 {
        struct ef4_nic *efx = netdev_priv(net_dev);
index 0c08c10d751cc84451afb90a78ad089a5ed5a5b2..d17af918ac50e596817eabc38ff107230efdf4ae 100644 (file)
@@ -654,7 +654,6 @@ void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue)
 }
 
 int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
-                u32 handle, u32 chain_index, __be16 proto,
                 struct tc_to_netdev *ntc)
 {
        struct efx_nic *efx = netdev_priv(net_dev);
index cb21742f617730f0db8a1b6c1ea6dc7d9ef85733..14f91b285f0082f06c7ab8b3b356f35804218bb2 100644 (file)
@@ -1878,7 +1878,6 @@ static u16 netcp_select_queue(struct net_device *dev, struct sk_buff *skb,
 }
 
 static int netcp_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                         u32 handle, u32 chain_index, __be16 proto,
                          struct tc_to_netdev *tc)
 {
        u8 num_tc;
index bd49dbaee84ea9354385ae3057ccc3b0c2f709bc..6e2f7e38cf8ead34dbfe2037cbbc30ae407ed9d2 100644 (file)
@@ -977,7 +977,6 @@ struct xfrmdev_ops {
  * 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, enum tc_setup_type type,
- *                    u32 handle, u32 chain_index, __be16 protocol,
  *                    struct tc_to_netdev *tc);
  *     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
@@ -1227,8 +1226,6 @@ struct net_device_ops {
                                                   int vf, bool setting);
        int                     (*ndo_setup_tc)(struct net_device *dev,
                                                enum tc_setup_type type,
-                                               u32 handle, u32 chain_index,
-                                               __be16 protocol,
                                                struct tc_to_netdev *tc);
 #if IS_ENABLED(CONFIG_FCOE)
        int                     (*ndo_fcoe_enable)(struct net_device *dev);
index 8213acdfdf5ab19f0acd2171de82382497800f6b..ffaddf72108ea31a3071c10788a444c409aee042 100644 (file)
@@ -405,6 +405,21 @@ tcf_match_indev(struct sk_buff *skb, int ifindex)
 }
 #endif /* CONFIG_NET_CLS_IND */
 
+struct tc_cls_common_offload {
+       u32 handle;
+       u32 chain_index;
+       __be16 protocol;
+};
+
+static inline void
+tc_cls_common_offload_init(struct tc_cls_common_offload *cls_common,
+                          const struct tcf_proto *tp)
+{
+       cls_common->handle = tp->q->handle;
+       cls_common->chain_index = tp->chain->index;
+       cls_common->protocol = tp->protocol;
+}
+
 struct tc_cls_u32_knode {
        struct tcf_exts *exts;
        struct tc_u32_sel *sel;
@@ -431,6 +446,7 @@ enum tc_clsu32_command {
 };
 
 struct tc_cls_u32_offload {
+       struct tc_cls_common_offload common;
        /* knode values */
        enum tc_clsu32_command command;
        union {
@@ -497,6 +513,7 @@ enum tc_fl_command {
 };
 
 struct tc_cls_flower_offload {
+       struct tc_cls_common_offload common;
        enum tc_fl_command command;
        u32 prio;
        unsigned long cookie;
@@ -513,6 +530,7 @@ enum tc_matchall_command {
 };
 
 struct tc_cls_matchall_offload {
+       struct tc_cls_common_offload common;
        enum tc_matchall_command command;
        struct tcf_exts *exts;
        unsigned long cookie;
@@ -526,6 +544,7 @@ enum tc_clsbpf_command {
 };
 
 struct tc_cls_bpf_offload {
+       struct tc_cls_common_offload common;
        enum tc_clsbpf_command command;
        struct tcf_exts *exts;
        struct bpf_prog *prog;
index e76d576b941d56ff92873e23ecd7c7fc76aad33a..5e01e927161959bdf92ca27768c29829d9865a0c 100644 (file)
@@ -774,12 +774,12 @@ dsa_slave_mall_tc_entry_find(struct dsa_slave_priv *p,
 }
 
 static int dsa_slave_add_cls_matchall(struct net_device *dev,
-                                     __be16 protocol,
                                      struct tc_cls_matchall_offload *cls,
                                      bool ingress)
 {
        struct dsa_slave_priv *p = netdev_priv(dev);
        struct dsa_mall_tc_entry *mall_tc_entry;
+       __be16 protocol = cls->common.protocol;
        struct dsa_switch *ds = p->dp->ds;
        struct net *net = dev_net(dev);
        struct dsa_slave_priv *to_p;
@@ -864,18 +864,16 @@ static void dsa_slave_del_cls_matchall(struct net_device *dev,
 }
 
 static int dsa_slave_setup_tc_cls_matchall(struct net_device *dev,
-                                          u32 handle, u32 chain_index,
-                                          __be16 protocol,
                                           struct tc_cls_matchall_offload *cls)
 {
-       bool ingress = TC_H_MAJ(handle) == TC_H_MAJ(TC_H_INGRESS);
+       bool ingress = TC_H_MAJ(cls->common.handle) == TC_H_MAJ(TC_H_INGRESS);
 
-       if (chain_index)
+       if (cls->common.chain_index)
                return -EOPNOTSUPP;
 
        switch (cls->command) {
        case TC_CLSMATCHALL_REPLACE:
-               return dsa_slave_add_cls_matchall(dev, protocol, cls, ingress);
+               return dsa_slave_add_cls_matchall(dev, cls, ingress);
        case TC_CLSMATCHALL_DESTROY:
                dsa_slave_del_cls_matchall(dev, cls);
                return 0;
@@ -885,13 +883,11 @@ static int dsa_slave_setup_tc_cls_matchall(struct net_device *dev,
 }
 
 static int dsa_slave_setup_tc(struct net_device *dev, enum tc_setup_type type,
-                             u32 handle, u32 chain_index, __be16 protocol,
                              struct tc_to_netdev *tc)
 {
        switch (type) {
        case TC_SETUP_CLSMATCHALL:
-               return dsa_slave_setup_tc_cls_matchall(dev, handle, chain_index,
-                                                      protocol, tc->cls_mall);
+               return dsa_slave_setup_tc_cls_matchall(dev, tc->cls_mall);
        default:
                return -EOPNOTSUPP;
        }
index e2bf2753173d1721ecfafc58d6ceb8c530c7bdd8..dde8efdcee3bd1784808bb27eb20883649c28f53 100644 (file)
@@ -153,6 +153,7 @@ static int cls_bpf_offload_cmd(struct tcf_proto *tp, struct cls_bpf_prog *prog,
 
        offload.cls_bpf = &bpf_offload;
 
+       tc_cls_common_offload_init(&bpf_offload.common, tp);
        bpf_offload.command = cmd;
        bpf_offload.exts = &prog->exts;
        bpf_offload.prog = prog->filter;
@@ -160,11 +161,7 @@ static int cls_bpf_offload_cmd(struct tcf_proto *tp, struct cls_bpf_prog *prog,
        bpf_offload.exts_integrated = prog->exts_integrated;
        bpf_offload.gen_flags = prog->gen_flags;
 
-       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSBPF,
-                                           tp->q->handle,
-                                           tp->chain->index,
-                                           tp->protocol, &offload);
-
+       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSBPF, &offload);
        if (!err && (cmd == TC_CLSBPF_ADD || cmd == TC_CLSBPF_REPLACE))
                prog->gen_flags |= TCA_CLS_FLAGS_IN_HW;
 
index 52deeed2b7f54c6dfa0e3ac4cb258dc2a345981b..1fdf2889ba9fb60d3f2ce006f00e3a1301565ec8 100644 (file)
@@ -232,14 +232,14 @@ static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f)
        if (!tc_can_offload(dev, tp))
                return;
 
+       tc_cls_common_offload_init(&offload.common, tp);
        offload.command = TC_CLSFLOWER_DESTROY;
        offload.prio = tp->prio;
        offload.cookie = (unsigned long)f;
 
        tc->cls_flower = &offload;
 
-       dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER, tp->q->handle,
-                                     tp->chain->index, tp->protocol, tc);
+       dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER, tc);
 }
 
 static int fl_hw_replace_filter(struct tcf_proto *tp,
@@ -264,6 +264,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
                f->hw_dev = dev;
        }
 
+       tc_cls_common_offload_init(&offload.common, tp);
        offload.command = TC_CLSFLOWER_REPLACE;
        offload.prio = tp->prio;
        offload.cookie = (unsigned long)f;
@@ -274,9 +275,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
 
        tc->cls_flower = &offload;
 
-       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER,
-                                           tp->q->handle, tp->chain->index,
-                                           tp->protocol, tc);
+       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER, tc);
        if (!err)
                f->flags |= TCA_CLS_FLAGS_IN_HW;
 
@@ -294,6 +293,7 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
        if (!tc_can_offload(dev, tp))
                return;
 
+       tc_cls_common_offload_init(&offload.common, tp);
        offload.command = TC_CLSFLOWER_STATS;
        offload.prio = tp->prio;
        offload.cookie = (unsigned long)f;
@@ -301,8 +301,7 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
 
        tc->cls_flower = &offload;
 
-       dev->netdev_ops->ndo_setup_tc(dev, TC_CLSFLOWER_STATS, tp->q->handle,
-                                     tp->chain->index, tp->protocol, tc);
+       dev->netdev_ops->ndo_setup_tc(dev, TC_CLSFLOWER_STATS, tc);
 }
 
 static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
index a8853ada22f6b3d1bd314e3b153694033a7dadd7..174c700160cafce7b7c6b4198cbc33b9a2db90c8 100644 (file)
@@ -58,14 +58,14 @@ static int mall_replace_hw_filter(struct tcf_proto *tp,
        struct tc_cls_matchall_offload mall_offload = {0};
        int err;
 
+       tc_cls_common_offload_init(&mall_offload.common, tp);
        offload.cls_mall = &mall_offload;
        offload.cls_mall->command = TC_CLSMATCHALL_REPLACE;
        offload.cls_mall->exts = &head->exts;
        offload.cls_mall->cookie = cookie;
 
        err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSMATCHALL,
-                                           tp->q->handle, tp->chain->index,
-                                           tp->protocol, &offload);
+                                           &offload);
        if (!err)
                head->flags |= TCA_CLS_FLAGS_IN_HW;
 
@@ -80,13 +80,13 @@ static void mall_destroy_hw_filter(struct tcf_proto *tp,
        struct tc_to_netdev offload;
        struct tc_cls_matchall_offload mall_offload = {0};
 
+       tc_cls_common_offload_init(&mall_offload.common, tp);
        offload.cls_mall = &mall_offload;
        offload.cls_mall->command = TC_CLSMATCHALL_DESTROY;
        offload.cls_mall->exts = NULL;
        offload.cls_mall->cookie = cookie;
 
-       dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSMATCHALL, tp->q->handle,
-                                     tp->chain->index, tp->protocol, &offload);
+       dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSMATCHALL, &offload);
 }
 
 static void mall_destroy(struct tcf_proto *tp)
index d1bae4cc749f6c3ffd1f43fd737bdc668245ea13..c0f59c471523f6c1a58aa8ff7a0da65f1e9162f9 100644 (file)
@@ -437,11 +437,10 @@ static void u32_remove_hw_knode(struct tcf_proto *tp, u32 handle)
        offload.cls_u32 = &u32_offload;
 
        if (tc_should_offload(dev, tp, 0)) {
+               tc_cls_common_offload_init(&u32_offload.common, tp);
                offload.cls_u32->command = TC_CLSU32_DELETE_KNODE;
                offload.cls_u32->knode.handle = handle;
-               dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32,
-                                             tp->q->handle, tp->chain->index,
-                                             tp->protocol, &offload);
+               dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, &offload);
        }
 }
 
@@ -458,14 +457,13 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
 
        offload.cls_u32 = &u32_offload;
 
+       tc_cls_common_offload_init(&u32_offload.common, tp);
        offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
        offload.cls_u32->hnode.divisor = h->divisor;
        offload.cls_u32->hnode.handle = h->handle;
        offload.cls_u32->hnode.prio = h->prio;
 
-       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, tp->q->handle,
-                                           tp->chain->index, tp->protocol,
-                                           &offload);
+       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, &offload);
        if (tc_skip_sw(flags))
                return err;
 
@@ -481,14 +479,13 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h)
        offload.cls_u32 = &u32_offload;
 
        if (tc_should_offload(dev, tp, 0)) {
+               tc_cls_common_offload_init(&u32_offload.common, tp);
                offload.cls_u32->command = TC_CLSU32_DELETE_HNODE;
                offload.cls_u32->hnode.divisor = h->divisor;
                offload.cls_u32->hnode.handle = h->handle;
                offload.cls_u32->hnode.prio = h->prio;
 
-               dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32,
-                                             tp->q->handle, tp->chain->index,
-                                             tp->protocol, &offload);
+               dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, &offload);
        }
 }
 
@@ -505,6 +502,7 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
        if (!tc_should_offload(dev, tp, flags))
                return tc_skip_sw(flags) ? -EINVAL : 0;
 
+       tc_cls_common_offload_init(&u32_offload.common, tp);
        offload.cls_u32->command = TC_CLSU32_REPLACE_KNODE;
        offload.cls_u32->knode.handle = n->handle;
        offload.cls_u32->knode.fshift = n->fshift;
@@ -520,9 +518,7 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
        if (n->ht_down)
                offload.cls_u32->knode.link_handle = n->ht_down->handle;
 
-       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, tp->q->handle,
-                                           tp->chain->index, tp->protocol,
-                                           &offload);
+       err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, &offload);
 
        if (!err)
                n->flags |= TCA_CLS_FLAGS_IN_HW;
index 329610ce4dfebea8e8a0236822ae405f90f713ef..09b577dde49c926dc7e78b8921c0ca58f6bb7391 100644 (file)
@@ -42,8 +42,7 @@ static void mqprio_destroy(struct Qdisc *sch)
                struct tc_mqprio_qopt offload = { 0 };
                struct tc_to_netdev tc = { { .mqprio = &offload } };
 
-               dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_MQPRIO,
-                                             sch->handle, 0, 0, &tc);
+               dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_MQPRIO, &tc);
        } else {
                netdev_set_num_tc(dev, 0);
        }
@@ -151,8 +150,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
                struct tc_mqprio_qopt offload = *qopt;
                struct tc_to_netdev tc = { { .mqprio = &offload } };
 
-               err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_MQPRIO,
-                                                   sch->handle, 0, 0, &tc);
+               err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_MQPRIO, &tc);
                if (err)
                        return err;