Skip to content

Commit

Permalink
net: flow_offload: rename tc_cls_flower_offload to flow_cls_offload
Browse files Browse the repository at this point in the history
And any other existing fields in this structure that refer to tc.
Specifically:

* tc_cls_flower_offload_flow_rule() to flow_cls_offload_flow_rule().
* TC_CLSFLOWER_* to FLOW_CLS_*.
* tc_cls_common_offload to tc_cls_common_offload.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Jul 9, 2019
1 parent 0d4fd02 commit f9e3008
Show file tree
Hide file tree
Showing 32 changed files with 254 additions and 254 deletions.
18 changes: 9 additions & 9 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ static int bnxt_tc_parse_actions(struct bnxt *bp,
}

static int bnxt_tc_parse_flow(struct bnxt *bp,
struct tc_cls_flower_offload *tc_flow_cmd,
struct flow_cls_offload *tc_flow_cmd,
struct bnxt_tc_flow *flow)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(tc_flow_cmd);
struct flow_rule *rule = flow_cls_offload_flow_rule(tc_flow_cmd);
struct flow_dissector *dissector = rule->match.dissector;

/* KEY_CONTROL and KEY_BASIC are needed for forming a meaningful key */
Expand Down Expand Up @@ -1262,7 +1262,7 @@ static void bnxt_tc_set_src_fid(struct bnxt *bp, struct bnxt_tc_flow *flow,
* The hash-tables are already protected by the rhashtable API.
*/
static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid,
struct tc_cls_flower_offload *tc_flow_cmd)
struct flow_cls_offload *tc_flow_cmd)
{
struct bnxt_tc_flow_node *new_node, *old_node;
struct bnxt_tc_info *tc_info = bp->tc_info;
Expand Down Expand Up @@ -1348,7 +1348,7 @@ static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid,
}

static int bnxt_tc_del_flow(struct bnxt *bp,
struct tc_cls_flower_offload *tc_flow_cmd)
struct flow_cls_offload *tc_flow_cmd)
{
struct bnxt_tc_info *tc_info = bp->tc_info;
struct bnxt_tc_flow_node *flow_node;
Expand All @@ -1363,7 +1363,7 @@ static int bnxt_tc_del_flow(struct bnxt *bp,
}

static int bnxt_tc_get_flow_stats(struct bnxt *bp,
struct tc_cls_flower_offload *tc_flow_cmd)
struct flow_cls_offload *tc_flow_cmd)
{
struct bnxt_tc_flow_stats stats, *curr_stats, *prev_stats;
struct bnxt_tc_info *tc_info = bp->tc_info;
Expand Down Expand Up @@ -1585,14 +1585,14 @@ void bnxt_tc_flow_stats_work(struct bnxt *bp)
}

int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE:
case FLOW_CLS_REPLACE:
return bnxt_tc_add_flow(bp, src_fid, cls_flower);
case TC_CLSFLOWER_DESTROY:
case FLOW_CLS_DESTROY:
return bnxt_tc_del_flow(bp, cls_flower);
case TC_CLSFLOWER_STATS:
case FLOW_CLS_STATS:
return bnxt_tc_get_flow_stats(bp, cls_flower);
default:
return -EOPNOTSUPP;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ struct bnxt_tc_flow_node {
};

int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
struct tc_cls_flower_offload *cls_flower);
struct flow_cls_offload *cls_flower);
int bnxt_init_tc(struct bnxt *bp);
void bnxt_shutdown_tc(struct bnxt *bp);
void bnxt_tc_flow_stats_work(struct bnxt *bp);
Expand All @@ -209,7 +209,7 @@ static inline bool bnxt_tc_flower_enabled(struct bnxt *bp)
#else /* CONFIG_BNXT_FLOWER_OFFLOAD */

static inline int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
return -EOPNOTSUPP;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3135,14 +3135,14 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
}

