| 992 | } |
| 993 | |
| 994 | static struct ifnet * |
| 995 | rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) |
| 996 | { |
| 997 | struct ifnet *tifp; |
| 998 | struct m_snd_tag *tag; |
| 999 | union if_snd_tag_alloc_params params = { |
| 1000 | .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, |
| 1001 | .rate_limit.hdr.flowid = 1, |
| 1002 | .rate_limit.hdr.numa_domain = inp->inp_numa_domain, |
| 1003 | .rate_limit.max_rate = COMMON_RATE, |
| 1004 | .rate_limit.flags = M_NOWAIT, |
| 1005 | }; |
| 1006 | int err; |
| 1007 | #ifdef RSS |
| 1008 | params.rate_limit.hdr.flowtype = ((inp->inp_vflag & INP_IPV6) ? |
| 1009 | M_HASHTYPE_RSS_TCP_IPV6 : M_HASHTYPE_RSS_TCP_IPV4); |
| 1010 | #else |
| 1011 | params.rate_limit.hdr.flowtype = M_HASHTYPE_OPAQUE_HASH; |
| 1012 | #endif |
| 1013 | err = m_snd_tag_alloc(ifp, ¶ms, &tag); |
| 1014 | if (err) { |
| 1015 | /* Failed to setup a tag? */ |
| 1016 | if (error) |
| 1017 | *error = err; |
| 1018 | return (NULL); |
| 1019 | } |
| 1020 | tifp = tag->ifp; |
| 1021 | m_snd_tag_rele(tag); |
| 1022 | return (tifp); |
| 1023 | } |
| 1024 | |
| 1025 | static const struct tcp_hwrate_limit_table * |
| 1026 | rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t bytes_per_sec, |
no test coverage detected