]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 months agomd.c: another style fix
Konstantin Belousov [Fri, 20 Jan 2023 02:39:36 +0000 (04:39 +0200)]
md.c: another style fix

(cherry picked from commit ad8feb1ed9996593df8b4b7259057c6e263aa130)

17 months agoHandle ERELOOKUP from VOP_FSYNC() in several other places
Konstantin Belousov [Wed, 18 Jan 2023 21:09:10 +0000 (23:09 +0200)]
Handle ERELOOKUP from VOP_FSYNC() in several other places

(cherry picked from commit 6189672e600814fec4cc165d25ae050fb2f3a999)

17 months agovm_object.c: minor style
Konstantin Belousov [Thu, 19 Jan 2023 18:32:16 +0000 (20:32 +0200)]
vm_object.c: minor style

(cherry picked from commit 70e1b11216c43e95118728f3684a1b8abc7034a1)

17 months agoif_ipsec(4): handle situations where there are no policy or SADB entry for if
Konstantin Belousov [Tue, 17 Jan 2023 01:59:56 +0000 (03:59 +0200)]
if_ipsec(4): handle situations where there are no policy or SADB entry for if

(cherry picked from commit b1d10b49e24a4fd3af80f8491cd95bd0766ca1f1)

17 months agoif_ipsec(4): protect against user supplying unknown address family
Konstantin Belousov [Tue, 17 Jan 2023 01:37:45 +0000 (03:37 +0200)]
if_ipsec(4): protect against user supplying unknown address family

(cherry picked from commit eac971545baa3857903e0107439f00d8438c5847)

17 months agoipsec.c: typos in the comment
Konstantin Belousov [Sat, 4 Sep 2021 13:42:33 +0000 (16:42 +0300)]
ipsec.c: typos in the comment

(cherry picked from commit 424f1296bd73f2661b556ddfdfb4bcc8f9df898a)

17 months agoRequire INVARIANTS and WITNESS if DEBUG_VFS_LOCKS is set
Konstantin Belousov [Sun, 15 Jan 2023 21:33:10 +0000 (23:33 +0200)]
Require INVARIANTS and WITNESS if DEBUG_VFS_LOCKS is set

Tested by: pho

(cherry picked from commit 0f80d5ebc898f487067a3f2232f9ab0a7b291277)

17 months agoffs_syncvnode(): avoid a LoR for SU
Konstantin Belousov [Sat, 7 Jan 2023 12:22:18 +0000 (14:22 +0200)]
ffs_syncvnode(): avoid a LoR for SU

Tested by: pho

(cherry picked from commit 6e1eabadcb1d554ab6c0ad8ce1d82f6748cc80b4)

17 months agomountd(8): Fix a typo in a source code comment
Gordon Bergling [Thu, 19 Jan 2023 13:23:51 +0000 (14:23 +0100)]
mountd(8): Fix a typo in a source code comment

- s/ingore/ignore/

(cherry picked from commit afc55510b1178ba94d2bdcef0eb666b10abcfc42)

17 months agoamd64: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:27:18 +0000 (14:27 +0100)]
amd64: Fix a common typo in source code comments

- s/comparision/comparison/

(cherry picked from commit 05187f2ffc79e5959762ab8ce7067b7b8a1cdfd9)

17 months agobsnmpget.1: Fix a typo in the man page
Gordon Bergling [Thu, 19 Jan 2023 13:18:52 +0000 (14:18 +0100)]
bsnmpget.1: Fix a typo in the man page

- s/ingore/ignore/

(cherry picked from commit 7a184a41c6a31a1dcf82c2e35446f96dde78dbce)

17 months agonfs: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:26:06 +0000 (14:26 +0100)]
nfs: Fix a common typo in source code comments

- s/ingore/ignore/

(cherry picked from commit 72e709040f3691911c7b58d5a14b4d19b276f478)

17 months agoextra_tcp_stacks: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:11:00 +0000 (14:11 +0100)]
extra_tcp_stacks: Fix a common typo in source code comments

- s/orginal/original/

(cherry picked from commit 73e994a99810edf519d85e96dcb4a56e57be25cc)

17 months agoip_gre: Fix a common typo in source code comments
Gordon Bergling [Thu, 19 Jan 2023 13:13:02 +0000 (14:13 +0100)]
ip_gre: Fix a common typo in source code comments

- s/addres/address/

(cherry picked from commit fa7de6dcb9b7314d4736f1fc21b3fdceefe34173)

17 months agong_hci: handle NG_HCI_M_PULLUP failure in le_advertizing_report
Ed Maste [Tue, 1 Nov 2022 13:55:22 +0000 (09:55 -0400)]
ng_hci: handle NG_HCI_M_PULLUP failure in le_advertizing_report

PR: 267396
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: takawata
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37228

(cherry picked from commit 05c0c99ea37f2558155f346769a00b4180cb59ed)

17 months agong_bt: Remove an unused variable.
John Baldwin [Fri, 8 Apr 2022 00:01:26 +0000 (17:01 -0700)]
ng_bt: Remove an unused variable.

Leave a comment describing the field in the packet it represented.

(cherry picked from commit 9f566782e0ba9973a78fd2405427b5de887ac213)

17 months agobhyve nvme: Fix uninitialized pointer
Chuck Tuffli [Thu, 9 Jun 2022 20:05:46 +0000 (13:05 -0700)]
bhyve nvme: Fix uninitialized pointer

