Lines Matching refs:spec
638 * efx_filter_is_mc_recipient - test whether spec is a multicast recipient
639 * @spec: Specification to test
646 bool efx_filter_is_mc_recipient(const struct efx_filter_spec *spec)
648 if (!(spec->flags & EFX_FILTER_FLAG_RX) ||
649 spec->dmaq_id == EFX_FILTER_RX_DMAQ_ID_DROP)
652 if (spec->match_flags &
654 is_multicast_ether_addr(spec->loc_mac))
657 if ((spec->match_flags &
660 if (spec->ether_type == htons(ETH_P_IP) &&
661 ipv4_is_multicast(spec->loc_host[0]))
663 if (spec->ether_type == htons(ETH_P_IPV6) &&
664 ((const u8 *)spec->loc_host)[0] == 0xff)
684 u32 efx_filter_spec_hash(const struct efx_filter_spec *spec)
687 return jhash2((const u32 *)&spec->vport_id,
722 const struct efx_filter_spec *spec)
724 u32 hash = efx_filter_spec_hash(spec);
733 const struct efx_filter_spec *spec)
739 head = efx_rps_hash_bucket(efx, spec);
744 if (efx_filter_spec_equal(spec, &rule->spec))
751 const struct efx_filter_spec *spec,
758 head = efx_rps_hash_bucket(efx, spec);
763 if (efx_filter_spec_equal(spec, &rule->spec)) {
771 memcpy(&rule->spec, spec, sizeof(rule->spec));
777 void efx_rps_hash_del(struct efx_nic *efx, const struct efx_filter_spec *spec)
783 head = efx_rps_hash_bucket(efx, spec);
788 if (efx_filter_spec_equal(spec, &rule->spec)) {
885 rc = efx->type->filter_insert(efx, &req->spec, true);
891 rule = efx_rps_hash_find(efx, &req->spec);
893 * for the same spec was already worked and then expired before
917 if (req->spec.ether_type == htons(ETH_P_IP))
920 (req->spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
921 req->spec.rem_host, ntohs(req->spec.rem_port),
922 req->spec.loc_host, ntohs(req->spec.loc_port),
927 (req->spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
928 req->spec.rem_host, ntohs(req->spec.rem_port),
929 req->spec.loc_host, ntohs(req->spec.loc_port),
933 if (req->spec.ether_type == htons(ETH_P_IP))
936 (req->spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
937 req->spec.rem_host, ntohs(req->spec.rem_port),
938 req->spec.loc_host, ntohs(req->spec.loc_port),
943 (req->spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
944 req->spec.rem_host, ntohs(req->spec.rem_port),
945 req->spec.loc_host, ntohs(req->spec.loc_port),
998 efx_filter_init_rx(&req->spec, EFX_FILTER_PRI_HINT,
1001 req->spec.match_flags =
1005 req->spec.ether_type = fk.basic.n_proto;
1006 req->spec.ip_proto = fk.basic.ip_proto;
1009 req->spec.rem_host[0] = fk.addrs.v4addrs.src;
1010 req->spec.loc_host[0] = fk.addrs.v4addrs.dst;
1012 memcpy(req->spec.rem_host, &fk.addrs.v6addrs.src,
1014 memcpy(req->spec.loc_host, &fk.addrs.v6addrs.dst,
1018 req->spec.rem_port = fk.ports.src;
1019 req->spec.loc_port = fk.ports.dst;
1024 rule = efx_rps_hash_add(efx, &req->spec, &new);