summaryrefslogtreecommitdiff
path: root/sys/net/if_gre.c
AgeCommit message (Collapse)Author
2019-04-23give gre and mgre percpu counters tooDavid Gwynne
makes input bytes and packets consistent
2019-04-23a first cut at converting some virtual ethernet interfaces to if_vinputDavid Gwynne
this let's input processing bypass ifiqs. there's a performance benefit from this, and it will let me tweak the backpressure detection mechanism that ifiqs use without impacting on a stack of virtual interfaces. ive tested all of these except mpw, which i will end up testing soon anyway.
2019-04-22support rxprioDavid Gwynne
i need to come back to this and make it flow a bit better, but this is a good start.
2019-04-19use the common code in if.c to check if txhprio is good.David Gwynne
no functional change.
2019-04-15Use timeout_del_barrier(9) instead of timeout_del(9) followed byVisa Hankala
conditional timeout_barrier(9). OK kn@ dlg@
2019-01-04make kernel build without MPLS/mpe/mpwSebastian Benoit
ok claudio@ dlg@
2019-01-04make kernel build without INET6 again.Sebastian Benoit
ok dlg@
2018-12-17Handle SIOCADDMULTI and SIOCDELMULTI as nops in ioctl code.David Gwynne
There's nothing underneath the tunnels that needs configuration, so there's no point in keepign track of configured multicast addresses. We will at least save a bit of memory.
2018-12-17If something like ether_ioctl returns ENETRESET, don't let it bubble out.David Gwynne
ENETRESET in hardware drivers means you should reprogram the hardware. There's no hardware to reprogram, so just turn it into 0 on the way out.
2018-12-03Convert more MH_ALIGN() to m_align(). Also switch from m_gethdr/M_GETHDRClaudio Jeker
calls to m_get/M_GET calls because M_MOVE_PKTHDR() is initialising the pkthdr and so it is not needed when allocation the header. OK bluhm@
2018-11-29allow configuration of ecn processingDavid Gwynne
this is a step toward better rfc6040 support ok claudio@
2018-11-15the variable holding the ip tos should be called tos, not ttl.David Gwynne
no functional change.
2018-11-14use the txprio setting to populate the tos in keepalive packets.David Gwynne
the mbuf prio will still be set according to the llprio value, but the tos on the packet may be forced to a specific number by txprio
2018-11-14according to ip_ipip.c, rfc1853 says not to copy the ttl on decapsulationDavid Gwynne
rfc1853 is about IP in IP Tunneling. rfc2003 about IP Encapsulation within IP agrees.
2018-11-13add txprio support to gre, mgre, egre, nvgre, and eoipDavid Gwynne
for l3 interfaces (gre and mgre), allow txprio from the payload, the mbuf, or a hardcoded value. for l2 interfaces (egre, ngre, and eoip), get txprio from the mbuf or a hardcoded value. ok claudio@
2018-11-12set the hardmtu on ether encap ifs so the mtu can be raised above 1500David Gwynne
2018-11-11when encapsulating mpls, map the mpls qos value to an ip tos.David Gwynne
2018-11-11actually use the if_llprio to set the mbuf prio.David Gwynne
the llprio is already used to set the gre and eoip packet tos/tclass, but it was queued at the default prio before this.
2018-11-11use the llprio on gre(4) and eoip(4) interfaces for the keepalive tosDavid Gwynne
llprios are valued 0 to 7, while the ip tos/dscp/tclass is an 8 bit value. fortunately the high 3 bits map nicely to the llprio values, so we shift the llprio into place when generating the keepalive frames. the llprio is defaulted to the value that cisco uses for their gre keepalives.
2018-10-25start both the sc_ka_send and sc_ka_hold timeout whenDavid Gwynne
the timeout gets configured instead of gre_up(). this avoids complex gre_ioctl() ordering rules and enables the sc_ka_hold timeout before the first packet is received. from markus@
2018-10-18provide a default case for all switch statements handling address familiesDavid Gwynne
from markus@
2018-10-18make sure keepalive ioctl values are either both zero, or both not zero.David Gwynne
2018-10-18make sure the tunnel is configured in gre_keepalive_sendDavid Gwynne
check sc_tunnel.t_af for AF_UNSPEC, otherwise we panic in gre_encap() from markus@
2018-10-18move the timeout_add in gre_keepalive_send up.David Gwynne
gre_keepalive_send() should re-schedule immediately, otherwise we stop sending keepalive on temporary mbuf shortage or if the configuration is incomplete. from markus@
2018-10-18Process incoming gre(4) keepalives early to avoid bpf seeing them.David Gwynne
The packet processing done after the protocol detection effectively gets thrown away by the keepalive handling, so this saves some time, and avoids confusing tcpdump on the interface. Keepalives the driver transmits aren't made available for bpf, so taking it away from the receive side is consistent. discussed with and tested by markus@
2018-10-16pull and put the traffic class in ipv6 headersDavid Gwynne
this gives ipv6 handling equivalent the tos stuff in ipv4. ok visa@ benno@
2018-07-24When a GRE packet goes to "decline", the mbuf pointer was not updatedYASUOKA Masahiko
properly. This had caused an panic when the mbuf pointer is updated. Found by IIJ. ok dlg
2018-05-28implement support for MikroTik's Ethernet over IP protocol as eoip(4)David Gwynne
it is sort of like egre(4), but different enough to warrant separate handling. more specifically, eoip sits under gre 1, not 0, and has it's own protocol id (0x6400). the gre key field is mandantory (the rest cannot be set) which is split into a 16 bit length field and a 16 bit tunnel id. lastly, it has a keepalive mechanism where peers send 0 length packets as hellos to each other periodically, which has no equivalent in egre(4) and is different to the gre(4) keepalives. ok sthen@
2018-03-12Delete unused variable.Kenji Aoyama
ok jsg@
2018-03-12give mgre(4) the IFF_MULTICAST and IFF_SIMPLEX flagsDavid Gwynne
according to small bits of cisco doco, multicast can be implemented on mgre using head-end replication. that isnt implemented, but the flags do allow ipv6 addresses to be added to the interface.
2018-03-01copy p2p_rtrequest to mgre_rtrequest, so it can be tweakedDavid Gwynne
2018-02-27change mgre tunnel configuration to only accept a single local address.David Gwynne
this relies on ifconfig tunneladdr
2018-02-27make kernel compile again without INET6Sebastian Benoit
ok mpi@
2018-02-27use a macro for the default if_hdrlen, not a magic numberDavid Gwynne
suggested by mpi@
2018-02-27annotate some data structures with the lock protecting them.David Gwynne
in practice this means NET_ASSERT_LOCKED() near the lists and trees holding the different types of gre interfaces. suggested by mpi@
2018-02-27add support for point to multipoint GRE via mgre(4).David Gwynne
mgre is different to gre in that the tunnel only needs configuration for a local address, and the address inside the tunnel is configured on it is a subnet. other addresses on that subnet get mapped to a tunnel endpoint and send there. at the moment that mechanism is the routing table, using non-gateway host routes with the tunnel endpoint as the gateway address. the tunnel address configuration is ugly and confusing atm, but should improve soon. ok mpi@ who has some suggestions i can do in the tree.
2018-02-25default the nvgre vnetid to the first valid value according to the rfcDavid Gwynne
2018-02-24when comparing nvgre entries, compare a with b, not a with itself.David Gwynne
2018-02-22remove some debug code in nvgreDavid Gwynne
2018-02-22don't get in the way of setting the rdomain on gre(4)David Gwynne
2018-02-21implement nvgre(4) based on rfc7637 aka NVGREDavid Gwynne
NVGRE is short for Network Virtualization Using Generic Routing Encapsulation. it provides an overlay ethernet network with multiple ip peers, rather than a tunnel to a single peer like egre(4) provides. unlike egre the vnetid is mandantory and always 24 bits. it offers similar functionality to vxlan(4).
2018-02-21if egre takes the packet, it's done, don't fall through to l3 processing.David Gwynne
2018-02-21whitespace fixesDavid Gwynne
2018-02-20cisco set the tos on their keepalive packets to ip precedenceDavid Gwynne
internet control, so we can too.
2018-02-20add support for vnetflowid.David Gwynne
when enabled, the 32bit key on gre a packet is split into a 24bit key and an 8 bit flow id. this allows better use of multipath links if the intermediate routers feed the gre key into their hashing algorithms. because gre can encapsulate pretty much anything, it can be non-trivial for a router to reach into a payload to harvest entropy for feeding into a hashing algorithm. having the endpoints do it and feed it into the gre header is a lot simpler. this allows interoperationg with cisco gre tunnels with key entropy enabled. this was tested against a csr1000v. also, this arrangement coincides with how nvgre works, so it paves the way for supporting that protocol. right now the driver relies on the flowid in mbufs to populate the packet field. this generally means that pf should be enabled to provide the flowid.
2018-02-19support configuration of fragmentation of the tunnel trafficDavid Gwynne
2018-02-16make gre_encap prepend both the gre and tunnel ip headers.David Gwynne
makes the code a bit more straightforward
2018-02-16put egre back in a treeDavid Gwynne
it's new so there's no existing configs to be compat with.
2018-02-16allow wccp processing to be enabled per interface with the link0 flag.David Gwynne
this also changes the wccp handling to peek into it's payload to determine whether it is wccp 1 or 2. wccp1 says the gre header is followed by ipv4, while wccp2 says there's a small header before the ipv4 packet. the wccp2 header cannot have 4 in the first nibble, while ipv4 must have 4 in the first nibble. the code now looks at the nibble to determine whether it should strip the wccp2 header or not.
2018-02-15take egre(4) packets out early in gre inputDavid Gwynne
this lets us look up the gre(4) interface before looking at the protocols it might be carrying.