Lines Matching refs:spec
658 struct efx_filter_spec spec; in efx_ethtool_get_class_rule() local
662 rule->location, &spec); in efx_ethtool_get_class_rule()
666 if (spec.dmaq_id == EFX_FILTER_RX_DMAQ_ID_DROP) in efx_ethtool_get_class_rule()
669 rule->ring_cookie = spec.dmaq_id; in efx_ethtool_get_class_rule()
671 if ((spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) && in efx_ethtool_get_class_rule()
672 spec.ether_type == htons(ETH_P_IP) && in efx_ethtool_get_class_rule()
673 (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) && in efx_ethtool_get_class_rule()
674 (spec.ip_proto == IPPROTO_TCP || spec.ip_proto == IPPROTO_UDP) && in efx_ethtool_get_class_rule()
675 !(spec.match_flags & in efx_ethtool_get_class_rule()
680 rule->flow_type = ((spec.ip_proto == IPPROTO_TCP) ? in efx_ethtool_get_class_rule()
682 if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) { in efx_ethtool_get_class_rule()
683 ip_entry->ip4dst = spec.loc_host[0]; in efx_ethtool_get_class_rule()
686 if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) { in efx_ethtool_get_class_rule()
687 ip_entry->ip4src = spec.rem_host[0]; in efx_ethtool_get_class_rule()
690 if (spec.match_flags & EFX_FILTER_MATCH_LOC_PORT) { in efx_ethtool_get_class_rule()
691 ip_entry->pdst = spec.loc_port; in efx_ethtool_get_class_rule()
694 if (spec.match_flags & EFX_FILTER_MATCH_REM_PORT) { in efx_ethtool_get_class_rule()
695 ip_entry->psrc = spec.rem_port; in efx_ethtool_get_class_rule()
698 } else if ((spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) && in efx_ethtool_get_class_rule()
699 spec.ether_type == htons(ETH_P_IPV6) && in efx_ethtool_get_class_rule()
700 (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) && in efx_ethtool_get_class_rule()
701 (spec.ip_proto == IPPROTO_TCP || spec.ip_proto == IPPROTO_UDP) && in efx_ethtool_get_class_rule()
702 !(spec.match_flags & in efx_ethtool_get_class_rule()
707 rule->flow_type = ((spec.ip_proto == IPPROTO_TCP) ? in efx_ethtool_get_class_rule()
709 if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) { in efx_ethtool_get_class_rule()
710 memcpy(ip6_entry->ip6dst, spec.loc_host, in efx_ethtool_get_class_rule()
714 if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) { in efx_ethtool_get_class_rule()
715 memcpy(ip6_entry->ip6src, spec.rem_host, in efx_ethtool_get_class_rule()
719 if (spec.match_flags & EFX_FILTER_MATCH_LOC_PORT) { in efx_ethtool_get_class_rule()
720 ip6_entry->pdst = spec.loc_port; in efx_ethtool_get_class_rule()
723 if (spec.match_flags & EFX_FILTER_MATCH_REM_PORT) { in efx_ethtool_get_class_rule()
724 ip6_entry->psrc = spec.rem_port; in efx_ethtool_get_class_rule()
727 } else if (!(spec.match_flags & in efx_ethtool_get_class_rule()
732 if (spec.match_flags & in efx_ethtool_get_class_rule()
734 ether_addr_copy(mac_entry->h_dest, spec.loc_mac); in efx_ethtool_get_class_rule()
735 if (spec.match_flags & EFX_FILTER_MATCH_LOC_MAC) in efx_ethtool_get_class_rule()
741 if (spec.match_flags & EFX_FILTER_MATCH_REM_MAC) { in efx_ethtool_get_class_rule()
742 ether_addr_copy(mac_entry->h_source, spec.rem_mac); in efx_ethtool_get_class_rule()
745 if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) { in efx_ethtool_get_class_rule()
746 mac_entry->h_proto = spec.ether_type; in efx_ethtool_get_class_rule()
749 } else if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE && in efx_ethtool_get_class_rule()
750 spec.ether_type == htons(ETH_P_IP) && in efx_ethtool_get_class_rule()
751 !(spec.match_flags & in efx_ethtool_get_class_rule()
757 if (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) { in efx_ethtool_get_class_rule()
759 uip_entry->proto = spec.ip_proto; in efx_ethtool_get_class_rule()
761 if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) { in efx_ethtool_get_class_rule()
762 uip_entry->ip4dst = spec.loc_host[0]; in efx_ethtool_get_class_rule()
765 if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) { in efx_ethtool_get_class_rule()
766 uip_entry->ip4src = spec.rem_host[0]; in efx_ethtool_get_class_rule()
769 } else if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE && in efx_ethtool_get_class_rule()
770 spec.ether_type == htons(ETH_P_IPV6) && in efx_ethtool_get_class_rule()
771 !(spec.match_flags & in efx_ethtool_get_class_rule()
776 if (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) { in efx_ethtool_get_class_rule()
778 uip6_entry->l4_proto = spec.ip_proto; in efx_ethtool_get_class_rule()
780 if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) { in efx_ethtool_get_class_rule()
781 memcpy(uip6_entry->ip6dst, spec.loc_host, in efx_ethtool_get_class_rule()
785 if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) { in efx_ethtool_get_class_rule()
786 memcpy(uip6_entry->ip6src, spec.rem_host, in efx_ethtool_get_class_rule()
796 if (spec.match_flags & EFX_FILTER_MATCH_OUTER_VID) { in efx_ethtool_get_class_rule()
798 rule->h_ext.vlan_tci = spec.outer_vid; in efx_ethtool_get_class_rule()
802 if (spec.flags & EFX_FILTER_FLAG_RX_RSS) { in efx_ethtool_get_class_rule()
804 *rss_context = spec.rss_context; in efx_ethtool_get_class_rule()
933 struct efx_filter_spec spec; in efx_ethtool_set_class_rule() local
956 efx_filter_init_rx(&spec, EFX_FILTER_PRI_MANUAL, flags, in efx_ethtool_set_class_rule()
961 spec.rss_context = rss_context; in efx_ethtool_set_class_rule()
966 spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE | in efx_ethtool_set_class_rule()
968 spec.ether_type = htons(ETH_P_IP); in efx_ethtool_set_class_rule()
969 spec.ip_proto = flow_type == TCP_V4_FLOW ? IPPROTO_TCP in efx_ethtool_set_class_rule()
974 spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST; in efx_ethtool_set_class_rule()
975 spec.loc_host[0] = ip_entry->ip4dst; in efx_ethtool_set_class_rule()
980 spec.match_flags |= EFX_FILTER_MATCH_REM_HOST; in efx_ethtool_set_class_rule()
981 spec.rem_host[0] = ip_entry->ip4src; in efx_ethtool_set_class_rule()
986 spec.match_flags |= EFX_FILTER_MATCH_LOC_PORT; in efx_ethtool_set_class_rule()
987 spec.loc_port = ip_entry->pdst; in efx_ethtool_set_class_rule()
992 spec.match_flags |= EFX_FILTER_MATCH_REM_PORT; in efx_ethtool_set_class_rule()
993 spec.rem_port = ip_entry->psrc; in efx_ethtool_set_class_rule()
1001 spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE | in efx_ethtool_set_class_rule()
1003 spec.ether_type = htons(ETH_P_IPV6); in efx_ethtool_set_class_rule()
1004 spec.ip_proto = flow_type == TCP_V6_FLOW ? IPPROTO_TCP in efx_ethtool_set_class_rule()
1009 spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST; in efx_ethtool_set_class_rule()
1010 memcpy(spec.loc_host, ip6_entry->ip6dst, sizeof(spec.loc_host)); in efx_ethtool_set_class_rule()
1015 spec.match_flags |= EFX_FILTER_MATCH_REM_HOST; in efx_ethtool_set_class_rule()
1016 memcpy(spec.rem_host, ip6_entry->ip6src, sizeof(spec.rem_host)); in efx_ethtool_set_class_rule()
1021 spec.match_flags |= EFX_FILTER_MATCH_LOC_PORT; in efx_ethtool_set_class_rule()
1022 spec.loc_port = ip6_entry->pdst; in efx_ethtool_set_class_rule()
1027 spec.match_flags |= EFX_FILTER_MATCH_REM_PORT; in efx_ethtool_set_class_rule()
1028 spec.rem_port = ip6_entry->psrc; in efx_ethtool_set_class_rule()
1038 spec.match_flags = EFX_FILTER_MATCH_ETHER_TYPE; in efx_ethtool_set_class_rule()
1039 spec.ether_type = htons(ETH_P_IP); in efx_ethtool_set_class_rule()
1043 spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST; in efx_ethtool_set_class_rule()
1044 spec.loc_host[0] = uip_entry->ip4dst; in efx_ethtool_set_class_rule()
1049 spec.match_flags |= EFX_FILTER_MATCH_REM_HOST; in efx_ethtool_set_class_rule()
1050 spec.rem_host[0] = uip_entry->ip4src; in efx_ethtool_set_class_rule()
1055 spec.match_flags |= EFX_FILTER_MATCH_IP_PROTO; in efx_ethtool_set_class_rule()
1056 spec.ip_proto = uip_entry->proto; in efx_ethtool_set_class_rule()
1063 spec.match_flags = EFX_FILTER_MATCH_ETHER_TYPE; in efx_ethtool_set_class_rule()
1064 spec.ether_type = htons(ETH_P_IPV6); in efx_ethtool_set_class_rule()
1068 spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST; in efx_ethtool_set_class_rule()
1069 memcpy(spec.loc_host, uip6_entry->ip6dst, sizeof(spec.loc_host)); in efx_ethtool_set_class_rule()
1074 spec.match_flags |= EFX_FILTER_MATCH_REM_HOST; in efx_ethtool_set_class_rule()
1075 memcpy(spec.rem_host, uip6_entry->ip6src, sizeof(spec.rem_host)); in efx_ethtool_set_class_rule()
1080 spec.match_flags |= EFX_FILTER_MATCH_IP_PROTO; in efx_ethtool_set_class_rule()
1081 spec.ip_proto = uip6_entry->l4_proto; in efx_ethtool_set_class_rule()
1089 spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG; in efx_ethtool_set_class_rule()
1091 spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC; in efx_ethtool_set_class_rule()
1094 ether_addr_copy(spec.loc_mac, mac_entry->h_dest); in efx_ethtool_set_class_rule()
1099 spec.match_flags |= EFX_FILTER_MATCH_REM_MAC; in efx_ethtool_set_class_rule()
1100 ether_addr_copy(spec.rem_mac, mac_entry->h_source); in efx_ethtool_set_class_rule()
1105 spec.match_flags |= EFX_FILTER_MATCH_ETHER_TYPE; in efx_ethtool_set_class_rule()
1106 spec.ether_type = mac_entry->h_proto; in efx_ethtool_set_class_rule()
1117 spec.match_flags |= EFX_FILTER_MATCH_OUTER_VID; in efx_ethtool_set_class_rule()
1118 spec.outer_vid = rule->h_ext.vlan_tci; in efx_ethtool_set_class_rule()
1121 rc = efx_filter_insert_filter(efx, &spec, true); in efx_ethtool_set_class_rule()