The Dataset Management code could free an uninitialized pointer if the
device doesn't support the Dataset Management command.

PR: 264548
Reported by: Robert Morris <rtm@lcs.mit.edu>

(cherry picked from commit 7376c08cc67e65ee660d51873129e34745ef5dd4)

17 months agoopenssh: remove mention of now-unused svn:keywords
Ed Maste [Mon, 16 Jan 2023 14:52:00 +0000 (09:52 -0500)]
openssh: remove mention of now-unused svn:keywords

Reported by: gshapiro

(cherry picked from commit 9b7eddfeed465d4062dbad178261b806e97d6b62)

17 months agotests/sys/posixshm/posixshm_test.c: Fix build for real
Konstantin Belousov [Fri, 20 Jan 2023 13:02:12 +0000 (15:02 +0200)]
tests/sys/posixshm/posixshm_test.c: Fix build for real

Remove unused variables.  This is a direct commit to stable/13.

17 months agoRemove merge conflict leftovers
Konstantin Belousov [Fri, 20 Jan 2023 11:21:08 +0000 (13:21 +0200)]
Remove merge conflict leftovers

This is a direct commit to stable/13.

Reported by: Stefan Grundmann via https://github.com/freebsd/freebsd-src/pull/639

17 months agoStop cleaning MNT_LOCAL on unmount
Konstantin Belousov [Fri, 6 Jan 2023 16:38:44 +0000 (18:38 +0200)]
Stop cleaning MNT_LOCAL on unmount

Tested by: pho

(cherry picked from commit 1d9f3a37eb20305bfdd67788cfac5c51938226a4)

17 months agoi386: print trampoline disposition value for verbose boot
Konstantin Belousov [Fri, 6 Jan 2023 18:18:51 +0000 (20:18 +0200)]
i386: print trampoline disposition value for verbose boot

Tested by: pho

(cherry picked from commit 29bfaf1c6d8bc0a06aaa7e09363544769eade3c0)

17 months agoamd64 pmap.h: make it easier to use the header for other consumers
Konstantin Belousov [Wed, 4 Jan 2023 10:31:16 +0000 (12:31 +0200)]
amd64 pmap.h: make it easier to use the header for other consumers

Tested by: pho

(cherry picked from commit ad97b9bbfccdb36f17788033903b1dbf508fcb96)

17 months agoamd64: be more precise when enabling the AlderLake small core PCID workaround
Konstantin Belousov [Tue, 3 Jan 2023 10:13:07 +0000 (12:13 +0200)]
amd64: be more precise when enabling the AlderLake small core PCID workaround

Tested by: pho

(cherry picked from commit a2c08eba43a2c0ebeac7117f708fb9392022a300)

17 months agoMove INVLPG to pmap_quick_enter_page() from pmap_quick_remove_page().
Konstantin Belousov [Thu, 29 Dec 2022 20:48:51 +0000 (22:48 +0200)]
Move INVLPG to pmap_quick_enter_page() from pmap_quick_remove_page().

Tested by: pho

(cherry picked from commit 231d75568f169fe6adc30373c12512b992c5c672)

17 months agoamd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG
Konstantin Belousov [Mon, 10 Oct 2022 23:08:55 +0000 (02:08 +0300)]
amd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG

PR: 261169, 266145
Tested by: pho

(cherry picked from commit cde70e312c3fde5b37a29be1dacb7fde9a45b94a)

17 months agoamd64: identify small cores
Konstantin Belousov [Wed, 21 Dec 2022 11:04:14 +0000 (13:04 +0200)]
amd64: identify small cores

Tested by: pho

(cherry picked from commit 45ac7755a7c5d8508176b3d015bb27ff58485c80)

17 months agoUFSSUSPEND: unbusy mp in EDADLK case
Konstantin Belousov [Thu, 29 Dec 2022 22:09:57 +0000 (00:09 +0200)]
UFSSUSPEND: unbusy mp in EDADLK case

Tested by: pho

(cherry picked from commit a5ff86646ee4602a141a24eee95c1c60bb375030)

17 months agoufs/suspend: deny suspension if the calling process has a file from mp opened for...
Konstantin Belousov [Wed, 28 Dec 2022 18:14:52 +0000 (20:14 +0200)]
ufs/suspend: deny suspension if the calling process has a file from mp opened for write

PR: 267628, 267630
Tested by: pho

(cherry picked from commit 701b36961cbd2084c36eb828402d0ef89211d929)

17 months agoffs_suspend.c: clean up includes
Konstantin Belousov [Wed, 28 Dec 2022 18:17:53 +0000 (20:17 +0200)]
ffs_suspend.c: clean up includes

Tested by: pho

(cherry picked from commit 68912701700ca3230f3e2d4b7858a038f884a327)

17 months agoAdd descrip_check_write_mp() helper
Konstantin Belousov [Wed, 28 Dec 2022 18:13:01 +0000 (20:13 +0200)]
Add descrip_check_write_mp() helper

Tested by: pho

(cherry picked from commit 37b9fb169686e867987c8a1a9868f81137b9df2b)

17 months agotools/test/ptrace: update scescx to do remote getpid(2) on each SCX event
Konstantin Belousov [Fri, 2 Dec 2022 01:26:13 +0000 (03:26 +0200)]
tools/test/ptrace: update scescx to do remote getpid(2) on each SCX event

Tested by: pho

(cherry picked from commit 6403a140243d4f5377f589f93aeb44fe75ea8d59)

