Lines Matching refs:fs

82 						  struct ethtool_rx_flow_spec *fs,  in get_flow_table()  argument
85 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(priv->fs); in get_flow_table()
94 switch (flow_type_mask(fs->flow_type)) { in get_flow_table()
233 parse_tcp4(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs) in parse_tcp4() argument
235 struct ethtool_tcpip4_spec *l4_mask = &fs->m_u.tcp_ip4_spec; in parse_tcp4()
236 struct ethtool_tcpip4_spec *l4_val = &fs->h_u.tcp_ip4_spec; in parse_tcp4()
246 parse_udp4(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs) in parse_udp4() argument
248 struct ethtool_tcpip4_spec *l4_mask = &fs->m_u.udp_ip4_spec; in parse_udp4()
249 struct ethtool_tcpip4_spec *l4_val = &fs->h_u.udp_ip4_spec; in parse_udp4()
259 parse_ip4(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs) in parse_ip4() argument
261 struct ethtool_usrip4_spec *l3_mask = &fs->m_u.usr_ip4_spec; in parse_ip4()
262 struct ethtool_usrip4_spec *l3_val = &fs->h_u.usr_ip4_spec; in parse_ip4()
274 parse_ip6(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs) in parse_ip6() argument
276 struct ethtool_usrip6_spec *l3_mask = &fs->m_u.usr_ip6_spec; in parse_ip6()
277 struct ethtool_usrip6_spec *l3_val = &fs->h_u.usr_ip6_spec; in parse_ip6()
289 parse_tcp6(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs) in parse_tcp6() argument
291 struct ethtool_tcpip6_spec *l4_mask = &fs->m_u.tcp_ip6_spec; in parse_tcp6()
292 struct ethtool_tcpip6_spec *l4_val = &fs->h_u.tcp_ip6_spec; in parse_tcp6()
302 parse_udp6(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs) in parse_udp6() argument
304 struct ethtool_tcpip6_spec *l4_mask = &fs->m_u.udp_ip6_spec; in parse_udp6()
305 struct ethtool_tcpip6_spec *l4_val = &fs->h_u.udp_ip6_spec; in parse_udp6()
315 parse_ether(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs) in parse_ether() argument
317 struct ethhdr *eth_mask = &fs->m_u.ether_spec; in parse_ether()
318 struct ethhdr *eth_val = &fs->h_u.ether_spec; in parse_ether()
347 struct ethtool_rx_flow_spec *fs) in set_flow_attrs() argument
353 u32 flow_type = flow_type_mask(fs->flow_type); in set_flow_attrs()
357 parse_tcp4(outer_headers_c, outer_headers_v, fs); in set_flow_attrs()
360 parse_udp4(outer_headers_c, outer_headers_v, fs); in set_flow_attrs()
363 parse_ip4(outer_headers_c, outer_headers_v, fs); in set_flow_attrs()
366 parse_tcp6(outer_headers_c, outer_headers_v, fs); in set_flow_attrs()
369 parse_udp6(outer_headers_c, outer_headers_v, fs); in set_flow_attrs()
372 parse_ip6(outer_headers_c, outer_headers_v, fs); in set_flow_attrs()
375 parse_ether(outer_headers_c, outer_headers_v, fs); in set_flow_attrs()
381 if ((fs->flow_type & FLOW_EXT) && in set_flow_attrs()
382 (fs->m_ext.vlan_tci & cpu_to_be16(VLAN_VID_MASK))) in set_flow_attrs()
383 set_cvlan(outer_headers_c, outer_headers_v, fs->h_ext.vlan_tci); in set_flow_attrs()
385 if (fs->flow_type & FLOW_MAC_EXT && in set_flow_attrs()
386 !is_zero_ether_addr(fs->m_ext.h_dest)) { in set_flow_attrs()
387 mask_spec(fs->m_ext.h_dest, fs->h_ext.h_dest, ETH_ALEN); in set_flow_attrs()
388 set_dmac(outer_headers_c, outer_headers_v, fs->m_ext.h_dest, in set_flow_attrs()
389 fs->h_ext.h_dest); in set_flow_attrs()
398 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(priv->fs); in add_rule_to_list()
424 struct ethtool_rx_flow_spec *fs, in flow_get_tirn() argument
427 if (fs->flow_type & FLOW_RSS) { in flow_get_tirn()
438 flow_type = flow_type_mask(fs->flow_type); in flow_get_tirn()
450 *tirn = mlx5e_rx_res_get_tirn_direct(priv->rx_res, fs->ring_cookie); in flow_get_tirn()
460 struct ethtool_rx_flow_spec *fs, u32 rss_context) in add_ethtool_flow_rule() argument
472 fs); in add_ethtool_flow_rule()
476 if (fs->ring_cookie == RX_CLS_FLOW_DISC) { in add_ethtool_flow_rule()
485 err = flow_get_tirn(priv, eth_rule, fs, rss_context, &dst->tir_num); in add_ethtool_flow_rule()
508 static void del_ethtool_rule(struct mlx5e_flow_steering *fs, in del_ethtool_rule() argument
511 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(fs); in del_ethtool_rule()
525 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(priv->fs); in find_ethtool_rule()
542 del_ethtool_rule(priv->fs, eth_rule); in get_ethtool_rule()
558 static int validate_ethter(struct ethtool_rx_flow_spec *fs) in validate_ethter() argument
560 struct ethhdr *eth_mask = &fs->m_u.ether_spec; in validate_ethter()
572 static int validate_tcpudp4(struct ethtool_rx_flow_spec *fs) in validate_tcpudp4() argument
574 struct ethtool_tcpip4_spec *l4_mask = &fs->m_u.tcp_ip4_spec; in validate_tcpudp4()
592 static int validate_ip4(struct ethtool_rx_flow_spec *fs) in validate_ip4() argument
594 struct ethtool_usrip4_spec *l3_mask = &fs->m_u.usr_ip4_spec; in validate_ip4()
598 fs->h_u.usr_ip4_spec.ip_ver != ETH_RX_NFC_IP4) in validate_ip4()
610 static int validate_ip6(struct ethtool_rx_flow_spec *fs) in validate_ip6() argument
612 struct ethtool_usrip6_spec *l3_mask = &fs->m_u.usr_ip6_spec; in validate_ip6()
628 static int validate_tcpudp6(struct ethtool_rx_flow_spec *fs) in validate_tcpudp6() argument
630 struct ethtool_tcpip6_spec *l4_mask = &fs->m_u.tcp_ip6_spec; in validate_tcpudp6()
650 static int validate_vlan(struct ethtool_rx_flow_spec *fs) in validate_vlan() argument
652 if (fs->m_ext.vlan_etype || in validate_vlan()
653 fs->m_ext.vlan_tci != cpu_to_be16(VLAN_VID_MASK)) in validate_vlan()
656 if (fs->m_ext.vlan_tci && in validate_vlan()
657 (be16_to_cpu(fs->h_ext.vlan_tci) >= VLAN_N_VID)) in validate_vlan()
664 struct ethtool_rx_flow_spec *fs) in validate_flow() argument
669 if (fs->location >= MAX_NUM_OF_ETHTOOL_RULES) in validate_flow()
672 if (fs->ring_cookie != RX_CLS_FLOW_DISC) in validate_flow()
673 if (fs->ring_cookie >= priv->channels.params.num_channels) in validate_flow()
676 switch (flow_type_mask(fs->flow_type)) { in validate_flow()
678 num_tuples += validate_ethter(fs); in validate_flow()
682 ret = validate_tcpudp4(fs); in validate_flow()
688 ret = validate_ip4(fs); in validate_flow()
695 ret = validate_tcpudp6(fs); in validate_flow()
701 ret = validate_ip6(fs); in validate_flow()
709 if ((fs->flow_type & FLOW_EXT)) { in validate_flow()
710 ret = validate_vlan(fs); in validate_flow()
716 if (fs->flow_type & FLOW_MAC_EXT && in validate_flow()
717 !is_zero_ether_addr(fs->m_ext.h_dest)) in validate_flow()
725 struct ethtool_rx_flow_spec *fs, u32 rss_context) in mlx5e_ethtool_flow_replace() argument
733 num_tuples = validate_flow(priv, fs); in mlx5e_ethtool_flow_replace()
740 eth_ft = get_flow_table(priv, fs, num_tuples); in mlx5e_ethtool_flow_replace()
744 eth_rule = get_ethtool_rule(priv, fs->location); in mlx5e_ethtool_flow_replace()
750 eth_rule->flow_spec = *fs; in mlx5e_ethtool_flow_replace()
753 rule = add_ethtool_flow_rule(priv, eth_rule, eth_ft->ft, fs, rss_context); in mlx5e_ethtool_flow_replace()
764 del_ethtool_rule(priv->fs, eth_rule); in mlx5e_ethtool_flow_replace()
784 del_ethtool_rule(priv->fs, eth_rule); in mlx5e_ethtool_flow_remove()
793 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(priv->fs); in mlx5e_ethtool_get_flow()
806 info->fs = eth_rule->flow_spec; in mlx5e_ethtool_get_flow()
850 void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs) in mlx5e_ethtool_cleanup_steering() argument
852 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(fs); in mlx5e_ethtool_cleanup_steering()
857 del_ethtool_rule(fs, iter); in mlx5e_ethtool_cleanup_steering()
860 void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs) in mlx5e_ethtool_init_steering() argument
862 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(fs); in mlx5e_ethtool_init_steering()
982 err = mlx5e_ethtool_flow_replace(priv, &cmd->fs, cmd->rss_context); in mlx5e_ethtool_set_rxnfc()
985 err = mlx5e_ethtool_flow_remove(priv, cmd->fs.location); in mlx5e_ethtool_set_rxnfc()
1001 struct mlx5e_ethtool_steering *ethtool = mlx5e_fs_get_ethtool(priv->fs); in mlx5e_ethtool_get_rxnfc()
1009 err = mlx5e_ethtool_get_flow(priv, info, info->fs.location); in mlx5e_ethtool_get_rxnfc()