History log of /freebsd/sys/compat/linuxkpi/common/src/linux_skbuff.c (Results 1 – 15 of 15)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# cd649cfc 23-Apr-2025 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: re-add __LP64__ check

Re-add one __LP64__ check for case 2 (36bit upper limit to contigmalloc)
to fix the build.
contigmalloc(9) takes a vm_paddr_t argument but on armv7 and some p

LinuxKPI: skbuff: re-add __LP64__ check

Re-add one __LP64__ check for case 2 (36bit upper limit to contigmalloc)
to fix the build.
contigmalloc(9) takes a vm_paddr_t argument but on armv7 and some powerpc
we are still at 32bit there so the constant value would be changed
from long long to uint (-Wconstant-conversion).

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reported by: CI
Fixes: e6c91f8e5be66

show more ...


# e6c91f8e 22-Apr-2025 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: rewrite data allocation to use __kmalloc by default

Put tunable/contigmalloc code under SKB_DMA32_MALLOC and remove the
__LP64__ checks for simplicity. #define SKB_DMA32_MALLOC to

LinuxKPI: skbuff: rewrite data allocation to use __kmalloc by default

Put tunable/contigmalloc code under SKB_DMA32_MALLOC and remove the
__LP64__ checks for simplicity. #define SKB_DMA32_MALLOC to be set
so that the code stays enabled as busdma still has trouble bouncing
contiguous memory with nseg=1 if it is multiple pages.

Switch the other code to use __kmalloc() which now automatically
provides physically contiguous memory and deals with freeing as well.
This code should in theroy be enough now.

If people use iwlwifi(4) pre-22000 (9xxx 8xxx ...) chipsets on Laptops
with more than 64GB of memory they may see bounce errors as well now.

Sposnored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 43ffd0f5 22-Apr-2025 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: switch to using uma for the skb

Split allocating the skb header and its payload data memory into skb
header from uma and the data to whatever we used to do for it.

This is a first

LinuxKPI: skbuff: switch to using uma for the skb

Split allocating the skb header and its payload data memory into skb
header from uma and the data to whatever we used to do for it.

This is a first step which should allow us to one day at least in the
RX path take the data, attach it to an mbuf and send it up the stack
and just free the skbuff header.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 73e3969f 22-Apr-2025 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: remove _alloc_len field

Initially we saved the exact allocation length for contigfree(9).
contigfree can now be replaced by free(9) so there is no need to
remember that value anymo

LinuxKPI: skbuff: remove _alloc_len field

Initially we saved the exact allocation length for contigfree(9).
contigfree can now be replaced by free(9) so there is no need to
remember that value anymore. Removing it also simplifies the
linuxkpi_kfree_skb() code.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0
# 2ab4a419 22-Feb-2025 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: add synchronization primitives and missing bits

Make a pass over skbuff.h:
- implement some missing bits,
- sprinkle some const,
- add locking and read/write_once calls as needed t

LinuxKPI: skbuff: add synchronization primitives and missing bits

Make a pass over skbuff.h:
- implement some missing bits,
- sprinkle some const,
- add locking and read/write_once calls as needed to provide
synchronization as expected by Linux,
- fix some typos,
- remove return from void functions,
- adjust tracing macros.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
PR: 283903 (rtw88 skb leak)
Tested by: Guillaume Outters (guillaume-freebsd outters.eu)
Differential Revision: https://reviews.freebsd.org/D49101

show more ...


Revision tags: release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


Revision tags: release/13.2.0, release/12.4.0
# 5504bd59 28-Nov-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

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()

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)
MFC after: 3 days

show more ...


# 89c32daf 29-Jul-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: sort list header and add new (dummy) functions