17 months agoptrace(2): document PT_SC_REMOTE
Konstantin Belousov [Fri, 2 Dec 2022 03:00:08 +0000 (05:00 +0200)]
ptrace(2): document PT_SC_REMOTE

Tested by: pho

(cherry picked from commit a98613f2389227effeb9d86e47e53ea01ecddfe5)

17 months agoFixes for ptrace_syscallreq()
Konstantin Belousov [Thu, 22 Dec 2022 23:51:34 +0000 (01:51 +0200)]
Fixes for ptrace_syscallreq()

Tested by: pho

(cherry picked from commit 974be51b3f6070f9aae02e115ea6099f90bc9175)

17 months agoptrace(2): add PT_SC_REMOTE remote syscall request
Konstantin Belousov [Wed, 30 Nov 2022 08:45:52 +0000 (10:45 +0200)]
ptrace(2): add PT_SC_REMOTE remote syscall request

Tested by: pho

(cherry picked from commit 140ceb5d956bb8795a77c23d3fd5ef047b0f3c68)

17 months agoptrace(2): explain how to select specific thread to operate on
Konstantin Belousov [Mon, 5 Dec 2022 22:43:18 +0000 (00:43 +0200)]
ptrace(2): explain how to select specific thread to operate on

Tested by: pho

(cherry picked from commit 0e07241c372d7352537a4a786c96a580a721be3c)

17 months agoAdd a thread debugging flag TDB_BOUNDARY
Konstantin Belousov [Thu, 1 Dec 2022 00:29:35 +0000 (02:29 +0200)]
Add a thread debugging flag TDB_BOUNDARY

Tested by: pho

(cherry picked from commit f0592b3c8dd8e172f0e7165c11371108d4d8838d)

17 months agosys: rename td_coredump to td_remotereq
Konstantin Belousov [Wed, 30 Nov 2022 08:48:24 +0000 (10:48 +0200)]
sys: rename td_coredump to td_remotereq

Tested by: pho

(cherry picked from commit e6feeae2f915c76275b83b7365ae966a8f8dd016)

17 months agocompat32: move struct ptrace_sc_ret32 definition from .c to .h
Konstantin Belousov [Thu, 1 Dec 2022 01:31:58 +0000 (03:31 +0200)]
compat32: move struct ptrace_sc_ret32 definition from .c to .h

Tested by: pho

(cherry picked from commit f081a291a17de0e28e5b7f5adba312f0dcb59b0f)

17 months agoposixshm_test: add naive page accounting test
Konstantin Belousov [Sat, 3 Dec 2022 22:54:36 +0000 (00:54 +0200)]
posixshm_test: add naive page accounting test

For MFC, the deallocation part of the test is disabled because it is
not merged to stable/13.

Tested by: pho

(cherry picked from commit 91ddfd352f59beb8262f98c2e8a22722207e5aa6)

17 months agoposixshm_test: small style fixes
Konstantin Belousov [Sat, 3 Dec 2022 22:54:13 +0000 (00:54 +0200)]
posixshm_test: small style fixes

Tested by: pho

(cherry picked from commit f1f030246f3e72af0ee3ba82a0e8b9f6d9559b69)

17 months agoposixshmcontrol(1): for regular shmfd, report used pages number
Konstantin Belousov [Wed, 23 Nov 2022 22:01:05 +0000 (00:01 +0200)]
posixshmcontrol(1): for regular shmfd, report used pages number

Tested by: pho

(cherry picked from commit 1bbc5101348b9ca23cef6bde6c22751e69e8cf91)

17 months agoshmfd: account for the actually allocated pages
Konstantin Belousov [Wed, 23 Nov 2022 21:26:38 +0000 (23:26 +0200)]
shmfd: account for the actually allocated pages

Tested by: pho

(cherry picked from commit 0919f29d91031cf42eca99266bffe7b0faef8f1b)

17 months agotmpfs_getattr(): Only take vm_object lock on 32bit machines
Konstantin Belousov [Sat, 17 Dec 2022 11:03:32 +0000 (13:03 +0200)]
tmpfs_getattr(): Only take vm_object lock on 32bit machines

Tested by: pho

(cherry picked from commit 4d903a1a74d9526aba4d177e89c10f97df5662f2)

17 months agotmpfs: for used pages, account really allocated pages, instead of file sizes
Konstantin Belousov [Thu, 20 Oct 2022 13:17:43 +0000 (16:17 +0300)]
tmpfs: for used pages, account really allocated pages, instead of file sizes

PR: 223015
Tested by: pho

(cherry picked from commit 37aea2649ff707f23d35309d882b38e9ac818e42)

17 months agovm_pager_allocate(): override resulting object type
Konstantin Belousov [Sun, 4 Dec 2022 00:37:28 +0000 (02:37 +0200)]
vm_pager_allocate(): override resulting object type

Tested by: pho

(cherry picked from commit cd086696c2cb6d23bac3bc749836d36a9280ae98)

17 months agovm_page_grab_valid(): clear *mp in case of pager denying page allocation
Konstantin Belousov [Sat, 17 Dec 2022 00:12:14 +0000 (02:12 +0200)]
vm_page_grab_valid(): clear *mp in case of pager denying page allocation

Tested by: pho

(cherry picked from commit 3249449190c2c71ecfc4fa5f518f94ff552df440)

17 months agovm_pager: add method to veto page allocation
Konstantin Belousov [Thu, 20 Oct 2022 13:15:46 +0000 (16:15 +0300)]
vm_pager: add method to veto page allocation

