summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2020-06-25Add mvpp(4), a driver for the Marvell Packet Processor v2, as used onPatrick Wildt
the Armada 7K and 8K SoCs. Additionally, it seems to be used on the upcoming CN9K SoCs. This only supports version v2.2, since the older v2.1 is only used on some old ARMv7 we have no support for, and where there is no hardware for us to support. A huge part of this driver is configuring the TCAM/SRAM-based "parser". Thus most of the code, especially the parser handling, was ported from EDK2 with a sed script doing plenty of automatic renaming and un-camel- casing. The controller supports multiple TX/RX queues/vectors and RSS, so this would be a nice platform for testing network processing improvement on arm64. For now though we only configure and use a single queue. The driver is still unfinished, but it's time to continue the work in tree. At least we can already send and receive packets, good enough for dhclient to work. Since the MACCHIATObin uses Clause 45 10G PHYs and SFPs, link state handling is still a bit bogus, as we have no support for that. The 1G RJ45 port works fine though. ok dlg@
2020-06-25LUT writes go through actual regsiters on 710s, not ctl writes.David Gwynne
found by jmatthew@
2020-06-25Fix some small whitespace issues.Mark Kettenis
2020-06-25add rss/toeplitz support for 710 chips.David Gwynne
this basically distributes incoming packets over the rx rings, where without this they would all land on ring 0. note that the 722 stuff is stubbed out at the moment. i don't have an x722 to test with, so it's hard to get motivated to write the code for it. this is based on stuff supplied by christiano haesbaert.
2020-06-25use the ixl_chip struct to store different rss_hena settings for 710/722David Gwynne
2020-06-25add definitions for rss bits.David Gwynne
based on info from christiano haesbaert
2020-06-25Setjmp size for powerpc64.Dale Rahn
2020-06-25we're close to a point where the differences between 710s and 722s matter.David Gwynne
this adds a struct ixl_chip, which should hold the differences in functionality between 710s and 722s. this adds which type of chip each product is to the ixl_devices array. based on stuff from christiano haesbaert
2020-06-25Additional Makefile infrastructure for powerpc64Dale Rahn
stand stubbed for now.
2020-06-25use intrmap to set up multiple queues across multiple cpus.David Gwynne
ixl(4) is only enabled on amd64 and sparc64, and both of them now support pci_intr_establish_cpu(), so it is safe to apply this. a few things to note: - the chip only supports a power of 2 number of queues, (ie, 1, 2, 4, 8, etc), so this also tests the INTRMAP_POWEROF2 flag to intrmap_create. i tested this on a box with 6 cpus and it did the right thing. - the chip can support a lot of vectors, but we're limiting it to 8 for now. - rss with toeplitz is not implemented yet, so all rxed packets end up on the 0th queue for now. jmatthew@ had done most of the work already, and christiano haesbaert provided some hints to motivate me to work on this bit of it. tested by jmatthew@ on sparc64 ok jmatthew@
2020-06-25bump the ifq maxlen like i just did for ixl(4).David Gwynne
this should enable tx mitigation, and hopefully provide a speed bump here too. iavf is a cut up ixl, so it inherited the IFQ_SETMAXLEN 1. ok jmatthew@
2020-06-25PowerPC64 reloc.h created by copying powerpc 32 bit version.Dale Rahn
There a question if RELOC_ should be changed to R_PPC64_XXX as the ABI defines. can clean up later kettenis@
2020-06-25report rx ring state for all rings, not just the first one.David Gwynne
systat mbuf looks a bit better now.
2020-06-25PowerPC asm.h with tweak for 64bit.Dale Rahn
Rework ENTRY to contain the r12-> r2 and localentry code. Powerpc64 float is the same as Powerpc (_float.h, ieee[fp].h) Profile code, adapted from powerpc
2020-06-24set IFQ_SET_MAXLEN to the number of slots on the tx ring, not 1.David Gwynne
this effectively enables tx mitigation on this chip. hrvoje popovski tested it and discovered it adds about 20% to forwarding performance on his test machine, and brings it more in line with ix(4) performance. jmatthew thinks i copied setting it to 1 from myx, but myx resets it to a proper value later on when it figures out what the chip is capable of. how embarrassment.
2020-06-24kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha
time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
2020-06-24First stab at making signal handling work.Mark Kettenis
2020-06-24Terminate stack trace at userland boundary.Mark Kettenis
ok gkoehler@
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of '7' to indicate the adapter isKenneth R Westerback
not a target on the bus. adapter_buswidth is 2. ok dlg@ as part of a larger diff.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of the value that is beingKenneth R Westerback
aassigned to adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of the value of adapter_buswidth toKenneth R Westerback
indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of -1 to indicateKenneth R Westerback
the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Use C99 initializers in wsdisplay_font struct definitions forFrederic Cambus
"Boldface", "Boldface.iso1", and "Gallant". OK mpi@
2020-06-24Adapters that do not appear as a target on the SCSI bus must setKenneth R Westerback
'adapter_target' to a value greater than or equal to 'adapater_buswidth' to allow all possible targets to be probed. Add SDEV_NO_ADAPTER_TARGET (0xffff), a value guaranteed to be greater than or equal to the u_int16_t 'adapter_buswidth'. ok dlg@ as part of a larger diff.
2020-06-24get rid of the per device sff lock because we only use the global one.David Gwynne
no functional change
2020-06-24Acknowledge xhci(4) interrupts before calling usb_schedsoftintr().Patrick Wildt
On powerdown (halt -p), sd(4)'s suspend function tries to powerdown a USB mass storage using a STOP command. In that case we are already cold and splhigh(), so that the xhci is supposed to run in polling- mode. usb_schedsoftintr() behaves differently when running in polling-mode. Instead of scheduling a soft interrupt, it immediately dequeues from the event queue. But dequeueing means touching the xhci registers. Apparently we need to acknowledge the interrupts before touching those registers, the hardware doesn't like it otherwise and we will never get an interrupt status for the second transfer. ok gerhard@
2020-06-24Fix `IFF_RUNNING' bit handling for pppx(4) and pppac(4).mvs
ok mpi@
2020-06-24Apply sc->sc_xfer_flags to control transfers as well. These are usedPatrick Wildt
so that in polled-mode the USB transfers are marked synchronous. In case that sending commands to the USB mass storage fails, the control transfers are used to reset the device. Without the synchronous flag, the STOP command sent by sd(4) on powerdown would wait for completion indefinitely, possibly hanging the machine. ok gerhard@
2020-06-24actually use pci_intr_establish_cpu with cpus from the intrmap.David Gwynne
sigh, i don't know how i forgot this. yes jmatthew@
2020-06-24Nuke some pointless *_dev_probe() and *_dev_free() functions andKenneth R Westerback
set/trust the scsiconf.c probing limits. Same as was done to vioblk(4). ok dlg@
2020-06-24remove ifdeffed out code for redistributing pyro eq interrupts over cpus.David Gwynne
when sparc64 attaches cpus early during boot, it really just allocates the software state for them (ie, the devices and the cpu_info structs) and fills them in with information from openfirmware, but it doesnt actually spin them up in a physical sense until just before root is mounted. in between that, we now set up pyro with an msi event queue per cpu, and target the interrupts for those event queues at the different cpus. if a device generates an msi interrupt before the cpus are spun up, pyro will fire an interrupt at those cpus, but cos they're not running yet, they don't handle the interrupt, and the event queue never gets processed. because the msi interrupt state is never cleared by the pyro interrupt handler because the cpu didn't run it, any further msi interrupts from that pci device don't cause the eq interrupt to fire again, so it gets stuck. one approach to dealing with this is to target all the event queues that pyro sets up at the boot cpu, and once the other cpus are running we go through and retarget the event queue interrupts at the different cpus. this means the boot cpu works on the other cpus behalf until they're running, and it avoids the eq interrupts being ignored before the other cpus are running. another approach is to spin the cpus up when they're attached, so they'll be set up to process early pyro interrupts, even if they sit at splhigh until after autoconf has run. i had a quick go at this and it didn't go well. the approach we went with was to avoid having the device in question generate interrupts early. i left the redistributing code in the tree so people might discover it if needed, or at least see this description of what's happening. kettenis@ seemed ok with leaving the code in jmatthew@s pci_intr_establish_cpu commit, but removing it after. this is that removal.
2020-06-23enable wg(4).David Gwynne
this will make testing easier for everyone. from Jason A. Donenfeld and Matt Dunwoodie ok deraadt@ tobhe@
2020-06-23Revert previous. hashfree() just calls free() which handles NULL withKenneth R Westerback
aplomb. 16 lines of 'C' can be so hard to grok at a glance. Prompted to look more closely at those 16 lines by mpi@.
2020-06-23Use C99 initializers in wsdisplay_font struct definitions for SpleenFrederic Cambus
kernel fonts. OK mpi@
2020-06-23Enable virtual consoles on armv7, the same way it is done on arm64.Frederic Cambus
Tested on a Cubieboard2. OK patrick@
2020-06-23hashfree() doesn't like NULL, so check for NULL if NULL is aKenneth R Westerback
possibility. i.e. when bailing out before calling hashinit().. COVERITY 1452907 ok mpi@
2020-06-23Enable MPSAFE start routine to keep encryption workers more active.tobhe
From Jason A. Donenfeld" <Jason (at) zx2c4.com> ok patrick@
2020-06-23Increase TX mitigation backlog size for increased throughput.tobhe
From Jason A. Donenfeld" <Jason (at) zx2c4.com> ok patrick@
2020-06-23Fix format strings (%p --> %lx) in debug code.Kenji Aoyama
ok dlg@
2020-06-23add intrmap_one, some temp code to help us write pci_intr_establish_cpu.David Gwynne
it means we can do quick hacks to existing drivers to test interrupts on multiple cpus. emphasis on quick and hacks. ok jmatthew@, who will also ok the removal of it at the right time.
2020-06-23Implement pci_intr_establish_cpu() for pyro(4) and vpci(4) based sparc64Jonathan Matthew
systems. MSIs on these systems are delivered to event queues, which trigger interrupts when non-empty. The interrupt handler dequeues the MSIs and converts them into soft interrupts, which run on the same cpu as the event queue interrupt. To target pci device interrupts to different cpus, we set up an event queue per cpu in the system, or as many as we can, if there are fewer event queues available. For now, we don't have a way to feed this information back to intrmap, so instead we just map interrupts for cpus that don't have an event queue to another cpu that does have one. Tested on V215 (pyro), T5120, T4-1, S7-2 (vpci). dlg@ got the pyro side of it working for me. ok dlg@ kettenis@
2020-06-22timecounting: add gettime(9), getuptime(9)cheloha
time_second and time_uptime are used widely in the tree. This is a problem on 32-bit platforms because time_t is 64-bit, so there is a potential split-read whenever they are used at or below IPL_CLOCK. Here are two replacement interfaces: gettime(9) and getuptime(9). The "get" prefix signifies that they do not read the hardware timecounter, i.e. they are fast and low-res. The lack of a unit (e.g. micro, nano) signifies that they yield a plain time_t. As an optimization on LP64 platforms we can just return time_second or time_uptime, as a single read is atomic. On 32-bit platforms we need to do the lockless read loop and get the values from the timecounter. In a subsequent diff these will be substituted for time_second and time_uptime almost everywhere in the kernel. With input from visa@ and dlg@. ok kettenis@
2020-06-22Add opalcons(4), a driver for the OPAL console.Mark Kettenis
2020-06-22The minimum frame size for the ELFv2 ABI is 32 bytes. Using this valueMark Kettenis
instead of 48 in the trap setup functions makes it possible to get rid of the magic offset in proc_trampoline. Suggested by gkoehler@
2020-06-22inittodr(9): introduce dedicated flag to enable writes from resettodr(9)cheloha
We don't want resettodr(9) to write the RTC until inittodr(9) has actually run. Until inittodr(9) calls tc_setclock() the system UTC clock will contain a meaningless value and there's no sense in overwriting a good value with a value we know is nonsense. This is not an uncommon problem if you're debugging a problem in early boot, e.g. a panic that occurs prior to inittodr(9). Currently we use the following logic in resettodr(9) to inhibit writes: if (time_second == 1) return; ... this is too magical. A better way to accomplish the same thing is to introduce a dedicated flag set from inittodr(9). Hence, "inittodr_done". Suggested by visa@. ok kettenis@
2020-06-22Enable interrupts when they were enabled before the trap (except when weMark Kettenis
are handling "genuine" interrupts like the decrementer and hypervisor virtualization interrupts).
2020-06-22Handle data storage and data segment interrupts from userland as well.Mark Kettenis
2020-06-22Make return-to-user and kernel re-entry work. This adds a per-pmap SLBMark Kettenis
cache. We might want to turn that in a per-proc cache at some point, but this gets us to the point where we can sucessfully have init(1) do its first system call.
2020-06-22Fix previous commit; pasted instructed in the wrong spot.Mark Kettenis
2020-06-22Remove AMRR/MiRA support from iwx(4). Tx rate selection happens in firmware.Stefan Sperling