While working on new and updates to drivers more skbuff changes
came up. Sort out the list/prev/next header problem and add more
(so

LinuxKPI: skbuff: sort list header and add new (dummy) functions

While working on new and updates to drivers more skbuff changes
came up. Sort out the list/prev/next header problem and add more
(so far dummy) functions needed.

MFC after: 1 week

show more ...


Revision tags: release/13.1.0
# 6a501570 05-May-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: add memlimit tunable for 64bit systems

Some drivers, such as Realtek's rtw88, require 32bit DMA in
a single segment. busdma(9) has a hard time providing this
currently for 3-ish p

LinuxKPI: skbuff: add memlimit tunable for 64bit systems

Some drivers, such as Realtek's rtw88, require 32bit DMA in
a single segment. busdma(9) has a hard time providing this
currently for 3-ish pages at large quantities
(see lkpi_pci_nseg1_fail in linux_pci.c e86707418c8e8).
Work around this for now by allowing a tunable to enforce
physical addresses allocation limits on 64bit platforms (ignoring PAE)
using "old-school" contigmalloc(9) to avoid bouncing.

A patch needing a custom kernel compiled was tested in the last weeks
by rtw88 users providing the 32bit limit only hardcoded. The 36bit
limit can be found in iwlwifi so is added as a testing option along.

This is put in as a bandaid for now, so people no longer need to patch
and compile their own kernels to use rtw88 and to allow us to MFC the
driver as well before the amounts of commits to track increases by
much more.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 349b042b 15-Apr-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: start implementing skb_copy()

Implement skb_copy() with omissions of fragments and possibly other fields
for now. Should we hit frags at any point a log message will let us know.

LinuxKPI: skbuff: start implementing skb_copy()

Implement skb_copy() with omissions of fragments and possibly other fields
for now. Should we hit frags at any point a log message will let us know.
For the few cases we need this currently this is enough.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 9df5f29c 07-Apr-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: handle dev_alloc_skb() correctly

dev_alloc_skb() comapred to alloc_skb() reserves some headroom
at the beginning of the skb which is used by drivers.
Split the code for the two cas

LinuxKPI: skbuff: handle dev_alloc_skb() correctly

dev_alloc_skb() comapred to alloc_skb() reserves some headroom
at the beginning of the skb which is used by drivers.
Split the code for the two cases and reserve NET_SKB_PAD space,
which should at least be 32 octets.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 6a8973c3 23-Mar-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff: fix skb_queue_splice_init()

In skb_queue_splice_init() we set a next value and then used that new
value to further update the remaining linking rather than the original
value. Int

LinuxKPI: skbuff: fix skb_queue_splice_init()

In skb_queue_splice_init() we set a next value and then used that new
value to further update the remaining linking rather than the original
value. Introduce another temporary variable 'n' to hold the original
value and use that.
While here rename q and h to from and to as otherwise it was too
confusing to read.

Also initialize skb->prev and skb->next to point to skb itself if
for nothing else at least to aid debugging.

Reported by: phk (panic in iwl_txq_reclaim)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 6baea331 16-Feb-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: skbuff updates

Various updates to skbuff for new/updated drivers and some housekeeping:
- update types and struct members, add new (stub) functions
- improve freeing of frags.
- fix an iss

LinuxKPI: skbuff updates

Various updates to skbuff for new/updated drivers and some housekeeping:
- update types and struct members, add new (stub) functions
- improve freeing of frags.
- fix an issue with sleeping during alloc for dev_alloc_skb().
- Adjust a KASSERT for skb_reserve() which apparently can be called
multiple times if no data was put into the skb yet.
- move the sysctl from linux_8022.c (which may be in a different module)
to linux_skbuff.c so in case we turn debugging on we do not run into
unresolved symbols. Rename the sysctl variable to be less conflicting
and update debugging macros along with that; also add IMPROVE().
- add DDB support to show an skbuff.
- adjust comments/whitespace.

No functional changes intended for iwlwifi.

Sponsored by: The FreeBSD Foundation (partially)
MFC after: 3 days

show more ...


# 49ed6e97 26-Dec-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: add a work-in-progress skbuff implementation

This is a work-in-progress implementation of sk_buff compat code
used for wireless drivers only currently.
Bring in this version of the code as

LinuxKPI: add a work-in-progress skbuff implementation

This is a work-in-progress implementation of sk_buff compat code
used for wireless drivers only currently.
Bring in this version of the code as it has proven to be good enough
to have packets going for a few months.

The current implementation has several drawbacks including the need
for us to copy data between sk_buffs and mbufs.
Do not rely on the internals of this implementation. They are highly
likely to change as we will improve the integration to FreeBSD mbufs.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...