Tested by: pho

(cherry picked from commit ec201dddfbddd3a77dd3f3afc9b007d0e13e7ad1)

17 months agovm_pager: add methods for page insertion and removal notifications
Konstantin Belousov [Thu, 20 Oct 2022 12:55:38 +0000 (15:55 +0300)]
vm_pager: add methods for page insertion and removal notifications

Tested by: pho

(cherry picked from commit d537d1f12e8829faccd395115193b03b578f1176)

17 months agotmpfs: make vm_object point to the tmpfs node instead of vnode
Konstantin Belousov [Thu, 20 Oct 2022 12:00:21 +0000 (15:00 +0300)]
tmpfs: make vm_object point to the tmpfs node instead of vnode

Tested by: pho

(cherry picked from commit d9dc64f1589360f2062ad92d63f69e13121e472a)

17 months agoProvide consistent prototype for swp_pager_meta_free()
Konstantin Belousov [Fri, 9 Dec 2022 15:21:16 +0000 (17:21 +0200)]
Provide consistent prototype for swp_pager_meta_free()

Tested by: pho

(cherry picked from commit 645510e62e34d9af4c2d57c7a6443a494511918d)

17 months agoMake swap_pager_freespace() global
Konstantin Belousov [Wed, 26 Oct 2022 22:13:27 +0000 (01:13 +0300)]
Make swap_pager_freespace() global

Tested by: pho

(cherry picked from commit baa1ccceefdf4954a88e54ca18c6ab1762faa326)

17 months agoAdd 'show tmpfs' ddb command
Konstantin Belousov [Thu, 20 Oct 2022 14:30:00 +0000 (17:30 +0300)]
Add 'show tmpfs' ddb command

Tested by: pho

(cherry picked from commit 83aff0f08c525ea3c394f3dd6598665cd369d53c)

17 months agotmpfs: minor style
Konstantin Belousov [Mon, 24 Oct 2022 13:30:38 +0000 (16:30 +0300)]
tmpfs: minor style

Tested by: pho

(cherry picked from commit e77f2f9dc683bb5ac725c5844fc36c831138e841)

17 months agouiomove_object: hide diagnostic under bootverbose
Konstantin Belousov [Sun, 23 Oct 2022 11:36:17 +0000 (14:36 +0300)]
uiomove_object: hide diagnostic under bootverbose

Tested by: pho

(cherry picked from commit 7ec4b29b086b67b8c778d2bc50c90e9e0655c03e)

17 months agorouting: Use NET_EPOCH_[CALL|WAIT] macros
Zhenlei Huang [Wed, 21 Dec 2022 01:33:31 +0000 (09:33 +0800)]
routing: Use NET_EPOCH_[CALL|WAIT] macros

Reviewed by: melifaro, kp
Differential Revision: https://reviews.freebsd.org/D37729

(cherry picked from commit 73336a6fd85b0267cebdbe1c91dc009a5ef8059e)

17 months agolio: Remove unneeded include
Zhenlei Huang [Wed, 21 Sep 2022 20:52:00 +0000 (14:52 -0600)]
lio: Remove unneeded include

Reviewed by: adiran, imp
Differential Revision: https://reviews.freebsd.org/D36501

(cherry picked from commit d819ddba9aa458f6e91df059426d9a2f1ac0b92d)

17 months agoLINT: Omit bnxt on i386
Warner Losh [Thu, 19 Jan 2023 15:31:51 +0000 (08:31 -0700)]
LINT: Omit bnxt on i386

bnxt is broken on i386, so omit it from all the LINT builds.

Sponsored by: Netflix

17 months agox86: ignore stepping for APL30 errata
Corvin Köhne [Tue, 9 Aug 2022 07:07:59 +0000 (09:07 +0200)]
x86: ignore stepping for APL30 errata

The issue is present in all apollolake cpus and it doesn't look like
there'll be a fix in the future.

See
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/pentium-celeron-n-series-j-series-datasheet-spec-update.pdf

MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37621

(cherry picked from commit 122405c9034b624dd6771d578ef2467aa96cc145)

x86: Remove redundant parentheses

Reported by: avg
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week
MFC-With: b223c1f1a0ac ("x86: Add another cpuid for Apollo Lake errata APL30")

(cherry picked from commit 821b850a3bb73a78eef97ea22d1dc6ea82195b65)

x86: Add another cpuid for Apollo Lake errata APL30

Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week

(cherry picked from commit b223c1f1a0ac83a3bd1475add9b794bad1749b2f)

17 months agobnxt: Only filter out i386
Warner Losh [Sat, 5 Nov 2022 04:35:37 +0000 (22:35 -0600)]
bnxt: Only filter out i386

Only i386 is missing bus_read_8. The other 32-bit platforms can be fixed
with a cast to a printf.

Suggested by: kevans
Sponsored by: Netflix

(cherry picked from commit eb40e3e757a7eb80c2b5c38ce05fc4b411b369f9)

17 months agoif_bnxt: Added support for mgmt interface for passthrough hwrms
Sumit Saxena [Fri, 4 Nov 2022 22:40:29 +0000 (16:40 -0600)]
if_bnxt: Added support for mgmt interface for passthrough hwrms

Added support for application management interface. There are two types of commands supported:

1. Firmware IOCTLs: These ioctls are meant for firmware
   consumption. Driver acts as a transport for these.
2. Driver only IOCTLs: These ioctls are meant for driver
   consumption. Driver will serve these ioctls without sending them down
   to firmware.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36448