static int cxgb_setup_tc_flower(struct net_device *dev,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE:
case FLOW_CLS_REPLACE:
return cxgb4_tc_flower_replace(dev, cls_flower);
case TC_CLSFLOWER_DESTROY:
case FLOW_CLS_DESTROY:
return cxgb4_tc_flower_destroy(dev, cls_flower);
case TC_CLSFLOWER_STATS:
case FLOW_CLS_STATS:
return cxgb4_tc_flower_stats(dev, cls_flower);
default:
return -EOPNOTSUPP;
Expand Down
22 changes: 11 additions & 11 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ static struct ch_tc_flower_entry *ch_flower_lookup(struct adapter *adap,
}

static void cxgb4_process_flow_match(struct net_device *dev,
struct tc_cls_flower_offload *cls,
struct flow_cls_offload *cls,
struct ch_filter_specification *fs)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(cls);
struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
u16 addr_type = 0;

if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CONTROL)) {
Expand Down Expand Up @@ -223,9 +223,9 @@ static void cxgb4_process_flow_match(struct net_device *dev,
}

static int cxgb4_validate_flow_match(struct net_device *dev,
struct tc_cls_flower_offload *cls)
struct flow_cls_offload *cls)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(cls);
struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
struct flow_dissector *dissector = rule->match.dissector;
u16 ethtype_mask = 0;
u16 ethtype_key = 0;
Expand Down Expand Up @@ -378,10 +378,10 @@ static void process_pedit_field(struct ch_filter_specification *fs, u32 val,
}

static void cxgb4_process_flow_actions(struct net_device *in,
struct tc_cls_flower_offload *cls,
struct flow_cls_offload *cls,
struct ch_filter_specification *fs)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(cls);
struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
struct flow_action_entry *act;
int i;

Expand Down Expand Up @@ -544,9 +544,9 @@ static bool valid_pedit_action(struct net_device *dev,
}

static int cxgb4_validate_flow_actions(struct net_device *dev,
struct tc_cls_flower_offload *cls)
struct flow_cls_offload *cls)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(cls);
struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
struct flow_action_entry *act;
bool act_redir = false;
bool act_pedit = false;
Expand Down Expand Up @@ -633,7 +633,7 @@ static int cxgb4_validate_flow_actions(struct net_device *dev,
}

int cxgb4_tc_flower_replace(struct net_device *dev,
struct tc_cls_flower_offload *cls)
struct flow_cls_offload *cls)
{
struct adapter *adap = netdev2adap(dev);
struct ch_tc_flower_entry *ch_flower;
Expand Down Expand Up @@ -709,7 +709,7 @@ int cxgb4_tc_flower_replace(struct net_device *dev,
}

int cxgb4_tc_flower_destroy(struct net_device *dev,
struct tc_cls_flower_offload *cls)
struct flow_cls_offload *cls)
{
struct adapter *adap = netdev2adap(dev);
struct ch_tc_flower_entry *ch_flower;
Expand Down Expand Up @@ -783,7 +783,7 @@ static void ch_flower_stats_cb(struct timer_list *t)
}

int cxgb4_tc_flower_stats(struct net_device *dev,
struct tc_cls_flower_offload *cls)
struct flow_cls_offload *cls)
{
struct adapter *adap = netdev2adap(dev);
struct ch_tc_flower_stats *ofld_stats;
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ struct ch_tc_pedit_fields {
#define PEDIT_UDP_SPORT_DPORT 0x0

int cxgb4_tc_flower_replace(struct net_device *dev,
struct tc_cls_flower_offload *cls);
struct flow_cls_offload *cls);
int cxgb4_tc_flower_destroy(struct net_device *dev,
struct tc_cls_flower_offload *cls);
struct flow_cls_offload *cls);
int cxgb4_tc_flower_stats(struct net_device *dev,
struct tc_cls_flower_offload *cls);
struct flow_cls_offload *cls);

