Lines Matching defs:fs

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