(cherry picked from commit 58d84ef87094691bf1ad9608964ec85f120cd34a)

17 months agoif_bnxt: Add support for smaller backing_store_cfg message size
Sumit Saxena [Fri, 4 Nov 2022 22:33:21 +0000 (16:33 -0600)]
if_bnxt: Add support for smaller backing_store_cfg message size

Add compat logic to fallback to the older/smaller backing_store_cfg
message size.

Reviewed by: imp
Differentil Revision: https://reviews.freebsd.org/D36447

(cherry picked from commit 2ed061f08d9e2fe35bb8ff925cc19768d2430e77)

17 months agoif_bnxt: Fix the PORT_PHY_CFG HWRM requests while setting Pause
Sumit Saxena [Fri, 4 Nov 2022 22:31:24 +0000 (16:31 -0600)]
if_bnxt: Fix the PORT_PHY_CFG HWRM requests while setting Pause

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36446

(cherry picked from commit 19a57f85baac915a3642733c8a856517f4e95cb3)

17 months agoif_bnxt: Fix the issue when kernel invokes _init() again without _stop()
Sumit Saxena [Fri, 4 Nov 2022 22:28:51 +0000 (16:28 -0600)]
if_bnxt: Fix the issue when kernel invokes _init() again without _stop()

Fixed the issue when kernel invokes _init() when it is already in
_init() state by invoking _stop() in such case.

Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D36445

(cherry picked from commit baef1301a2bc60be3908f44dff1f83dbbd8f812a)

17 months agoif_bnxt: Remove sysctl node vlan_only which is not being used
Sumit Saxena [Fri, 4 Nov 2022 22:26:03 +0000 (16:26 -0600)]
if_bnxt: Remove sysctl node vlan_only which is not being used

Removed sysctl node vlan_only which is not being used after migrating
from l2_set_rx_mask to l2_filter_alloc.

Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D36444

(cherry picked from commit 72e9dbb58cad5262190cf2eae47f764021072128)

17 months agoif_bnxt: Add support for VLAN on Thor
Sumit Saxena [Fri, 4 Nov 2022 22:24:32 +0000 (16:24 -0600)]
if_bnxt: Add support for VLAN on Thor

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36443

(cherry picked from commit 91fcacc355971f74aa26fc7861020dc3a2a2d717)

17 months agoif_bnxt: Add support for RSS on Thor
Sumit Saxena [Fri, 4 Nov 2022 22:21:20 +0000 (16:21 -0600)]
if_bnxt: Add support for RSS on Thor

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36442

(cherry picked from commit cfdca95f7834d2c10749fb14e12495d8aa7d1be0)

17 months agoif_bnxt: Display firmware version along with SIT package version
Sumit Saxena [Fri, 4 Nov 2022 22:18:38 +0000 (16:18 -0600)]
if_bnxt: Display firmware version along with SIT package version

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36441

(cherry picked from commit 6033382aab2e6108e6faa273fd945274e161cd5b)

17 months agoif_bnxt: Add support for async link status update
Sumit Saxena [Fri, 4 Nov 2022 22:14:49 +0000 (16:14 -0600)]
if_bnxt: Add support for async link status update

Reivewed by: imp
Differential Revision: https://reviews.freebsd.org/D36440

(cherry picked from commit fb4b7e02d236c2c06a87fc3dacd8af6bcfbfb5c1)

17 months agoif_bnxt: Add support for admin down/up and jumbo
Sumit Saxena [Fri, 4 Nov 2022 22:11:10 +0000 (16:11 -0600)]
if_bnxt: Add support for admin down/up and jumbo

Make ifconfig up/down work, as well as adding support for jumbo frames.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36439

(cherry picked from commit 055196a7d777509bebab0e718a0d333cf2660178)

17 months agoif_bnxt: add support for Thor controller
Sumit Saxena [Fri, 4 Nov 2022 22:05:57 +0000 (16:05 -0600)]
if_bnxt: add support for Thor controller

Added support for Thor controller.
Below are the supported operations:

1. IPv4 ping (ICMP)
2. iperf / netperf (IPv4 TCP)
3. Promiscuous (tcpdump)
4. Can achieve 20 Gbps on a 25 G link (Uni-Di)
5. Can achieve 60 Gbps on a 100 G link (Uni-Di)
6. Port level and queue level driver stats.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36438

(cherry picked from commit 8945584f93ee3689c90fd6b6ee6d824381813ef2)

17 months agoif_bnxt: Convert all doorbell writes into function pointers
Sumit Saxena [Fri, 4 Nov 2022 22:01:30 +0000 (16:01 -0600)]
if_bnxt: Convert all doorbell writes into function pointers

This is preparatory patch for making a base for Broadcom's Thor
controller support. It converts all doorbell writes into function
pointers.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36437

(cherry picked from commit 49a3df78c75f29dfa4991314535c0eac4f5a73fa)

17 months agoif_bnxt: update hsi_struct_def.h headers
Sumit Saxena [Fri, 4 Nov 2022 21:56:50 +0000 (15:56 -0600)]
if_bnxt: update hsi_struct_def.h headers

Updates the drivers to Broadcom's latest:
HWRM Version 1.10.2.34 using HSI definition version 1.8.4

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36436

(cherry picked from commit 97315f68fe87ae391d2dd2f8c636beac9754ab73)

