summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2016-11-03Implement a Key-Value Pair exchange interfaceMike Belopuhov
The implemented abstraction allows us to query and set little endian UTF-16 keys exchanged between the Host and the Guest via a text based pvbus(4) interface. All keys are attached to one of several key pools: Auto, Guest, External or Guest/Parameters. The hostctl(8) is able to modify values for keys in the Auto pool as well as set new keys in the Guest pool while the Host provides its keys in External and Guest/Parameters pools. Discussed with reyk@
2016-11-03Let Integrated Components allocate the receive buffer themselvesMike Belopuhov
since they have a better clue how to size it. While here, cleanup the kernel output a bit.
2016-11-03Always call if_put() during the interface iteration on port status multipartRafael Zalamena
reply to avoid reference leaks. ok mikeb@
2016-11-03The networking code no longer runs off software interrupts.Martin Pieuchot
2016-11-02Add Windows 10 VMBus protocol versionMike Belopuhov
2016-11-02Inline the macro that is used only onceMike Belopuhov
2016-11-02when CONSPEED moved from libsa.h to Makefile it lost a leading '1',Jasper Lievisse Adriaanse
reinstate the original of 115200 spotted by brad
2016-11-02Fixup a wait channel used during VMBus channel discoveryMike Belopuhov
Clang static analyser has found that a tsleep was using an uninitialised pointer value as a wait channel. An associated wakeup wasn't doing the right thing either.
2016-11-02poison the TAILQ_ENTRY in items in the per cpu pool cache.David Gwynne
2016-11-02add poisoning of items on the per cpu caches.David Gwynne
it copies the existing pool code, except it works on pool_list structures instead of pool_item structures. after this id like to poison the words used by the TAILQ_ENTRY in the pool_list struct that arent used until a list of items is moved into the global depot.
2016-11-02use a TAILQ to maintain the list of item lists used by the percpu code.David Gwynne
it makes it more readable, and fixes a bug in pool_list_put where it was returning the next item in the current list rather than the next list to be freed.
2016-11-02Make possible to change the link layer address of a cnmac(4) interface.Visa Hankala
Asked by and ok stsp@, ok jasper@
2016-11-02add per cpu caches for free pool items.David Gwynne
this is modelled on whats described in the "Magazines and Vmem: Extending the Slab Allocator to Many CPUs and Arbitrary Resources" paper by Jeff Bonwick and Jonathan Adams. the main semantic borrowed from the paper is the use of two lists of free pool items on each cpu, and only moving one of the lists in and out of a global depot of free lists to mitigate against a cpu thrashing against that global depot. unlike slabs, pools do not maintain or cache constructed items, which allows us to use the items themselves to build the free list rather than having to allocate arrays to point at constructed pool items. the per cpu caches are build on top of the cpumem api. this has been kicked a bit by hrvoje popovski and simon mages (thank you). im putting it in now so it is easier to work on and test. ok jmatthew@
2016-11-01Reset the ucode interrupt flag in the softc before loading iwm(4) 8k firmware.Stefan Sperling
Makes firmware load work reliably without the horrid tsleep() workaround hack. Patch by Imre Vadasz
2016-11-01Use x2APIC if it is enabled by BIOS. It is expected that this doesn'tYASUOKA Masahiko
change the behavior on the system whose x2apic is disabled by BIOS. ok sf
2016-10-31Improve ofp_error message accurateness: use parameterized error typeRafael Zalamena
instead of hardcoding it. With this we can change the error type to something else and get a more accurate description of what happened. ok reyk@
2016-10-31Change validation functions prototypes: use the parameter variable toRafael Zalamena
return the error code and the return value to signal if the validation was successful or not. With this we can signal some errors in the spec that uses the value 0 (zero). ok reyk@
2016-10-31turns out these chips can handle buffers up to 9400 bytes in length.David Gwynne
raise the mtu to 9380 bytes so we can take advantage of the extra space. i need to revisit the macro names at some point.
2016-10-31revert 1.97 where i moved myx to using the system poolsDavid Gwynne
my early revision board doesnt like it at all
2016-10-30add __BEGIN_DECLS/__END_DECLS to the public userland side of net/bpf.h,Peter Hessler
so c++ programs can use them. OK jca@
2016-10-29If the system has fdt, use it for locating network PHYs.Visa Hankala
Skip a network port if its PHY cannot be found. Tested on Lanner MR-326B (has fdt) by pirofti@, and on EdgeRouter Pro (has fdt) and on EdgeRouter Lite (no fdt) by me.
2016-10-29Make PHY address lookups fail instead of using CAM-0100 entriesVisa Hankala
when the system board is unhandled.
2016-10-29sync with -r1.95 of amd64/vmm.c:Reyk Floeter
Further improve vmm's security model by restricting pledged vmm processes to only do VMM_IOC_ ioctls on their associated VM (these ioctls are _RUN, _RESETCPU, _INTR, _READREGS, or _WRITEREGS at present). The vmm monitor (parent) process or any non-pledged processes can still do ioctls on any VM. For example, a VM can only terminate itself but vmctl or the monitor can terminate any VM. This prevents reachover into other VMs: while escaping from a VM to the host side (eg. through a bug in virtio etc.) pledge already kept the attacker in a pledged and privsep'ed process, but now it also prevents vmm ioctls on "other VMs". OK mlarkin@
2016-10-29Further improve vmm's security model by restricting pledged vmmReyk Floeter
processes to only do VMM_IOC_ ioctls on their associated VM (these ioctls are _RUN, _RESETCPU, _INTR, _READREGS, or _WRITEREGS at present). The vmm monitor (parent) process or any non-pledged processes can still do ioctls on any VM. For example, a VM can only terminate itself but vmctl or the monitor can terminate any VM. This prevents reachover into other VMs: while escaping from a VM to the host side (eg. through a bug in virtio etc.) pledge already kept the attacker in a pledged and privsep'ed process, but now it also prevents vmm ioctls on "other VMs". OK mlarkin@
2016-10-28The function swofp_flow_entry_put_instructions() doesn't need to receiveRafael Zalamena
a pointer to a mbuf pointer, because it only uses the mbuf for reading. ok reyk@
2016-10-28Change swofp_flow_table_add() malloc() behaviour to be non-blocking likeRafael Zalamena
all others that we can find in switch(4). ok reyk@
2016-10-28Simplify the OFP_FLOW_MOD_MSG_INSTRUCTION_OFFSET() by using another macroRafael Zalamena
already does exactly what it wants to do. ok reyk@
2016-10-28Rename pad fields to have struct prefixes, remove useless whitespaces andRafael Zalamena
add missing action_set_queue struct. ok reyk@
2016-10-28Improve protocol version negotiation for Integrated ComponentsMike Belopuhov
modelled on the upstream version.
2016-10-28get rid of the custom pool in myx for jumbo frames.David Gwynne
now it asks the mbuf layer for the 9k from its pools. a question from chris@ made me go look at the chip doco again and i realised that the chip only requires 4 byte alignment for rx buffers, no 4k alignment for jumbo buffers. i also found that the chip is supposed to be able to rx up to 9400 bytes instead of 9000. ill fix that later though.
2016-10-28In iwn(4), stop forcing RTS for every frame in 11n mode.Stefan Sperling
The RTS threshold should be good enough and applies to all modes. A similar change was made in iwm(4) not long ago. tested by myself and benno@
2016-10-28Remove unused function, the code is already inlined in action_outputRafael Zalamena
function. ok reyk@
2016-10-28When doing pktout we must run the classifier again, because some action(s)Rafael Zalamena
might want to use it. For buffered packets we probably need to save that somehow else, but we don't support it now. ok reyk@
2016-10-28- once rule should not attempt to remove its parent rule.Alexandr Nedvedicky
(problem pointed out by Petr, fix proposed by Dilli) _at_ oracle
2016-10-27Pass a struct pf_pdesc to pf_route() like it is done in the otherAlexander Bluhm
pf functions. That means less parameters, more consistency and later we can call functions that need a pd from pf_route(). OK sashan@
2016-10-27We don't generate an eddep script for kernel builds nowadays. The lastMartin Natano
reference to eddep in the kernel Makefile I could find is in 4.3BSD, released some 30 years ago. ok tb millert
2016-10-27vmm is also available on i386 now, so don't restrict it to amd64.Reyk Floeter
OK mikeb@ mlarkin@
2016-10-27Improve channel ring locking strategyMike Belopuhov
Make sure to hold the ring buffer lock for the complete duration of a channel ring I/O operation. For read operations this means peeking and reading is done uninterrupted and for both reads and writes this places the buffer space availability check under the same lock as well.
2016-10-27Revert previous `ncpus' change because the percpu code now worksVisa Hankala
without it.
2016-10-27For consistency, allow symlinkat(2) in the same way as symlink(2);Ingo Schwarze
no need to wait until the first program using it breaks... "could make sense" semarie@ (and thanks for the cluestick) OK deraadt@
2016-10-27Avoid a use after free in swofp_flow_timeout(). TheJonathan Gray
swofp_flow_entry_delete() call frees the memory pointed to by the swfe variable which was used later in the loop. ok rzalamena@
2016-10-27revert 1.41 now that subr_percpu is using ncpusfound instead of ncpus.David Gwynne
2016-10-27use ncpusfound to size the percpu allocations.David Gwynne
ncpus is used on half the architectures to indicate the number of cpus that have been hatched, and is used on them in things like ddb to figure out how many cpus to shut down again. ncpusfound is incremented during autoconf on MP machines to show how big ncpus will probably become. percpu is initted after autoconf but before cpus are hatched, so this works well.
2016-10-27increment ncpus when a cpu is attached, not when its booted.David Gwynne
fixes percpu allocations, like visa@ just did on mips64.
2016-10-27Uniformize debug printfs, by using consistently __func__ everywhere.Alexandre Ratchov
From Michael W. Bombardieri <mb at ii.net>
2016-10-27refactor m_pullup a bit.David Gwynne
the most important change is that if the requested data is already in the first mbuf in the chain, return quickly. if that isnt true, the code will try to use the first mbuf to fit the requested data. if that isnt true, it will prepend an mbuf, and maybe a cluster, to fit the requested data. m_pullup will now try to maintain the alignment of the original payload, even when prepending a new mbuf for it. ok mikeb@
2016-10-27tell ix and em to use 2k+ETHER_ALIGN clusters for rx on all archs.David Gwynne
this means that the ethernet header and therefore its payload will be aligned correctly for the stack. without this em and ix are sufferring a 30 to 40 percent hit in forwarding performance because the ethernet stack expects to be able to prepend 8 bytes for an ethernet header so it can gaurantee its alignment. because em and ix only had 6 bytes where the ethernet header was, it always prepends an mbuf which turns out to be expensive. this way the prepend will be cheap because the 8 byte space will exist. 2k+ETHER_ALIGN clusters will end up using the newly created mcl2k2 pool. the regression was isolated and the fix tested by hrvoje popovski. ok mikeb@
2016-10-27add a new pool for 2k + 2 byte (mcl2k2) clusters.David Gwynne
a certain vendor likes to make chips that specify the rx buffer sizes in kilobyte increments. unfortunately it places the ethernet header on the start of the rx buffer, which means if you give it a mcl2k cluster, the ethernet header will not be ETHER_ALIGNed cos mcl2k clusters are always allocated on 2k boundarys (cos they pack into pages well). that in turn means the ip header wont be aligned correctly. the current workaround on these chips has been to let non-strict alignment archs just use the normal 2k cluster, but use whatever cluster can fit 2k + 2 on strict archs. that turns out to be the 4k cluster, meaning we waste nearly 2k of space on every packet. properly aligning the ethernet header and ip headers gives a performance boost, even on non-strict archs.
2016-10-26Put union pf_headers and struct pf_pdesc into separate header fileAlexander Bluhm
pfvar_priv.h. The pf_headers had to be defined in multiple .c files before. In pfvar.h it would have unknown storage size, this file is included in too many places. The idea is to have a private pf header that is only included in the pf part of the kernel. For now it contains pf_pdesc and pf_headers, it may be extended later. discussion, input and OK henning@ procter@ sashan@
2016-10-26Increment `ncpus' to its final value already during autoconfiguration soVisa Hankala
that percpu data areas get allocated properly on mips64 platforms. It is too late to set the value during launch of secondary CPUs. ok jasper@ kettenis@ dlg@