summaryrefslogtreecommitdiffstats
path: root/sys/net/if_mpw.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* a first cut at converting some virtual ethernet interfaces to if_vinputdlg2019-04-231-4/+3
| | | | | | | | | | 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.
* use the factored out txhprio and rxhprio checksdlg2019-04-191-14/+5
| | | | reduces code duplication and chance for error.
* implement rxpriodlg2019-04-191-1/+35
|
* don't lose the TTL on FAT labelsdlg2019-04-171-2/+2
|
* use txprio to control the use of exp as a priority fielddlg2019-04-171-4/+33
| | | | | | | | by default txprio is set to 0, so the exp field will be 0. howerver, txprio on mpe/mpw/mpip can be configured with other values or settings like our other tunnel or encapsulation interfaces. intermediate LSPs can use the exp field to manage their prioritisation of encapsulated traffic.
* clear the BCAST and MCAST mbuf flags for "outgoing" packets.dlg2019-04-021-1/+2
| | | | | | | | | if these remain set then output on the underlying interface may mistakenly be done with the wrong protocol type (eg, MPLS_MCAST instead of MPLS), and to the wrong link layer address. reported by Lee Nelson the specific problem was identified by Mitchell Krome
* some mbuf ph_rtableid fixesdlg2019-04-021-2/+9
| | | | | consistently set the rtabled for "outgoing" packets to the encap rdomain. use this for rtallocs in mpip too instead of assuming 0.
* make SIOCGETLABEL fail with EADDRNOTAVAIL if the label is not set.dlg2019-03-181-2/+3
| | | | this makes ifconfig print "(unset)" to show the label isn't set yet.
* don't check the pseudowire type in tx and rx paths.dlg2019-02-261-5/+1
| | | | | | | | | | whether the mpw interface is advertising "ethernet" or "ethernet- tagged" is something the ends of the wire agree on (ie, ldpd is configured a certain way), it is not something that affects ethernet encap or decap. the MPW ioctls can still configure it and read it, but it has no bearing on how the driver operates on packets.
* add support for the new pwe3 ioctls.dlg2019-02-261-103/+260
| | | | | | | | the existing mpw ioctl is still available for ldpd to use for a (short) while. discussed with claudio@ at a2k19 ok mpi@
* add support for rfc 6391: flow-aware transport of pseudowires.dlg2019-02-201-4/+44
| | | | | | | | | | this basically adds a dummy mpls tag to the stack for pseudowires and uses a flow as the label on that dummy tag. this allows intermediate systems that hash packets onto multiple links to use the extra tag as input to the hash, providing more entropy and therefore better load balancing. it's a pity there's no way to turn it on yet...
* don't store the BOS flag as part of the remote label, add it at tx time.dlg2019-02-201-3/+5
| | | | this is to prepare for flow aware transport for FAT from RFC 6391
* replace sc_flgas with sc_cworddlg2019-02-201-7/+7
| | | | | | | | | the only flag used with sc_flags was the one to turn the control word on and off. this is in preparation for split ioctls for controlling pseudowire behaviour. sc_cword can be set atomically and indepentently as a separate variable.
* sigh, more whitespace fixesdlg2019-02-201-3/+3
| | | | no functional change
* oops, whitespace tweakdlg2019-02-201-2/+2
| | | | no functional change
* add support for SIOCGETLABELdlg2019-02-201-1/+23
| | | | | | | this is a first step in breaking up the monolithic and redundant SIOCSETMPWCFG ioctls discussed with claudio@
* coordinate configuration of local mpls labels with destroying an interfacedlg2019-02-151-4/+22
| | | | | | this adds an rwlock like mpe has which means only one thing can be adding or removing a local mpls label, and those things check if the interface is dying before doing their thing.
* allow configuration of the rdomain that mpls operates indlg2019-02-151-14/+48
| | | | | | this is based on the changes to mpe i made yesterday. unfortunately mpw has a monstor ioctl that configures all the things, which makes the kernel side complicated. hopefully i can split them up.
* the rdomain for the mpls stuff should still be hardcoded to 0 in mpw.dlg2019-02-141-2/+2
| | | | | it was using ifp->if_rdomain for the rtalloc of the mpls encapsulated tunnel in mpw_start.
* consistently use the same flags for rt_ifa_add and _del.dlg2019-02-141-4/+4
| | | | experience with mpe shows you need RTF_LOCAL everywhere for del to work.
* change rt_ifa_add and rt_ifa_del so they take an rdomain argument.dlg2019-02-131-5/+5
| | | | | | | | | | | | this allows mpls interfaces (mpe, mpw) to pass the rdomain they wish the local label to be in, rather than have it implicitly forced to 0 by these functions. right now they'll pass 0, but it will soon be possible to have them rx packets in other rdomains. previously the functions used ifp->if_rdomain for the rdomain. everything other than mpls still passes ifp->if_rdomain. ok mpi@
* add M_CANFAIL to malloc, and return ENOMEM if allocating an interfacedlg2019-02-111-2/+5
| | | | fails.
* assign the m_prepend result to the right variable.dlg2019-02-101-2/+2
|
* use MPLS_SHIM2LABEL and MPLS_LABEL2SHIMdlg2019-01-301-7/+5
|
* call the "parent" interface ifp0 to be consistent with other drivers.dlg2019-01-291-6/+6
|
* use a sockaddr_mpls when preparing an AF_MPLS sockaddr for mpls_outputdlg2019-01-291-10/+6
|
* let ether_ioctl handle the mtu. set hardmtu to ETHER_MAX_HARDMTU_LEN.dlg2019-01-271-9/+2
| | | | | as well as allowing for larger frames to be transported, it also gets rid of the dependancy on mpe defines.
* split off "local" input handlingdlg2019-01-271-2/+15
| | | | | | | | | | this means the current mpls header will be passed along with the mbuf for mpw to look at. right now this doesn't do anything, but it will allow for implementation of RFC 6391 (flow aware transport) and using the exp header for cos. when mpe gets moved to adding an RTF_LOCAL route, this will be used for cos and ttl handling.
* like ip headers, mpls tags need to be aligned to a 4 byte boundarydlg2019-01-271-10/+43
| | | | | | | | copy the semantics for guaranteeing this from egre. when sending an encapsulated frame, prepend a whole new mbuf for the tags and transport headers. when rxing a packet, check the alignment of the ethernet payload and duplicate it on the right boundary if it isn't already aligned.
* rework mpw to be an actual ethernet interface.dlg2019-01-231-111/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this will allow for a lot of special casing in places like vlan and bridge to go away since mpw will do all the same things as any other ethernet tunnel. another benefit is you can run stuff directly on the mpw interface to interact with the pseudowire, rather than requiring a bridge and vether interface. this is like what juniper calls Pseudowire Service Interfaces. the caveat is that the implicit vlan or svlan tagging that mpw did in ethernet-tagged mode now has to be done by hand. however, there is some indication that different vendors pick different types of tags, ie, one uses vlan tags and another uses svlan, so being able to configure the right one has value. it is also possible you would want to bridge the entire tag stack to another site, so being able to bridge mpw without it playing with the tags can be useful. because the if_type on mpw changes from IFT_MPLSTUNNEL to IFT_ETHER, the semantic used to handle incoming packets in mpls_input is changed. instead of mpls_input pushing the packets into mpw based on the if_type being IFT_MPLSTUNNEL, mpw now adds an RTF_LOCAL route to the mpls table. mpls_input falls through to "outputting" the packet to mpw_output, which then uses the RTF_LOCAL flag to decide to input to mpw_input and then ether_input. this semantic will be applied to mpe soon, which removes all the interface special casing in mpls_input. the if_type change also means mpw implements the SIOCGPWE3 ioctl so ldpd can still figure out that the interface is a pseudowire. ok claudio@
* Remove almost unused `flags' argument of suser().mpi2018-02-191-2/+2
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* Creating a cloned interface could return ENOMEM due to temporarybluhm2018-01-091-5/+2
| | | | | | memory shortage. As it is invoked from a system call, it should not fail and wait instead. OK visa@ mpi@
* if_input() doesn't need splnet().mpi2017-05-151-5/+1
| | | | ok rzalamena@
* Introduce sstosa() for converting sockaddr_storage with a type safebluhm2017-05-041-5/+4
| | | | | | | inline function instead of casting it to sockaddr. While there, use inline instead of __inline for all these conversions. Some struct sockaddr casts can be avoided completely. OK dhill@ mpi@
* Allow MPLS switching and VPLS across rdomains.renato2017-03-021-4/+4
| | | | OK claudio@ mpi@
* A space here, a space there. Soon we're talking real whitespacekrw2017-01-241-9/+9
| | | | rectification.
* add support for multiple transmit ifqueues per network interface.dlg2017-01-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | an ifq to transmit a packet is picked by the current traffic conditioner (ie, priq or hfsc) by providing an index into an array of ifqs. by default interfaces get a single ifq but can ask for more using if_attach_queues(). the vast majority of our drivers still think there's a 1:1 mapping between interfaces and transmit queues, so their if_start routines take an ifnet pointer instead of a pointer to the ifqueue struct. instead of changing all the drivers in the tree, drivers can opt into using an if_qstart routine and setting the IFXF_MPSAFE flag. the stack provides a compatability wrapper from the new if_qstart handler to the previous if_start handlers if IFXF_MPSAFE isnt set. enabling hfsc on an interface configures it to transmit everything through the first ifq. any other ifqs are left configured as priq, but unused, when hfsc is enabled. getting this in now so everyone can kick the tyres. ok mpi@ visa@ (who provided some tweaks for cnmac).
* Flag pseudo-interfaces as such in order to call add_net_randomness()mpi2017-01-231-1/+2
| | | | | | | | | only once per packet. Fix a regression introduced when if_input() started to be called by every pseudo-driver. ok claudio@, dlg@
* Kill recursive splsoftnet()/splx() dances in ioctl(2) path.mpi2016-12-201-6/+1
| | | | ok rzalamena@
* Remove recursive splsoftnet() calls, from David Hill.mpi2016-09-211-4/+1
|
* We're always ready! So send IFQ_SET_READY() to the bitbucket.mpi2016-04-131-2/+1
|
* rework how mpw(4) interacts with vlan(4)dlg2016-03-091-174/+54
| | | | | | | | | | | | | | | | | | | | | | | | | previously mpw would walk around our interface hierarchy so it could reinject vlan tags for packets that were received on a stack of vlan interfaces. this got in the way of making vlan mpsafe, but is also unecessary according to how i read RFC 4448 which describes how mpls pseudowires should function. the behaviour is now: - in raw mode mpw(4) acts like a normal ethernet interface it no longer injects a tag from a vlan interface that may be on the same bridge as it, and it allows you to configure ip addresses on the local interface and use them without panicking the kernel. - in tagged mode it will only add tags from vlan interfaces on the same bridge as it, but not any parent/child tags from interfaces on top of that vlan. if the packet did not come from a vlan interface on a bridge it will inject a tag for vlan 0. this will also allow vlan to move forward. ok mpi@ rzalamena@ claudio@
* remove old lint annotationstedu2015-12-051-2/+1
|
* Kill the RT_REPORT flag to rtalloc() and stop sending RTM_MISS messagesclaudio2015-12-021-3/+2
| | | | | | for failed route lookups. This is something that was maybe useful in the 90is but in this modern times it is just annoying and nothing expect it anyway. OK mpi@, sthen@
* Do not use rt_ifp directly.mpi2015-11-061-7/+17
| | | | ok rzalamena@
* pull packets off the send queue with IFQ_DEQUEUE instead of IF_DEQUEUE.dlg2015-11-031-2/+2
|
* Kill link_rtrequest(), introduce in 1990 to "fix" the resultmpi2015-10-221-2/+1
| | | | | | | of rt_getifa() when adding link level route from outside the kernel. ok claudio@
* Inspired by satosin(), use inline functions to convert sockaddr dl.bluhm2015-10-221-2/+3
| | | | | | Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
* Now that rtrequest1(9) properly sets RTF_UP for newly added route,mpi2015-09-121-5/+5
| | | | | | stop passing it in every rt_ifa_add(9) calls. ok claudio@
* pass a cookie argument to interface input handlers that can be usedmikeb2015-09-101-5/+5
| | | | | | | to pass additional context or transient data with the similar life time. ok mpi, suggestions, hand holding and ok from dlg