17 months agobnxt: Remove unused devclass argument to DRIVER_MODULE.
John Baldwin [Mon, 9 May 2022 19:22:00 +0000 (12:22 -0700)]
bnxt: Remove unused devclass argument to DRIVER_MODULE.

(cherry picked from commit 64d3221c61122b9a6a73f107c8145e92b47eb4c8)

17 months agobnxt: Remove dead write to cp_ring_id
Warner Losh [Mon, 28 Feb 2022 17:13:27 +0000 (10:13 -0700)]
bnxt: Remove dead write to cp_ring_id

Since this is read from memory, reading it and then ignoring it is dead
code...

Sponsored by: Netflix

(cherry picked from commit 44b4f0370fe90d11306e9d3fdcacdc5b4ccc946e)

17 months agoxdr: store chars consistently
Brooks Davis [Wed, 18 Jan 2023 19:13:15 +0000 (19:13 +0000)]
xdr: store chars consistently

Cast char's through unsigned char before storing as an integer in
xdr_char(), this ensures that the encoded form is consistently not
sign-extended following Open Solaris's example.

Prior to this change, platforms with signed chars would sign extend
values with the high bit set but ones with unsigned chars would not
so 0xff would be stored as 0x000000ff on unsigned char platforms and
0xffffffff on signed char platforms.  Decoding has the same
result for either form so this is a largely cosmetic change, but it
seems best to produce consistent output.

For more discussion, see https://github.com/openzfs/zfs/issues/14173

Reviewed by: mav, imp
Differential Revision: https://reviews.freebsd.org/D37992

(cherry picked from commit a872c37054172f3f7a03aef263ca5886a749771f)

17 months agoLinuxKPI: add (skeleton) functions to make drivers compile
Bjoern A. Zeeb [Sat, 3 Dec 2022 23:00:04 +0000 (23:00 +0000)]
LinuxKPI: add (skeleton) functions to make drivers compile

Add more functions to netdevice.h (netif_napi_add_tx() being the only
one implemented) and add platform_device.h and netlink.h in order to
make driver code compile.
The skeleton functions are used only in very limited scope and not at
all in our usage so far but add (invasive) #ifdef if removed.
Add pr_debug() calls to each of them in order to log a TODO (if DEBUG
compiled in) and someone should hit them in the future.

Commented on by: hselasky (earlier version)
Differential Revision: https://reviews.freebsd.org/D37599

(cherry picked from commit 75388b9ca5e566fb7cbd62a37cea1f66d8203fc6)

17 months agoLinuxKPI: pci: add [linuxkpi_]pci_get_device()
Bjoern A. Zeeb [Fri, 2 Dec 2022 22:14:09 +0000 (22:14 +0000)]
LinuxKPI: pci: add [linuxkpi_]pci_get_device()

Add a version of pci_get_device() as linuxkpi_pci_get_device()
not (yet) supporting the last argument.
Due to conflicts we cannot redefine it as we would normally do
in LinuxKPI so drivers have to be adjusted.

Differential Revision: https://reviews.freebsd.org/D37593

(cherry picked from commit 8f61992d7cc1108cebc1337451a15a0af420984c)

17 months agoLinuxKPI: fix pci_alloc_irq_vectors() for MSI
Bjoern A. Zeeb [Mon, 28 Nov 2022 18:05:48 +0000 (18:05 +0000)]
LinuxKPI: fix pci_alloc_irq_vectors() for MSI

pci_alloc_irq_vectors() is given a min and max vector value.
pci_enable_msi() will always succeed independent of these arguments as
it does not know about them.  Further it will only ever allocate
1 "vector" not supporting any other amount.
So upfront check that (a) the available pci_msi_count() can satisfy the
requested minv and (b) given the pci_enable_msi() hard coded limit check
that minv is not larger than 1.
If we cannot satisfy either requirement return an error.

This fixes problems with drivers which check that the returned value
of allocated "vectors" will match their requests and only otherwise try
to fall back to ask for 1 or deal otherwise.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky (earlier version)
Differential Revision: https://reviews.freebsd.org/D37522

(cherry picked from commit e9715b1c4474333ff119aba3a9a74bff91f72372)

17 months agoLinuxKPI: add kstrtou32_from_user() and mac_pton()
Bjoern A. Zeeb [Sat, 22 Oct 2022 18:02:58 +0000 (18:02 +0000)]
LinuxKPI: add kstrtou32_from_user() and mac_pton()

While here:
- fix an argument of kstrtouint_from_user() to correct signedness.
- make kstrtou32() call kstrtouint() to avoid duplication (keep inline
  function)

Add kstrtou32_from_user() based on other examples in the file
making it a copy of the now fixed kstrtouint_from_user().

Also add a rudimentarily hacked up version of mac_pton() which is
leanient accepting non-well-formed input but so far only with ':'
separators.  It does not seem to obviously belong to any networking
header file so add it here.

Both new functions are needed for debugfs support for iwlwifi hence
coming together in one commit.

Sponsored by: The FreeBSD Foundation
Commented on by: emaste
Differential Revision: https://reviews.freebsd.org/D37088

(cherry picked from commit f82cf28b317b6b3ffd1418ab9c5b230145da8f75)

17 months agortw88: use #define for NL80211_BAND_2GHZ instead of hardcoded number
Bjoern A. Zeeb [Fri, 13 Jan 2023 01:05:01 +0000 (01:05 +0000)]
rtw88: use #define for NL80211_BAND_2GHZ instead of hardcoded number

