aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* uart(4): Honor hardware state of NS8250-class for tsw_busyMarius Strobl2024-01-189-8/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 9750d9e5, I brought the equivalent of the TS_BUSY flag back in a mostly hardware-agnostic way in order to fix tty_drain() and, thus, TIOCDRAIN for UARTs with TX FIFOs. This proved to be sufficient for fixing the regression reported. So in light of the release cycle of FreeBSD 10.3, I decided that this change was be good enough for the time being and opted to go with the smallest possible yet generic (for all UARTs driven by uart(4)) solution addressing the problem at hand. However, at least for the NS8250-class the above isn't a complete fix as these UARTs only trigger an interrupt when the TX FIFO became empty. At this point, there still can be an outstanding character left in the transmit shift register as indicated via the LSR. Thus, this change adds the 3rd (besides the tty(4) and generic uart(4) bits) part I had in my tree ever since, adding a uart_txbusy method to be queried in addition for tsw_busy and hooking it up as appropriate for the NS8250-class. As it turns out, the exact equivalent of this 3rd part later on was implemented for uftdi(4) in 9ad221a5. While at it, explain the rational behind the deliberately missing locking in uart_tty_busy() (also applying to the generic sc_txbusy testing already present). (cherry picked from commit 353e4c5a068d06b0d6dcfa9eb736ecb16e9eae45)
* igb(4): Remove disconnected SYSCTLMarius Strobl2024-01-182-11/+0
| | | | | | | | | | | The global hw.igb.rx_process_limit knob never was adhered to by the in-tree version of this driver but similar functionality is available via the device-specific dev.igb.N.iflib.rx_budget. While at it, remove the - besides initialization of tx_process_limit - unused {r,t}x_process_limit members. (cherry picked from commit f221d35be7a5749e2a1246c81adc9c03c1dc545c)
* e1000(4): Remove disconnected SYSCTLMarius Strobl2024-01-182-13/+0
| | | | | | | | | | The global hw.em.rx_process_limit knob has been replaced by the device- specific dev.IF.N.iflib.rx_budget along with the conversion to iflib(4). While at it, remove the - besides initialization of tx_process_limit - unused {r,t}x_process_limit members. (cherry picked from commit 0d6d28ce5650d1cd23dbe4bbac87fb103b3e2d3d)
* Add vnode_pager_clean_{a,}sync(9)Konstantin Belousov2024-01-1816-118/+82
| | | | (cherry picked from commit b068bb09a1a82d9fef0e939ad6135443a959e290)
* vnode_pager_generic_putpages(): rename maxblksz local to max_offsetKonstantin Belousov2024-01-181-7/+7
| | | | (cherry picked from commit ed1a88a3116a59b4fd37912099a575b4c8f559dc)
* vnode_pager_generic_putpages(): correctly handle clean block at EOFKonstantin Belousov2024-01-181-1/+2
| | | | | | PR: 276191 (cherry picked from commit bdb46c21a3e68d4395d6e0b6a205187e655532b0)
* ncl_bioread(): check for vp->v_object before accessing itKonstantin Belousov2024-01-171-6/+14
| | | | (cherry picked from commit 503f72a828c7d0d938ec73ffbf62406038c69d47)
* kern linker: Do not retry loading modules on EEXISTZhenlei Huang2024-01-151-1/+4
| | | | | | | | | | | | | | | | LINKER_LOAD_FILE() calls linker_load_dependencies() which will return EEXIST in case the module to be loaded has already been compiled into the kernel. Since the format of the module is now recognized then there is no need to retry loading with a different linker, otherwise the userland will get misleading error number ENOEXEC. PR: 274936 Reviewed by: dfr MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42474 (cherry picked from commit ecf710f0e04e3314a492747124166ccb7cf4019e) (cherry picked from commit e7fd435d3d4e888d9894d8c212c29ae6e2768f74)
* mii: Fix memory leak in micphy.Jiahao LI2024-01-151-0/+2
| | | | | | | PR: 270040 MFC after: 1 week (cherry picked from commit 9a622787244c4cda76d1509b0eae168bf4fd1952)
* puc: Add support for Exar XR17V354 Quad PCI Express UART.Teerayut Hiruntaraporn2024-01-151-0/+7
| | | | | | | PR: 257207 MFC after: 1 week (cherry picked from commit 5704277ae58b3498fbee2d041cd18d2444f5cf98)
* tcp: prevent spurious empty segments and fix uncommon panicRichard Scheffenegger2024-01-151-1/+9
| | | | | | | | | | | | | | | | | | Only try sending more data on pure ACKs when there is more data available in the send buffer. In the case of a retransmitted SYN not being sent due to an internal error, the snd_una/snd_nxt accounting could be off, leading to a panic. Pulling snd_nxt up to snd_una prevents this from happening. Reported by: fengdreamer@126.com Reviewed by: cc, tuexen, #transport MFC after: 1 week Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43343 (cherry picked from commit f4574e2dc5a4719379496338257526aba484751b)
* ena: Update driver version to v2.7.0Osama Abboud2024-01-141-2/+2
| | | | | | | | | | | | | | | | | | | Features: * Introduce customer and SRD metrics through sysctl * Introduce spreading IRQs to CPUs capability using sysctl * Upgrade ena-com to v2.7.0 Bug Fixes: * Remove outdated APIs Minor Changes: * Introduce a shared stats sample interval for all stats Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 4e2688cc762d94b190029f0c5efab9c4bb5521be)
* ena: Update the license dating to 2023Osama Abboud2024-01-1411-11/+11
| | | | | | | | | | | Some of the files are using outdated linceses. Update the license to be 2023. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 246aa273244e91a30d70997a3be790a29f9eb29c)
* ena: Support srd metrics with sysctlOsama Abboud2024-01-143-1/+86
| | | | | | | | | | | | This commit introduces SRD metrics through sysctl. The metrics can be queried using the following sysctl node: sysctl dev.ena.<device index>.ena_srd_info Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 36d42c862f4a5643f6e2395e8d7b7e5c4580499a)
* ena: Support customer metric with sysctlOsama Abboud2024-01-144-3/+135
| | | | | | | | | | | | This commit adds sysctl support for customer metrics. Different customer metrics can be found in the following sysctl node: sysctl dev.ena.<device index>.customer_metrics Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit f97993ad7b9c9e4787bd198d11f348c271af513e)
* ena: Introduce shared sample interval for all statsOsama Abboud2024-01-143-29/+29
| | | | | | | | | | | | | | | | | | | Rename sample_interval node to stats_sample_interval and move it up in the sysctl tree to make it clear that it's relevant for all the stats and not only ENI metrics (Currently, sample interval node is found under eni_metrics node). Path to node: dev.ena.<device_index>.stats_sample_interval Once this parameter is set it will set the sample interval for all the stats node including SRD/customer metrics. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 5b925280d9a54eaefd85827bf6e84049aea8fa98)
* ena: Remove CQ tail pointer update APIOsama Abboud2024-01-142-4/+0
| | | | | | | | | | | This commit removes the usage of this API from the freebsd driver since the relevant functionality is not supported by the device. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 2835752e075f2fa3edcb596df8306c570ec4cae6)
* ena: Update ena_com_update_intr_reg API usageOsama Abboud2024-01-142-2/+2
| | | | | | | | | | | This commit fixes the usage of this function to be compatible with the new API introduced by ena-com update to v2.7.0 Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 72e34ebdd08854dc896f267b0461e241c4040241)
* ena: Change measurement unit of time since last tx cleanup to msArthur Kiyanovski2024-01-141-2/+2
| | | | | | | | | | | | This commit: 1. Sets the time since last cleanup to milliseconds. 2. Fixes incorrect indentations. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 9272e45c04c0d4fcb5d767e962783f3ab192f64e)
* ena: Add sysctl support for spreading IRQsOsama Abboud2024-01-143-22/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit allows spreading IO IRQs over different CPUs through sysctl. Two sysctl nodes are introduced: 1- base_cpu: servers as the first CPU to which the first IO IRQ will be bound. 2- cpu_stride: sets the distance between every two CPUs to which every two consecutive IO IRQs are bound. For example for doing the following IO IRQs / CPU binding: IRQ idx | CPU ---------------- 1 | 0 2 | 2 3 | 4 4 | 6 Run the following commands: sysctl dev.ena.<device index>.irq_affinity.base_cpu=0 sysctl dev.ena.<device_index>.irq_affinity.cpu_stride=2 Also introduced rss_enabled field, which is intended to replace '#ifdef RSS' in multiple places, in order to prevent code duplication. We want to bind interrupts to CPUs in case of rss set OR in case the newly defined sysctl paremeter is set. This requires to remove a couple of '#ifdef RSS' as well in the structs, since we'll be using the relevant parameters in the CPU binding code. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit f9e1d9471077109c19fd7d6dc9c1d35432efdede)
* ena: Upgrade ena-com to freebsd v2.7.0Arthur Kiyanovski2024-01-1414-2750/+807
| | | | | | | | | | Merge commit '04cf7cee5ae0c6bb29eb21ce85bab7ca7386a95f' Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit adfed2d835a7f9382941896d15a487dac6fe659c)
* if_tuntap: fix NOIP buildGleb Smirnoff2024-01-121-9/+8
| | | | | | | | | | Note: this removes one TUNDEBUG() for the sake of not having one more ifdefed variable declaration and for the overall code brevity. The call from tuntap into LRO can be so easily traced with dtrace(1) that an 80-ish printf(9)-based debugging can be omitted. Fixes: 99c79cab422705f92f05a2924a29bdf823372ebf (cherry picked from commit 5b0010b4678d778967a5a82fb38507e46a071e38)
* if_tuntap: add LRO support to tap devicesMichael Tuexen2024-01-121-2/+29
| | | | | | | | | | This allows testing the LRO code with packetdrill in local mode. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42548 (cherry picked from commit 99c79cab422705f92f05a2924a29bdf823372ebf)
* if_tuntap: remove redundant checkMichael Tuexen2024-01-121-1/+1
| | | | | | | | eh can't be NULL, so there is no need to check for it. Reported by: zlei Sponsored by: Netflix, Inc. (cherry picked from commit 44669b76504991ef3ac10ef10bc0fa931ae79c45)
* if_tuntap: support receive checksum offloading for tap interfacesMichael Tuexen2024-01-121-3/+31
| | | | | | | | | | | | | | When enabled, pretend that the IPv4 and transport layer checksum is correct for packets injected via the character device. This is a prerequisite for adding support for LRO, which will be added next. Then packetdrill can be used to test the LRO code in local mode. Reviewed by: rscheff, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42477 (cherry picked from commit ff69d13a50d1d07601de0885fd94f6a09a7ba383)
* if_tuntap: trigger the bpf hook on transmitting for the tap interfaceMichael Tuexen2024-01-121-3/+12
| | | | | | | | | | | | | | The tun interface triggers the bpf hook when a packet is transmitted, the tap interface triggers it when the packet is read from the character device. This is inconsistent. So fix the tap device such that it behaves like the tun device. This is needed for adding support for the tap device to packetdrill. Reviewed by: kevans, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42467 (cherry picked from commit 35af22ac986c4f3e8160c943a478492e748b6f23)
* if_tuntap: improve code consistencyMichael Tuexen2024-01-121-2/+1
| | | | | | | | | | No functional change intended. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42462 (cherry picked from commit 4ffe410e40e90c265c20cb4675ed74a40dc1fcc4)
* sctp: minor cleanMichael Tuexen2024-01-121-72/+73
| | | | | | No functional change intended. (cherry picked from commit 3bbbfc8dcd3622b49907e359c8e9682def0bae25)
* udplite: make socketoption available on IPv6 socketsMichael Tuexen2024-01-121-0/+8
| | | | | | | | | | | | This patch allows the IPPROTO_UDPLITE-level socket options UDPLITE_SEND_CSCOV and UDPLITE_RECV_CSCOV to be used on AF_INET6 sockets in addition to AF_INET sockets. Reviewed by: ae, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42430 (cherry picked from commit 03c3a70abe5e9fa259b954de78ae69229fa9c99f)
* udplite: fix checksum computation on the sender sideMichael Tuexen2024-01-121-14/+15
| | | | | | | | | | Don't fill the fields of the UDP/IP header not used for the checksum computation before performing the checksum computation. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D42275 (cherry picked from commit aa64a8f5c35c13b1c325f1a4597c987a37bec5da)
* ffs/ffs_rawread.c: clean up includesKonstantin Belousov2024-01-111-13/+9
| | | | (cherry picked from commit 8a4577423e82c54942a9390658d059f1169187b1)
* nfsclient: limit situations when we do unlocked read-ahead by nfsiodKonstantin Belousov2024-01-111-2/+9
| | | | (cherry picked from commit 70dc6b2ce314a0f32755005ad02802fca7ed186e)
* vtruncbuf: improve the check for meta bufferKonstantin Belousov2024-01-111-1/+1
| | | | (cherry picked from commit 2d33ad48bd37f27925e4c46c798f8f2d23a2b501)
* vtruncbuf: add a comment explaining the purpose of the loopKonstantin Belousov2024-01-111-0/+3
| | | | (cherry picked from commit 4c41d10f1538c232174d5200d245e5fcd9936958)
* nfsclient: eliminate ncl_writebp()Konstantin Belousov2024-01-115-75/+2
| | | | (cherry picked from commit 656d2e83d9eef204c132f879d55782affede2ca9)
* nfsclient: flush dirty pages of the vnodeKonstantin Belousov2024-01-111-6/+39
| | | | | | PR: 276002 (cherry picked from commit 47ec00d9d6071bbb0ee5ed0bdca3c4a468334d9d)
* nfsclient copy_file_range(): flush dst vnode dataKonstantin Belousov2024-01-111-1/+1
| | | | | | PR: 276002 (cherry picked from commit 7dae1467d72ae1f5c8f7be0f7444da23a457d98b)
* mlx5(4): only detach IOV children if iov was successfully initializedKonstantin Belousov2024-01-112-3/+10
| | | | (cherry picked from commit 987446fa39e8f6887ea16ad49f00f699b2efd210)
* sysctl: Don't pass CTLFLAG_MPSAFE to SYSCTL_STRINGMark Johnston2024-01-112-10/+10
| | | | | | | | It is redundant. No functional change intended. MFC after: 1 week (cherry picked from commit 969fc091343e593f15f0f3326f65292b435423d5)
* identcpu: Let the hw.model be readable in capability modeMark Johnston2024-01-114-4/+4
| | | | | | | | | | | On some platforms this static information can be derived directly from the CPU, and there doesn't seem much use in restricting it. Reviewed by: emaste, imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit 0aba5dd2af57ea3ae90eb49d7745c4c5b6f0ab6b)
* linprocfs: Avoid using a sysctl to get the CPU model stringMark Johnston2024-01-111-10/+1
| | | | | | | | | | | | | This will fail if the reading process is in capability mode. Just copy the string directly. PR: 276043 Reviewed by: emaste, imp, kib Reported and tested by: Ricardo Branco <rbranco@suse.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit d74a742704eb81f0c6f4aa83e4cb0de26a81c400)
* x86: Make cpu_model[] publicMark Johnston2024-01-112-1/+2
| | | | | | | | | | No functional change intended. Reviewed by: emaste, imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43281 (cherry picked from commit d63ea03674007451682334fa3897918c5c3711a4)
* netinet: Define IPv6 ECN maskJose Luis Duran2024-01-111-0/+2
| | | | | | | | | | | | | | | | | | | | | Define a mask for the code point used for ECN in the Traffic Class field (2 bits) of an IPv6 header. BE: 0 0 3 0 0 0 0 0 Bit: 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| Traffic Class | Flow Label | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | For BE (Big Endian), or network-byte order, this corresponds to 0x00300000. For Little Endian, it corresponds to 0x00003000. Reviewed by: imp, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/879 (cherry picked from commit b0e13f785b336670bdf39b83a78435b00d00f43c)
* sctp: further improve shutting down the read side of a socketMichael Tuexen2024-01-111-6/+6
| | | | | | | | Deal with the case that the association is already gone. Reported by: syzbot+e256d42e9b390564530a@syzkaller.appspotmail.com (cherry picked from commit bb56b36d7188e004840294d0bd5dfdf7f3392a05)
* sctp: improve shutting down the read side of a socketMichael Tuexen2024-01-111-33/+57
| | | | | | | | | | When shutdown(..., SHUT_RD) or shutdown(..., SHUT_RDWR) is called, really clean up the read queue and issue an ungraceful shutdown if user messages are affected. Reported by: syzbot+d4e1d30d578891245f59@syzkaller.appspotmail.com (cherry picked from commit 81c5f0fac91dfae64205a6c4f9b2a469d1187372)
* sctp: don't call sctp_ulp_notify() recursivelyMichael Tuexen2024-01-111-2/+2
| | | | | | This does not work with the new locking scheme. (cherry picked from commit 1e81a4e7e89bb1870bec84e42284ad10505e957c)
* sctp: cleanup locking for notificationsMichael Tuexen2024-01-112-57/+87
| | | | | | | | | | All notifications are now queued via sctp_ulp_notify(). Do the locking of the inp read lock there and validate this in all functions being used. This is one step in avoiding race conditions when closing the read end of an SCTP socket. (cherry picked from commit f9425b3a85e9e211b61e11ce8115bf73674bdf49)
* sctp: make sure all SCTP RESET notifications use sctp_ulp_notify()Michael Tuexen2024-01-114-95/+86
| | | | | | | While there, improve consistency of the notification related code. No functional change intended. (cherry picked from commit 3ac7664774ad038b208cbb31eb52d1608efbd451)
* sctp: cleanup SCTP AUTH related notificationMichael Tuexen2024-01-113-26/+23
| | | | | | | | | This makes consistent use of the parameters and ensures that all SCTP AUTH related notifications are using sctp_ulp_notify(). No functional change intended. (cherry picked from commit cd3770c5feb038f3904fdb4aa04e09da122f74e3)
* sctp: cleanupMichael Tuexen2024-01-111-33/+27
| | | | | | | In particular, don't use a socket level flag, use the inp level one. After adding appropriate locking, this will close a race condition. (cherry picked from commit e40d16ad6ee952f315356ef091fa282f28fac0d5)