int cxgb4_init_tc_flower(struct adapter *adap);
void cxgb4_cleanup_tc_flower(struct adapter *adap);
Expand Down
22 changes: 11 additions & 11 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7759,15 +7759,15 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
/**
* i40e_parse_cls_flower - Parse tc flower filters provided by kernel
* @vsi: Pointer to VSI
* @cls_flower: Pointer to struct tc_cls_flower_offload
* @cls_flower: Pointer to struct flow_cls_offload
* @filter: Pointer to cloud filter structure
*
**/
static int i40e_parse_cls_flower(struct i40e_vsi *vsi,
struct tc_cls_flower_offload *f,
struct flow_cls_offload *f,
struct i40e_cloud_filter *filter)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(f);
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
struct flow_dissector *dissector = rule->match.dissector;
u16 n_proto_mask = 0, n_proto_key = 0, addr_type = 0;
struct i40e_pf *pf = vsi->back;
Expand Down Expand Up @@ -8001,11 +8001,11 @@ static int i40e_handle_tclass(struct i40e_vsi *vsi, u32 tc,
/**
* i40e_configure_clsflower - Configure tc flower filters
* @vsi: Pointer to VSI
* @cls_flower: Pointer to struct tc_cls_flower_offload
* @cls_flower: Pointer to struct flow_cls_offload
*
**/
static int i40e_configure_clsflower(struct i40e_vsi *vsi,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
int tc = tc_classid_to_hwtc(vsi->netdev, cls_flower->classid);
struct i40e_cloud_filter *filter = NULL;
Expand Down Expand Up @@ -8097,11 +8097,11 @@ static struct i40e_cloud_filter *i40e_find_cloud_filter(struct i40e_vsi *vsi,
/**
* i40e_delete_clsflower - Remove tc flower filters
* @vsi: Pointer to VSI
* @cls_flower: Pointer to struct tc_cls_flower_offload
* @cls_flower: Pointer to struct flow_cls_offload
*
**/
static int i40e_delete_clsflower(struct i40e_vsi *vsi,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
struct i40e_cloud_filter *filter = NULL;
struct i40e_pf *pf = vsi->back;
Expand Down Expand Up @@ -8144,16 +8144,16 @@ static int i40e_delete_clsflower(struct i40e_vsi *vsi,
* @type_data: offload data
**/
static int i40e_setup_tc_cls_flower(struct i40e_netdev_priv *np,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
struct i40e_vsi *vsi = np->vsi;

switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE:
case FLOW_CLS_REPLACE:
return i40e_configure_clsflower(vsi, cls_flower);
case TC_CLSFLOWER_DESTROY:
case FLOW_CLS_DESTROY:
return i40e_delete_clsflower(vsi, cls_flower);
case TC_CLSFLOWER_STATS:
case FLOW_CLS_STATS:
return -EOPNOTSUPP;
default:
return -EOPNOTSUPP;
Expand Down
22 changes: 11 additions & 11 deletions drivers/net/ethernet/intel/iavf/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2699,14 +2699,14 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)
/**
* iavf_parse_cls_flower - Parse tc flower filters provided by kernel
* @adapter: board private structure
* @cls_flower: pointer to struct tc_cls_flower_offload
* @cls_flower: pointer to struct flow_cls_offload
* @filter: pointer to cloud filter structure
*/
static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
struct tc_cls_flower_offload *f,
struct flow_cls_offload *f,
struct iavf_cloud_filter *filter)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(f);
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
struct flow_dissector *dissector = rule->match.dissector;
u16 n_proto_mask = 0;
u16 n_proto_key = 0;
Expand Down Expand Up @@ -2971,10 +2971,10 @@ static int iavf_handle_tclass(struct iavf_adapter *adapter, u32 tc,
/**
* iavf_configure_clsflower - Add tc flower filters
* @adapter: board private structure
* @cls_flower: Pointer to struct tc_cls_flower_offload
* @cls_flower: Pointer to struct flow_cls_offload
*/
static int iavf_configure_clsflower(struct iavf_adapter *adapter,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
int tc = tc_classid_to_hwtc(adapter->netdev, cls_flower->classid);
struct iavf_cloud_filter *filter = NULL;
Expand Down Expand Up @@ -3050,10 +3050,10 @@ static struct iavf_cloud_filter *iavf_find_cf(struct iavf_adapter *adapter,
/**
* iavf_delete_clsflower - Remove tc flower filters
* @adapter: board private structure
* @cls_flower: Pointer to struct tc_cls_flower_offload
* @cls_flower: Pointer to struct flow_cls_offload
*/
static int iavf_delete_clsflower(struct iavf_adapter *adapter,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
struct iavf_cloud_filter *filter = NULL;
int err = 0;
Expand All @@ -3077,17 +3077,17 @@ static int iavf_delete_clsflower(struct iavf_adapter *adapter,
* @type_data: offload data
*/
static int iavf_setup_tc_cls_flower(struct iavf_adapter *adapter,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
if (cls_flower->common.chain_index)
return -EOPNOTSUPP;

switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE:
case FLOW_CLS_REPLACE:
return iavf_configure_clsflower(adapter, cls_flower);
case TC_CLSFLOWER_DESTROY:
case FLOW_CLS_DESTROY:
return iavf_delete_clsflower(adapter, cls_flower);
case TC_CLSFLOWER_STATS:
case FLOW_CLS_STATS:
return -EOPNOTSUPP;
default:
return -EOPNOTSUPP;
Expand Down
16 changes: 8 additions & 8 deletions drivers/net/ethernet/intel/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2578,11 +2578,11 @@ static int igb_offload_cbs(struct igb_adapter *adapter,
#define VLAN_PRIO_FULL_MASK (0x07)

static int igb_parse_cls_flower(struct igb_adapter *adapter,
struct tc_cls_flower_offload *f,
struct flow_cls_offload *f,
int traffic_class,
struct igb_nfc_filter *input)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(f);
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
struct flow_dissector *dissector = rule->match.dissector;
struct netlink_ext_ack *extack = f->common.extack;

Expand Down Expand Up @@ -2660,7 +2660,7 @@ static int igb_parse_cls_flower(struct igb_adapter *adapter,
}

static int igb_configure_clsflower(struct igb_adapter *adapter,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
struct netlink_ext_ack *extack = cls_flower->common.extack;
struct igb_nfc_filter *filter, *f;
Expand Down Expand Up @@ -2722,7 +2722,7 @@ static int igb_configure_clsflower(struct igb_adapter *adapter,
}

static int igb_delete_clsflower(struct igb_adapter *adapter,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
struct igb_nfc_filter *filter;
int err;
Expand Down Expand Up @@ -2752,14 +2752,14 @@ static int igb_delete_clsflower(struct igb_adapter *adapter,
}

static int igb_setup_tc_cls_flower(struct igb_adapter *adapter,
struct tc_cls_flower_offload *cls_flower)
struct flow_cls_offload *cls_flower)
{
switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE:
case FLOW_CLS_REPLACE:
return igb_configure_clsflower(adapter, cls_flower);
case TC_CLSFLOWER_DESTROY:
case FLOW_CLS_DESTROY:
return igb_delete_clsflower(adapter, cls_flower);
case TC_CLSFLOWER_STATS:
case FLOW_CLS_STATS:
return -EOPNOTSUPP;
default:
return -EOPNOTSUPP;
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ int mlx5e_tc_tun_init_encap_attr(struct net_device *tunnel_dev,
int mlx5e_tc_tun_parse(struct net_device *filter_dev,
struct mlx5e_priv *priv,
struct mlx5_flow_spec *spec,
struct tc_cls_flower_offload *f,
struct flow_cls_offload *f,
void *headers_c,
void *headers_v, u8 *match_level)
{
Expand Down Expand Up @@ -489,11 +489,11 @@ int mlx5e_tc_tun_parse(struct net_device *filter_dev,

int mlx5e_tc_tun_parse_udp_ports(struct mlx5e_priv *priv,
struct mlx5_flow_spec *spec,
struct tc_cls_flower_offload *f,
struct flow_cls_offload *f,
void *headers_c,
void *headers_v)
{
struct flow_rule *rule = tc_cls_flower_offload_flow_rule(f);
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
struct netlink_ext_ack *extack = f->common.extack;
struct flow_match_ports enc_ports;

Expand Down
Loading

0 comments on commit f9e3008

Please sign in to comment.