Use NL80211_BAND_2GHZ instead of a hard coded 0 as array index for the
band.  While LinuxKPI provides a KPI compatibility some of these values
may not necessarily be KBI compatible (in this case they shoule be so
this is a NOP) and after all it is better style.

No functional change.

(cherry picked from commit 8aaefd0512daea0f9869cd2fe3cee9443d5fb6aa)

17 months agoiwlwifi: mark a declaration for a non-existent function
Bjoern A. Zeeb [Fri, 13 Jan 2023 01:00:00 +0000 (01:00 +0000)]
iwlwifi: mark a declaration for a non-existent function

iwl_trans_pcie_send_hcmd() does not seem to exist (anymore).  Mark it
as __linux__ so we can submit the cleanup with the next upstream run.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit f797d5f37089de8134b4599bb033635ac7d07bef)

17 months agoLinuxKPI: 802.11: implement some *eleme/ie* lookup functions
Bjoern A. Zeeb [Sat, 31 Dec 2022 01:33:28 +0000 (01:33 +0000)]
LinuxKPI: 802.11: implement some *eleme/ie* lookup functions

Implement cfg80211_find_elem(), ieee80211_bss_get_elem(),
ieee80211_bss_get_ie(), and cfg80211_find_vendor_ie() with the last
one having a short cut always also checking oui_type in the pattern.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5db817d864241232c51d654836996282c69f5e28)

17 months agoLinuxKPI: 802.11: move ieee80211_{unregister,restart}_hw out of header
Bjoern A. Zeeb [Sat, 31 Dec 2022 02:24:23 +0000 (02:24 +0000)]
LinuxKPI: 802.11: move ieee80211_{unregister,restart}_hw out of header

Migrate the two functions from the header into the implementation file
in order to have access to more facilities and not to run into possible
allocation/locking/... problems in the future.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4b0af114370a5cb876012c381d3156c8fbdf7f40)

17 months agoLinuxKPI; 802.11: update mac80211.h structures and fields
Bjoern A. Zeeb [Sat, 31 Dec 2022 02:15:28 +0000 (02:15 +0000)]
LinuxKPI; 802.11: update mac80211.h structures and fields

Cleanup some fields and structures and add new ones.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit c990500bf1028d55cdd370037c78ea808956e0fc)

17 months agoLinuxKPI: 802.11: implement ieee80211_get_hdrlen_from_skb()
Bjoern A. Zeeb [Sat, 31 Dec 2022 02:02:01 +0000 (02:02 +0000)]
LinuxKPI: 802.11: implement ieee80211_get_hdrlen_from_skb()

Implement ieee80211_get_hdrlen_from_skb() doing basic sanity checks
on lengths (minimal length or skb data length vs. header length).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 339119949660916aa40b1d67dbe002dd7eb0d709)

17 months agoLinuxKPI: 802.11: set sta supported legacy rates
Bjoern A. Zeeb [Sat, 31 Dec 2022 00:33:34 +0000 (00:33 +0000)]
LinuxKPI: 802.11: set sta supported legacy rates

When initializing the sta set the per-band supported legacy rates
as some drivers take the information from there.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit b6b352e4c7125e7d85ba382f05b1bad8454b6233)

17 months agoLinuxKPI: 802.11: implement cfg80211_{get,put}_bss
Bjoern A. Zeeb [Sat, 31 Dec 2022 01:18:16 +0000 (01:18 +0000)]
LinuxKPI: 802.11: implement cfg80211_{get,put}_bss

Implement cfg80211_{get,put}_bss currently doing malloc/free bits,
so hopefully the drivers get the calls right.

cfg80211_get_bss() sets up a lookup structure which may also take a
result (first hit wins) and calls ieee80211_scan_iterate() comparing
the various values in the iterator funcion.  Some of the checks are
partially pointless (as it seems the drivers are not interested in
these parts [ANY] but we keep them for documentation purposes should
futher values arise in the future).

We currently only iterate over the first VAP which will do for now.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5edde07c2aba02d0f7d30bbb0f203ec3e920e273)

17 months agoLinuxKPI: 802.11: implement cfg80211_get_ies_channel_number()
Bjoern A. Zeeb [Sat, 31 Dec 2022 01:59:20 +0000 (01:59 +0000)]
LinuxKPI: 802.11: implement cfg80211_get_ies_channel_number()

Using the previous changes implement cfg80211_get_ies_channel_number()
either based on DSPARMS (or for the future HTINFO).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 13d87d92e401523f8d8e817720d40dc31cdfa444)

17 months agoLinuxKPI: add simplified version of page_frag_cache
Bjoern A. Zeeb [Sat, 3 Dec 2022 00:33:34 +0000 (00:33 +0000)]
LinuxKPI: add simplified version of page_frag_cache

For the moment and the currently only consumer (mt76) add a simplified
version of the page_frag_cache.  We will only accept fragement sizes up
to 1 PAGE_SIZE (KASSERT) and we will always return a full page.
Should we add more consumers or small (or large) objects would become a
problem we can always add a more elaborate version.

Discussed with: markj
Reviewed by: markj (,hselasky commented as well)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D37595

(cherry picked from commit 55038a6306a570c9f2df89f5ad076de0f7d98152)

LinuxKPI: fix possible NULL dereference in linuxkpi_page_frag_alloc()

Reported by: Coverity via emaste
Coverity ID: 1502345
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 51e94a4658d23016dd0ae67c189a89f53281cbcd)

