Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_gre.c
Show First 20 Lines • Show All 637 Lines • ▼ Show 20 Lines | gre_setseqn(struct grehdr *gh, uint32_t seq) | ||||
if (flags & GRE_FLAGS_KP) | if (flags & GRE_FLAGS_KP) | ||||
opts++; | opts++; | ||||
*opts = htonl(seq); | *opts = htonl(seq); | ||||
} | } | ||||
static uint32_t | static uint32_t | ||||
gre_flowid(struct gre_softc *sc, struct mbuf *m, uint32_t af) | gre_flowid(struct gre_softc *sc, struct mbuf *m, uint32_t af) | ||||
{ | { | ||||
uint32_t flowid; | uint32_t flowid = 0; | ||||
if ((sc->gre_options & GRE_UDPENCAP) == 0 || sc->gre_port != 0) | if ((sc->gre_options & GRE_UDPENCAP) == 0 || sc->gre_port != 0) | ||||
return (0); | return (flowid); | ||||
#ifndef RSS | |||||
switch (af) { | switch (af) { | ||||
#ifdef INET | #ifdef INET | ||||
case AF_INET: | case AF_INET: | ||||
#ifdef RSS | |||||
flowid = rss_hash_ip4_2tuple(mtod(m, struct ip *)->ip_src, | |||||
mtod(m, struct ip *)->ip_dst); | |||||
break; | |||||
#endif | |||||
flowid = mtod(m, struct ip *)->ip_src.s_addr ^ | flowid = mtod(m, struct ip *)->ip_src.s_addr ^ | ||||
melifaro: this one always wins | |||||
Done Inline Actionsno, RSS inserts an early break statement above franco_opnsense.org: no, RSS inserts an early break statement above | |||||
mtod(m, struct ip *)->ip_dst.s_addr; | mtod(m, struct ip *)->ip_dst.s_addr; | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef INET6 | #ifdef INET6 | ||||
case AF_INET6: | case AF_INET6: | ||||
flowid = mtod(m, struct ip6_hdr *)->ip6_src.s6_addr32[3] ^ | #ifdef RSS | ||||
mtod(m, struct ip6_hdr *)->ip6_dst.s6_addr32[3]; | |||||
break; | |||||
#endif | |||||
default: | |||||
flowid = 0; | |||||
} | |||||
#else /* RSS */ | |||||
switch (af) { | |||||
#ifdef INET | |||||
case AF_INET: | |||||
flowid = rss_hash_ip4_2tuple(mtod(m, struct ip *)->ip_src, | |||||
mtod(m, struct ip *)->ip_dst); | |||||
break; | |||||
#endif | |||||
#ifdef INET6 | |||||
case AF_INET6: | |||||
flowid = rss_hash_ip6_2tuple( | flowid = rss_hash_ip6_2tuple( | ||||
&mtod(m, struct ip6_hdr *)->ip6_src, | &mtod(m, struct ip6_hdr *)->ip6_src, | ||||
&mtod(m, struct ip6_hdr *)->ip6_dst); | &mtod(m, struct ip6_hdr *)->ip6_dst); | ||||
break; | break; | ||||
#endif | #endif | ||||
flowid = mtod(m, struct ip6_hdr *)->ip6_src.s6_addr32[3] ^ | |||||
mtod(m, struct ip6_hdr *)->ip6_dst.s6_addr32[3]; | |||||
break; | |||||
#endif | |||||
default: | default: | ||||
flowid = 0; | break; | ||||
} | } | ||||
#endif | |||||
return (flowid); | return (flowid); | ||||
} | } | ||||
#define MTAG_GRE 1307983903 | #define MTAG_GRE 1307983903 | ||||
static int | static int | ||||
gre_transmit(struct ifnet *ifp, struct mbuf *m) | gre_transmit(struct ifnet *ifp, struct mbuf *m) | ||||
{ | { | ||||
GRE_RLOCK_TRACKER; | GRE_RLOCK_TRACKER; | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |
this one always wins