summaryrefslogtreecommitdiff
path: root/sys/src/9/port
AgeCommit message (Collapse)Author
2022-10-23sdnvme: fix missing unlock() in submit queue full casecinap_lenrek
when we have more processors than submit queues, the submit queues are shared between some processors and hence we have to acquire its lock. in the case of the submit queue being full, we have to unlock it again before retrying otherwise we have a deadlock. sorry :(
2022-10-21kernel: fix freeb() for custom poolscinap_lenrek
Some ethernet drivers like ethervt6105M maintain a custom pool of Blocks using Block.free callback. To maintain that Block.list pointer is nil when reused, we have to clear it before returning it to the custom pool as the custom pool code is not aware of it. Also, poison Block.list pointer before free().
2022-09-259/port: revert timer wheel change, breaks pi4 boot, needs more time ↵cinap_lenrek
investigating
2022-09-25devpci: provide a #$ device for PCI config accesscinap_lenrek
We want to provide userspace PCI config space access on platforms that have PCI, but do not have ISA bus. For this, provide a stripped down version of devpnp, wiht only the pci support that can then be used by pi4 (bcm64) and reform (imx8) kernels.
2022-09-249/port: reimplement timers to use timer wheelOri Bernstein
when many processes go to sleep, our old timer would slow to a crawl; this new implementation does not.
2022-09-18sdnvme: avoid "empty if body" warningcinap_lenrek
dmaflush() is a no-op macro on amd64, so wrap all calls into {} braces to avoid the compiler warning.
2022-09-18usbxhci: eliminate "set but not used" warningcinap_lenrek
2022-09-17devip: do tcp mss clamping when forwarding packetscinap_lenrek
when forwarding packets (gating), unconditionally check tcp-syn packets for the mss-size option and reduce it to fit the mtu of the outgoing interface. this is done by exporting a new tcpmssclamp() function from ip/tcp.c that takes an ip packet and its buffer size and the effective mtu of the interface and adjusts the mss value of tcp syn options. this function is now also used by devbridge, enforcing a tcp mss below the tunnel mtu.
2022-09-03kernel: half NERR, refcount Note's to avoid excessive allocations for ↵cinap_lenrek
postnotepg() Half NERR stack to 32. When posing a note to a large group, avoid allocating Notes for each individual process, but post the reference instread. factor out process interruption into procinterrupt(). Avoid allocation of notes in alarmkproc, just posting the same note to everyone.
2022-08-26sdnvme: correct mode/serial/firmware string lengthsSigrid Solveig Haflínudóttir
2022-08-18devvga: fix race condition between writes to vgactlqwx
to reproduce: for(i in `{seq 10}) echo softscreen off >/dev/vgactl
2022-08-17kernel: allocate notes in heapcinap_lenrek
de-bloat the proc structure by allocating notes with on the heap instead of embedding them in the proc structure. This saves around 640 bytes per process.
2022-08-17kernel: simplify notify() adding common popnote() functioncinap_lenrek
Handlin notes is common for all architectures except how the note has to be pushed on the user stack. This change adds a popnote() function that returns only the note string or nil if the process should not be notified (no notes or user notes hold off). Popnote() also handles common errors like notify during note handling or missing note handler and will suicide the process in that case.
2022-08-15mkdevc: fix dtracy-disabled builds (thanks ori)Sigrid Solveig Haflínudóttir
2022-08-13dtracy: make timer probes run in interrupt contextOri Bernstein
When probing a timer, we were running in our own kproc, and not in an interrupt context, which meant that we didn't have any access to anything worth sampling, so we didn't give any data back. This moves the probe to the hzclock interrupt, and returns the pc in the probe.
2025-05-14kernel: get rid of Proc.kstackglenda
The kernel stack is now above the Proc structure, so the explicit kstack pointer can be eliminated.
2022-08-129: compute available kernel pages using sizeof(Proc*)Ori Bernstein
procs come from the dynamic pools, so we don't need to remove the memory used by possible procs from the total available.
2022-08-109/port: allow kiloprocs -- allocate procs lazilyOri Bernstein
Treallocate the small data structures around procs eagerly, but use malloc to allocate the large proc data structures when we need them, which allows us to scale to many more procs. There are still many scalability bottlenecks, so we only crank up the nproc limit by a little bit this time around, and crank it up more as we optimize more.
2022-08-09kernel: use 64 bits for mountidsglenda
We dont expose this anymore, wrapping these would be bad. Just send more bits.
2022-07-31usb: fix ehci isochronous "in" split transactionscinap_lenrek
For "in" transactions, the "Total Bytes to Transfer" field in the siTD is decremented by the controller by the actual transfer size, so what remains in the field is the residue number of bytes. Also, handle restart when we get a zero byte read on a isochronous "in" endpoint in devusb itself (removing the restart code for xhci drivers). This fixes audio recording with a usb1.1 audio device connected to ehci controller.
2022-07-30bind, mount: stop returning mount idOri Bernstein
The mount ID is a sequence number in a 32 bit integer, which means that it can't be unique. This is largely harmless, because there is no way to use the mount id, beyond checking if it's negative. However, there's no overflow check, so the mount ID can wrap negative, which will break error checks on mount calls. Because it's useless, let's just stop returning it.
2022-07-25sysproc: raise limit on #! lines, and allow quoted argsOri Bernstein
Our #! line length is very short, and the naïve quoting makes it difficult to pass more complicated arguments to the programs being run. This is fine for simple interpreters, but it's often useful to pass arguments to more complicated interpreters like auth/box or awk. This change raises the limit, but also switches to tokenizing via tokenize(2), rather than hand rolled whitespace splitting. The limits chosen are arbitrary, but they leave approximately 3 KiB of stack space on 386, and 13k on amd64. This is a lot of stack used, but it should leave enough for fairly deep devtab chan stacks.
2022-07-03imx8: pcie and nvme supportcinap_lenrek
2022-07-03sdnvme: add dmaflush() instructions, move to port/cinap_lenrek
2022-06-29kernel: revert /srv/cloneJacob Moody
2022-06-22kernel: correct error handling in /srv/clone readJacob Moody
readstr can error, we need to catch the error and unlock.
2022-06-21kernel: add /srv/clone to get seperate /srv bulletin boards.Jacob Moody
2022-06-19etherimx: fix link negotiationcinap_lenrek
mdio interrupt command completion handling was broken, as the interrupt handler would clear the mii status register before mdiodone() sees it. handle errors in miistatus() and miiane(), to not get confused.
2022-06-18imx8/usdhc: work around broken multi-write for nowcinap_lenrek
for unknown reasons, multiwrite is busted in usdhc: sdhc: write error intr 10 stat ff88858e usdhccmd: need to reset Datinhibit intr 10 stat ff88858e usdhc: cmd 193a0027 arg 1e5b6b error intr 18010 stat ff88858f i'm disabling it for now, adding a flag to the SDio struct.
2022-06-17kernel: add dev dtracy provider.Jacob Moody
2022-06-15skel(3) → skelfs(4)Jacob Moody
The original intention was to put devskel in to the kernel to detach what it provides from devsrv. That is not a good reason, just move it to userspace. auth/box has been changed to exec skelfs instead of relying on '#z'.
2022-06-14kernel: devwalk: correct debug printJacob Moody
nc is not yet tied to the device that called us
2022-06-14kernel: devskel: use RWlockJacob Moody
2022-06-12devsrv: revert 'add /srv/clone'Ori Bernstein
this leaks /srvs, revert until we can fix it.
2022-06-12kernel: add /srv/cloneJacob Moody
/srv/clone allows a namespace to get their own private /srv session.
2022-06-11devi2c: add generic i2c bus drivercinap_lenrek
2022-06-07kernel: add devskel for pc and pc64Jacob Moody
2022-06-05kernel: cleanup unused fields from devpipeJacob Moody
We don't need to multiply session path by 2, the definition for NETQID is: Meaning we don't need to save room between session paths for individual Qid paths. This doubles the amount of pipe sessions we can have before a wrap.
2022-05-28kernel: be more careful about argc for /dev/drivers writesJacob Moody
Not crashing on 'chdev &' is important.
2022-05-28kernel: add /rc to devrootJacob Moody
This makes it much easier to run a rc program without needing to bind in all of '#s/boot'.
2022-05-28kernel: add chdev command to devconsJacob Moody
2022-05-19kernel: remove dead case from devpipeJacob Moody
This code is checking the return of devwalk for a walk resulting in a clone of an open pipe file. However, devclone ensures that the chan we are cloning is not currently open.
2022-05-15kernel: disable wstat for devpipeJacob Moody
2022-05-02kernel: fix noteid change race condition from devproc while forking (thanks ↵cinap_lenrek
joe7) devproc allows changing the noteid of another process which opens a race condition in sysrfork(), when deciding to inherit the noteid of "up" to the child and calling pidalloc() later to take the reference, the noteid could have been changed and the childs noteid could have been freed already in the process. this bug can only happen when one writes the /proc/n/noteid file of a another process than your own that is in the process of forking. the noteid changing functionality of devproc seems questinable and seems to be only used by ape's setpgrid() implementation.
2022-04-02devdraw: printmesg: implement "z" fmt arg (safe since printmesg is disabled)Sigrid Solveig Haflínudóttir
2022-03-30devsd: cache SDunit pointer in Chan.aux, improve error handlingcinap_lenrek
Avoid calling sdgetdev() for every I/O. Instead, put the SDunit pointer for #S/sdXX/* files in Chan.aux and keep a reference to SDev between sdopen()/sdclose(). This avoids having to do the sdindex() lookup and qlock(),incref(),decref() on every read/write operation. Removal of SDev's is quite rare and only can happen with pcmcia ide controllers, and i assume that for that we can assume thet fileservers having been exited properly and closed their files before we attempt to remove a device. The rest is improving waserror() codepaths, making sure we release the locks for any of the interface callbacks (verify/online). Also get rid of tas() and instead only change the unit's rawopen flag while holding raw qlock.
2022-03-19devuart: allow serial console on late detected uartscinap_lenrek
pci uarts are detected late and usually do not contain the console= parameter logic. for these, we can just enable them when devuart is reset, and replay the boot messages once enabled. this is usefull as it allows us to use these uarts for kernel debugging in interrupt context.
2022-02-27devbridge: fix vlan range parsingcinap_lenrek
2022-02-26devbridge: improve locking, unbind ports automatically on read error and more...cinap_lenrek
Use an RWlock so readers can work in parallel in the common case (no cache updates). When a reader needs to update the cache to add a new learned source mac address, it will drop the rlock and aquire the wlock to do the update. When we get a read error, we now unbind the port to avoid further packets being forwarded to it. This is usefull for hotplug ethernet devices like usb ones or tunnels. Simplify the unbind, getting rid of the refcount, by having only the reader proc call freeport(). Avoid holding the bridge lock while opening and closing ethernet/tunnel device files during bind and unbind. Dont use smalloc() (especially when holding locks). Allocate bridges dynamically, so we do not waste the memory when we do not need them. Reject non-hostowner from allocating new bridges. Use consistent naming: port -> port Use consistent comment style: // -> /* */
2022-02-21usbxhci: endpoint address needs to be masked with Epmax from endpoint numbercinap_lenrek