17 months agoLinuxKPI: pm.h add pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS
Bjoern A. Zeeb [Mon, 28 Nov 2022 22:31:28 +0000 (22:31 +0000)]
LinuxKPI: pm.h add pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS

Extend pm.h by pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS().
For the moment this duplicates some parts (as can be seen in the earlier
review I tried to simplify bits but given our implementation this
was easier in the end).

While here and cleanup the SIMPLE_DEV_PM_OPS() bits (white-space only).

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D37527

(cherry picked from commit 4052b0e4b218f916b1f491a5ec9e41d38029215b)

17 months agoLinuxKPI: pci.h add more MSI related constanst and pci_is_enabled()
Bjoern A. Zeeb [Mon, 31 Oct 2022 22:14:10 +0000 (22:14 +0000)]
LinuxKPI: pci.h add more MSI related constanst and pci_is_enabled()

Add more MSI related constansts defined to our native defines and
pci_is_enabled().  All are needed for another wireless driver.

Differential Revision: https://reviews.freebsd.org/D37225

(cherry picked from commit 5f2f582ccceec8729ee85bf191a2f7373c2994a4)

17 months agoLinuxKPI,lindebugfs: add u8 base type and blob support
Bjoern A. Zeeb [Sat, 22 Oct 2022 18:12:16 +0000 (18:12 +0000)]
LinuxKPI,lindebugfs: add u8 base type and blob support

Add debugfs_create_u8() based on other already present implementations.
Add a read-only implementation for debugfs_create_blob().

Both are needed for iwlwifi debugfs support.

Sponsored by: The FreeBSD Foundation
OKed by: jfree (earlier version)
Differential Revision: https://reviews.freebsd.org/D37090

(cherry picked from commit 0fce2dc1573019d0732f33fa7c26cc228655d3e8)

17 months agoLinuxKPI: SKB: implement skb_peek()
Bjoern A. Zeeb [Mon, 28 Nov 2022 18:47:08 +0000 (18:47 +0000)]
LinuxKPI: SKB: implement skb_peek()

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ce9f36610ea9ff29d42a2bcfed44b020c2e56dcb)

17 months agortw88: correct SRCS+= in Makefile
Bjoern A. Zeeb [Mon, 28 Nov 2022 15:48:44 +0000 (15:48 +0000)]
rtw88: correct SRCS+= in Makefile

Properly spell a SRCS+= for an optional file (this is why it stayed
unnoticed so far).

(cherry picked from commit 4495b4eb510d87277ed2dd4d27f7cebc7a76b4a8)

17 months agoLinuxKPI: 802.11: minor header updates
Bjoern A. Zeeb [Mon, 28 Nov 2022 21:21:06 +0000 (21:21 +0000)]
LinuxKPI: 802.11: minor header updates

- add comments for enum values constantly looked up, and another one to
  a net80211 equivalent (should possibly re-define those in the future?)
- add another nl80211_sta_info flag
- add enum environment_cap used in cfg80211.h in the future.

(cherry picked from commit 69cc1630014b7c50f754f5d49cfd4ed2905a5c48)

17 months agoLinuxKPI: ethtool.h add more definitions
Bjoern A. Zeeb [Sun, 30 Oct 2022 17:07:49 +0000 (17:07 +0000)]
LinuxKPI: ethtool.h add more definitions

While we do not currently use ethtool, add the definitions to avoid
other longer-term maintenance problems with drivers.

Also migrate ETH_GSTRING_LEN into here from if_ether.h as it seems this
is where it belongs.

Differential Revision: https://reviews.freebsd.org/D37214

(cherry picked from commit 1b91eba37b294fd191a9dc79a80f52495af9418d)

17 months agoLinuxKPI: add a no-op generic_file_llseek()
Bjoern A. Zeeb [Sat, 22 Oct 2022 20:27:42 +0000 (20:27 +0000)]
LinuxKPI: add a no-op generic_file_llseek()

This is needed for debugfs implementations in drivers.

Sponsored by: The FreeBSD Foundation
OKed by: jfree
Differential Revision: https://reviews.freebsd.org/D37092

(cherry picked from commit af393426b321e885d1db5f0a0571f34969a59a9f)

17 months agoLinuxKPI: iwlwifi: rtw88: rtw89: remove budget argument from netif_napi_add()
Bjoern A. Zeeb [Mon, 28 Nov 2022 15:12:58 +0000 (15:12 +0000)]
LinuxKPI: iwlwifi: rtw88: rtw89: remove budget argument from netif_napi_add()

In preparation for future updates remove the budget argument from the
netif_napi_add() in drivers and update LinuxKPI to reflect that it is
gone and only set it internally.  This required changes to the currently
committed wireless drivers based on LinuxKPI (iwlwifi, rtw88, rtw89).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 23c73dbae7b2f64014b275643efbe92f449feaa2)

17 months agoLinuxKPI: SKB update
Bjoern A. Zeeb [Mon, 28 Nov 2022 20:54:57 +0000 (20:54 +0000)]
LinuxKPI: SKB update

- skb_reset_tail_pointer(): we do not do offsets so do a plain reset
- skb_add_rx_frag(): adjust data_len to keep track of the frag
- based on that implement skb_is_nonlinear() and skb_linearize()
- implement build_skb() and adjust linuxkpi_kfree_skb() and ddb macro.

Sponsored by: The FreeBSD Foundation (partially)

(cherry picked from commit 5504bd59a39ba0bd0014308ff1aa5d4899432a3e)