]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agonvme: Add OAES bit-field definitions
Chuck Tuffli [Mon, 21 Feb 2022 18:34:14 +0000 (10:34 -0800)]
nvme: Add OAES bit-field definitions

Create definitions for the Optional Asynchronous Events Supported (OAES)
values. Also adds a helper macro for the common use case of "mask and
shift". E.g.
    value = NVME_CTRLR_DATA_OAES_NS_ATTR_MASK << NVME_CTRLR_DATA_OAES_NS_ATTR_SHIFT;
becomes
    value = NVMEB(NVME_CTRLR_DATA_OAES_NS_ATTR);

(cherry picked from commit e71afa1202750b7cc8d49e77b7eed0114ece1657)

2 years agoUpdate fsdb(8) to reflect new structure of fsck_ffs(8).
Kirk McKusick [Wed, 23 Feb 2022 23:39:52 +0000 (15:39 -0800)]
Update fsdb(8) to reflect new structure of fsck_ffs(8).

(cherry picked from commit c5d476c98c2275966f68c7b81dab2421b143f5a9)

2 years agoAvoid unaligned writes by fsck_ffs(8).
Kirk McKusick [Sun, 20 Feb 2022 21:18:05 +0000 (13:18 -0800)]
Avoid unaligned writes by fsck_ffs(8).

(cherry picked from commit 7a1c1f6a0332c5b60349a5df0e3ce64e5005b2ff)

2 years agofetch(1): merge several improvements for handling of soft failures
Eugene Grosbein [Mon, 24 Jan 2022 04:03:42 +0000 (11:03 +0700)]
fetch(1): merge several improvements for handling of soft failures

Let "fetch -a" resume truncated transfer automatically to perform
another attempt if it obtained some new data in previous one
making progress.

Do not consider HTTP 5XX errors as soft failures.
Also, authorization errors should not be considered as soft failures.

(cherry picked from commit e3bad5f7aa86a0911cf8d28395e7a29395739985)
(cherry picked from commit a4efbe0d6da28eea0de4d414af25e7853ab8adfa)
(cherry picked from commit bf599c03f09dea0f7e188e002b42d782af6841c3)
(cherry picked from commit 08a2504a207c9302939bc0d1173fe44875e2a2e4)
(cherry picked from commit 85f15576b423b9ad5b8a9e6dab3e71558ebe4335)

2 years agokeymap: Add extra Alt Gr mapping for Brazillian Portuguese ABNT2 keyboards
Alfredo Dal'Ava Junior [Wed, 23 Feb 2022 00:35:09 +0000 (21:35 -0300)]
keymap: Add extra Alt Gr mapping for Brazillian Portuguese ABNT2 keyboards

This adds missing Alt Gr mappings for the keys "q", "w", "e" an "c" to
conform with ABNT2 standard.

PR: 256416
Submitted by: Neebz <vpguyrhpjltta@logicstreak.com>
Reviewed by: emaste
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D33801

(cherry picked from commit 07625bc4b30d66be5690d65debe56153aaf648bd)

2 years agoMFC b58cf1cb35ab:
Ryan Stone [Thu, 7 Jan 2021 17:25:56 +0000 (12:25 -0500)]
MFC b58cf1cb35ab:

Fix race condition in linuxkpi workqueue

Consider the following scenario:

1. A delayed_work struct in the WORK_ST_TIMER state.
2. Thread A calls mod_delayed_work()
3. Thread B (a callout thread) simultaneously calls
linux_delayed_work_timer_fn()

The following sequence of events is possible:

A: Call linux_cancel_delayed_work()
A: Change state from TIMER TO CANCEL
B: Change state from CANCEL to TASK
B: taskqueue_enqueue() the task
A: taskqueue_cancel() the task
A: Call linux_queue_delayed_work_on().  This is a no-op because the
state is WORK_ST_TASK.

As a result, the delayed_work struct will never be invoked.  This is
causing address resolution in ib_addr.c to stop permanently, as it
never tries to reschedule a task that it thinks is already scheduled.

Fix this by introducing locking into the cancel path (which
corresponds with the lock held while the callout runs).  This will
prevent the callout from changing the state of the task until the
cancel is complete, preventing the race.

Differential Revision: https://reviews.freebsd.org/D28420
Reviewed by: hselasky
MFC after: 2 months

(cherry picked from commit b58cf1cb35abc095d7fb9773630794b38bbc6b1d)

2 years agoMFC 2290dfb40fce:
Ryan Stone [Wed, 19 May 2021 19:10:03 +0000 (15:10 -0400)]
MFC 2290dfb40fce:

Enter the net epoch before calling ip6_setpktopts

ip6_setpktopts() can look up ifnets via ifnet_by_index(), which
is only safe in the net epoch.  Ensure that callers are in the net
epoch before calling this function.

Sponsored by: Dell EMC Isilon
MFC after: 4 weeks
Reviewed by: donner, kp
Differential Revision: https://reviews.freebsd.org/D30630

(cherry picked from commit 2290dfb40fce0ab46d91244282014173c7316e42)

2 years agoMFC 315bca194a14:
Ryan Stone [Wed, 7 Jul 2021 20:04:10 +0000 (16:04 -0400)]
MFC 315bca194a14:

Fix an early return in ctld UCL parser

If the UCL ctld parser encountered a port that used the CTL
ioctl device, it fell into a special case that had an erroneous
early return.  This caused all configuration in the target
following the port attribute to be skipped.  Fix this by replacing
the return with a continue so that the rest of the config is
parsed correctly.

Sponsored by: Dell EMC Isilon
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31703
Reviewed by: bapt

(cherry picked from commit 315bca194a14f3b9ec683675bafa8d990d16bfaf)

2 years agovt: fix double-click word selection for first/last word on line
Ed Maste [Mon, 21 Feb 2022 04:09:36 +0000 (23:09 -0500)]
vt: fix double-click word selection for first/last word on line

Previously when double-clicking on the first word on a line we would
select from the cursor position to the end of the word, not from the
beginning of the line.  Similarly, when double-clicking on the last word
on a line we would select from the beginning of the word to the cursor
position rather than the end of the line.

This is because we searched backward or forward for a space character to
mark the beginning or end of a word.  Now, use the beginning or end of
the line if we do not find a space.

PR: 261553
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 692bb3f0291b21337eb9a778f71a5b97a47e4c11)
(cherry picked from commit 521dbfd6b1085511769c419d44f11842e92067f5)

2 years agombuf: make M_ASSERT_NO_SND_TAG() as strict as other similar asserts
Hans Petter Selasky [Fri, 25 Feb 2022 09:57:10 +0000 (10:57 +0100)]
mbuf: make M_ASSERT_NO_SND_TAG() as strict as other similar asserts

Fixes: 17cbcf33c3b6

(cherry picked from commit f59fa112807b85abbd070c8ef6b1ac6e70207acb)

2 years agofreebsd-update.conf.5: Sort options
Mateusz Piotrowski [Thu, 17 Feb 2022 09:54:07 +0000 (10:54 +0100)]
freebsd-update.conf.5: Sort options

Reported by: pauamma_gundo.com
MFC after: 1 week

(cherry picked from commit bf8e97858365fe121968445c593dd4128d5f5490)

2 years agofreebsd-update.conf.5: Address style issues
Mateusz Piotrowski [Thu, 17 Feb 2022 09:40:48 +0000 (10:40 +0100)]
freebsd-update.conf.5: Address style issues

- Do not set Os to FreeBSD explicitly. We don't do it in other manual
  pages.
- Remove macros from the -width specifier.
- Use Xr instead of Cm to refer to the freebsd-update command.
- Address some mandoc lint warnings and use \(em instead of --.
- Wordsmith some paragraphs.
- Add a missing El macro.

MFC after: 1 week

(cherry picked from commit b80bb8b197aed4db48810d67be0239fd029c6465)

2 years agofreebsd-update.8: Document CreateBootEnv
Mateusz Piotrowski [Fri, 4 Feb 2022 10:20:49 +0000 (11:20 +0100)]
freebsd-update.8: Document CreateBootEnv

Also, add bectl(8) to section "See Also". [1]

PR: 261716
Reviewed by: debdrup, pauamma_gundo.com
MFC after: 1 week
Fixes: f28f13890541 freebsd-update: create a ZFS boot environment on install
Differential Revision: https://reviews.freebsd.org/D34169
Co-authored-by: Tobias Rehbein <tobias.rehbein@web.de> [1]

(cherry picked from commit 6d17f2d04302af6408127b9f8a307e2977c6d086)

2 years agoena: update ENA version to v2.5.0
Michal Krawczyk [Mon, 3 Jan 2022 13:51:59 +0000 (14:51 +0100)]
ena: update ENA version to v2.5.0

Some of the changes in this release:
- IPv6 L4 checksum offload fixes.
- Optimization of the Tx req_id validation.
- Timer service adjustments.
- NUMA awareness for the kernel RSS mode.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 8a5b4859c7fcefac7db611ef38450ef0a66d68a8)

2 years agoena: fix man page typos and update contact section
Michal Krawczyk [Mon, 3 Jan 2022 13:51:52 +0000 (14:51 +0100)]
ena: fix man page typos and update contact section

Verified spelling in the README and fixed the typos.

Also updated the contact section by removing Artur and adding Dawid
Gorecki who is now the second ENA FreeBSD driver developer.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 95161adfcb9261af81015b9c8ec97a445a993e4c)

2 years agoena: do not call reset if device is unresponsive
Dawid Gorecki [Mon, 3 Jan 2022 13:50:29 +0000 (14:50 +0100)]
ena: do not call reset if device is unresponsive

If the device becomes unresponsive, the driver will not be able to
finish the reset process correctly. Timeout during version validation
indicates that the device is currently not responding. In that case
do not perform the reset and instead reschedule timer service. Because
of that the driver will continue trying to reset the device until it
succeeds or is detached.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit d10ec3ad7739a6f621d398d034632f68f647d72f)

2 years agoena: start timer service on attach
Dawid Gorecki [Mon, 3 Jan 2022 13:50:13 +0000 (14:50 +0100)]
ena: start timer service on attach

The timer service was started when the interface was brought up and it
was stopped when it was brought down. Since ena_up requires the device
to be responsive, triggering the reset would become impossible if the
device became unresponsive with the interface down.

Since most of the functions in timer service already perform the check
to see if the device is running, this only requires starting the callout
in attach and stopping it when bringing the interface up or down to
avoid race between different admin queue calls.

Since callout functions for timer service are always called with the
same arguments, replace callout_{init,reset,drain} calls with
ENA_TIMER_{INIT,RESET,DRAIN} macros.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 78554d0c707c9401dbae53fb8bc65d291a5a09a5)

2 years agoena: rework tx req_id validation logic
Artur Rojek [Mon, 3 Jan 2022 13:50:06 +0000 (14:50 +0100)]
ena: rework tx req_id validation logic

Since `ena_com_tx_comp_req_id_get` already checks for `req_id` validity,
the logic was exiting early, never giving `validate_tx_req_id` a chance
to trigger device reset.
Rewrite the logic so that device reset is called based on return value
of `ena_com_tx_comp_req_id_get` instead.

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit b168d0c850f34e8178d815ba3a87de2657a02ca9)

2 years agoena: properly handle IPv6 L4 checksum offload
Dawid Gorecki [Mon, 3 Jan 2022 13:49:58 +0000 (14:49 +0100)]
ena: properly handle IPv6 L4 checksum offload

ena_tx_csum function did not check if IPv6 checksum offload was
requested it only checked checksum offloading flags for IPv4 packets.
Because of that, when encountering CSUM_IP6_* flags, the function simply
returned without actually setting checksum offloading in ena_ctx.
Check CUSM_IP6_* flags to enable IPv6 checksum offload.

Additionally, only IPv4 header was being parsed regardless of EtherType
field, because of that, value of L4 protocol read when actually trying
to send IPv6 packets was wrong. Use ip6_lasthdr function to get length
of all IPv6 headers and payload protocol.

Set the DF flag to 1 in order to allow the device to offload the IPv6
checksum calculation and achieve optimal performance.

Add CSUM6_OFFLOAD and CSUM_OFFLOAD definitions into ena_datapath.h.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 2bbef9d95dc10a69a3c5813a517f6e8fe583539a)

2 years agoena: merge ena-com v2.5.0 upgrade
Marcin Wojtas [Sun, 23 Jan 2022 19:21:17 +0000 (20:21 +0100)]
ena: merge ena-com v2.5.0 upgrade

Merge commit '2530eb1fa01bf28fbcfcdda58bd41e055dcb2e4a'

Adjust the driver to the upgraded ena-com part twofold:

First update is related to the driver's NUMA awareness.

Allocate I/O queue memory in NUMA domain local to the CPU bound to the
given queue, improving data access time. Since this can result in
performance hit for unaware users, this is done only when RSS
option is enabled, for other cases the driver relies on kernel to
allocate memory by itself.

Information about first CPU bound is saved in adapter structure, so
the binding persists after bringing the interface down and up again.

If there are more buckets than interface queues, the driver will try to
bind different interfaces to different CPUs using round-robin algorithm
(but it will not bind queues to CPUs which do not have any RSS buckets
associated with them). This is done to better utilize hardware
resources by spreading the load.

Add (read-only) per-queue sysctls in order to provide the following
information:
- queueN.domain: NUMA domain associated with the queue
- queueN.cpu:    CPU affinity of the queue

The second change is for the CSUM_OFFLOAD constant, as ENA platform
file has removed its definition. To align to that change, it has been
added to the ena_datapath.h file.

Submitted by: Artur Rojek <ar@semihalf.com>
Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit eb4c4f4a2e18659b67a6bf1ea5f473c7ed8c854f)

2 years agomlx5e: Make TLS tag zones unmanaged
Hans Petter Selasky [Thu, 24 Feb 2022 09:59:38 +0000 (10:59 +0100)]
mlx5e: Make TLS tag zones unmanaged

These zones are cache zones used to allocate TLS offload contexts from
firmware.  Releasing items from the cache is a sleepable operation due
to the need to await a response from the firmware command freeing the
tag, so items cannot be reclaimed from the zone in non-sleepable
contexts.  Since the cache size is limited by firmware limits, avoid
this by setting UMA_ZONE_UNMANAGED to avoid reclamation by uma_timeout()
and the low memory handler.

Reviewed by: hselasky, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34142

(cherry picked from commit 235ed6a48629771e4bc89141fdfe865b71024758)

2 years agouma: Add UMA_ZONE_UNMANAGED
Hans Petter Selasky [Thu, 24 Feb 2022 09:59:28 +0000 (10:59 +0100)]
uma: Add UMA_ZONE_UNMANAGED

Allow a zone to opt out of cache size management.  In particular,
uma_reclaim() and uma_reclaim_domain() will not reclaim any memory from
the zone, nor will uma_timeout() purge cached items if the zone is idle.
This effectively means that the zone consumer has control over when
items are reclaimed from the cache.  In particular, uma_zone_reclaim()
will still reclaim cached items from an unmanaged zone.

Reviewed by: hselasky, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34142

(cherry picked from commit 389a3fa693ef61c35e15b36f042fb24197b7afb1)

2 years agomlx5en: Use a UMA cache zone for managing TLS send tags
Hans Petter Selasky [Thu, 24 Feb 2022 09:59:19 +0000 (10:59 +0100)]
mlx5en: Use a UMA cache zone for managing TLS send tags

Instead of allocating directly from a normal zone. This way
import and release are guaranteed to process all allocated and then
deallocated items. Also, the release occurs in a sleepable context when
caller of uma_zfree() or uma_zdestroy() can sleep itself.

Sponsored by: NVIDIA Networking

(cherry picked from commit 0f7b6e11c01d5360c9423d6938b160fe2d030ab0)

2 years agomlx5en: Fix TLS worker thread race.
Hans Petter Selasky [Thu, 24 Feb 2022 09:59:14 +0000 (10:59 +0100)]
mlx5en: Fix TLS worker thread race.

Create a dedicated free state, in case the taskqueue worker is still pending,
to avoid re-activation of a freed send tag.

Sponsored by: NVIDIA Networking

(cherry picked from commit 015f22f5d0338882ab4a1e1585622ff3568dface)

2 years agomlx5en: Improve RX- and TX- TLS refcounting.
Hans Petter Selasky [Thu, 24 Feb 2022 09:59:07 +0000 (10:59 +0100)]
mlx5en: Improve RX- and TX- TLS refcounting.

Use the send tag refcounting mechanism to refcount the RX- and TX- TLS
send tags. Then it is no longer needed to wait for refcounts to reach
zero when destroying RX- and TX- TLS send tags as a result of pending
data or WQE commands.

This also ensures that when TX-TLS and rate limiting is used at the same
time, the underlying SQ is not prematurely destroyed.

Sponsored by: NVIDIA Networking

(cherry picked from commit ebdb70064900a2ba2e3f8341328edc34e619170d)

2 years agomlx5en: Add missing refcount decrement on link-down.
Hans Petter Selasky [Thu, 24 Feb 2022 09:59:01 +0000 (10:59 +0100)]
mlx5en: Add missing refcount decrement on link-down.

Sponsored by: NVIDIA Networking

(cherry picked from commit d2a788a522f78f7c4b014df9097348419d90fae4)

2 years agomlx5en: Improve CQE error debugging.
Hans Petter Selasky [Thu, 24 Feb 2022 09:58:54 +0000 (10:58 +0100)]
mlx5en: Improve CQE error debugging.

Sponsored by: NVIDIA Networking

(cherry picked from commit bc531a1faa99b94b7b7761f1640304dd815eec5d)

2 years agoAdd more USB host controller PCI ID's.
Hans Petter Selasky [Thu, 24 Feb 2022 09:58:44 +0000 (10:58 +0100)]
Add more USB host controller PCI ID's.

Submitted by: Gary Jennejohn <gljennjohn@gmail.com>
Sponsored by: NVIDIA Networking

(cherry picked from commit e85af89fa7613a4bb506ca6ab8ecafbfbfde782d)

2 years agoxhci: add PCI IDs for USB controllers found on Supermicro M12SWA-TF
Hans Petter Selasky [Thu, 24 Feb 2022 09:58:39 +0000 (10:58 +0100)]
xhci: add PCI IDs for USB controllers found on Supermicro M12SWA-TF

(cherry picked from commit 4b4cce02ac01a943aa1816e7ea9ae6017539e7bb)

2 years agousb(4): Belatedly add a PCI device ID for AMD Bolton chipset
Hans Petter Selasky [Thu, 24 Feb 2022 09:58:32 +0000 (10:58 +0100)]
usb(4): Belatedly add a PCI device ID for AMD Bolton chipset

(cherry picked from commit 379797d4b4865336f56e327640f574f1e2956a7d)

2 years agoAdd new USB host controller PCI ID's.
Hans Petter Selasky [Thu, 24 Feb 2022 09:58:16 +0000 (10:58 +0100)]
Add new USB host controller PCI ID's.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: NVIDIA Networking

(cherry picked from commit 42cf33dd1a8d6ff2548c8a7fb267879734ddfde3)

2 years ago13.1: update stable/13 to -PRERELEASE to start the release cycle
Glen Barber [Thu, 24 Feb 2022 04:21:49 +0000 (23:21 -0500)]
13.1: update stable/13 to -PRERELEASE to start the release cycle

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoiichid(4): Perform acknowledgement of I2C device interrupt after RESET command
Vladimir Kondratyev [Tue, 30 Nov 2021 21:29:50 +0000 (00:29 +0300)]
iichid(4): Perform acknowledgement of I2C device interrupt after RESET command

in sampling mode to workaround firmware bug.

This fixes reboot or poweroff on frame.work laptops after first touch.

(cherry picked from commit c508b0818b245ea136d6538d68868cb3541f8f8f)

2 years agodumpfs(8): add option to only print superblock information
Robert Wing [Fri, 2 Jul 2021 22:18:17 +0000 (14:18 -0800)]
dumpfs(8): add option to only print superblock information

Add an option to dumpfs, `-s`, that only prints the super block information.

Reviewed by: chs, imp
Differential Revision: https://reviews.freebsd.org/D30881

(cherry picked from commit dc3548453689b30ad712e4391a99d3e7df0cad40)

2 years agotcp_twrespond: send signed segment when connection is TCP-MD5
Robert Wing [Mon, 20 Dec 2021 20:30:24 +0000 (11:30 -0900)]
tcp_twrespond: send signed segment when connection is TCP-MD5

When a connection is established to use TCP-MD5, tcp_twrespond() doesn't
respond with a signed segment. This results in the host performing the
active close to remain in a TIME_WAIT state and the other host in the
LAST_ACK state. Fix this by sending a signed segment when the connection
is established to use TCP-MD5.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D33490

(cherry picked from commit 2a28b045ca7f9b24dc2a8fee2148578edfc87143)

2 years agoFix dtrace SDT probe tcp:::debug-input
Robert Wing [Tue, 21 Dec 2021 02:15:43 +0000 (17:15 -0900)]
Fix dtrace SDT probe tcp:::debug-input

The tcp:::debug-input probe is passed an mbuf pointer, use the correct
translator for ipinfo_t when defining tcp:::debug-input.

Fixes: 82988b50a17c ("Add an mbuf to ipinfo_t translator to finish ...")
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D33066

(cherry picked from commit 08d157a8321c845dad9f2d6eecea07639a23411a)

2 years agobhyve/block_if: allow DIOCGMEDIASIZE ioctl
Robert Wing [Tue, 25 Jan 2022 16:44:13 +0000 (07:44 -0900)]
bhyve/block_if: allow DIOCGMEDIASIZE ioctl

This is needed to get mediasize of the device after a resize event.

I missed this earlier as I was building WITH_BHYVE_SNAPSHOT, which
disables capsicum.

Reviewed by: khng, markj
Fixes: ae9ea22e14bf ("bhyve: get mediasize for character devices when ...")
Differential Revision: https://reviews.freebsd.org/D34013

(cherry picked from commit 08cb63a12fd9c0e575ee489353b53d53b4a45411)

2 years agobhyve: get mediasize for character devices when resizing virtio-blk
Robert Wing [Tue, 18 Jan 2022 20:26:49 +0000 (11:26 -0900)]
bhyve: get mediasize for character devices when resizing virtio-blk

Reviewed by: imp, allanjude, jhb
Differential Revision: https://reviews.freebsd.org/D33403

(cherry picked from commit ae9ea22e14bf523aee508f1fe07091580b528a2e)

2 years agogeom: add kqfilter support for geom dev
Robert Wing [Tue, 18 Jan 2022 19:54:59 +0000 (10:54 -0900)]
geom: add kqfilter support for geom dev

The only event hooked up is NOTE_ATTRIB, which is triggered when the
device is resized. Support for other NOTE_* events to follow.

Reviewed by: kib, jhb
Differential Revision: https://reviews.freebsd.org/D33402

2 years agoif_epair: implement fanout
Kristof Provost [Thu, 9 Dec 2021 13:24:13 +0000 (14:24 +0100)]
if_epair: implement fanout

Allow multiple cores to be used to process if_epair traffic. We do this
(if RSS is enabled) based on the RSS hash of the incoming packet. This
allows us to distribute the load over multiple cores, rather than
sending everything to the same one.

We also switch from swi_sched() to taskqueues, which also contributes to
better throughput.

Benchmark results:
With net.isr.maxthreads=-1

Setup A: (cc0 - bridge0 - epair0a) (epair0b - bridge1 - cc1)

Before          627 Kpps
After (no RSS)  1.198 Mpps
After (RSS)     3.148 Mpps

Setup B: (cc0 - bridge0 - epaira0) (epair0b - vnet jail - epair1a) (epair1b - bridge1 - cc1)

Before          7.705 Kpps
After (no RSS)  1.017 Mpps
After (RSS)     2.083 Mpps

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D33731

(cherry picked from commit 24f0bfbad57b9c3cb9b543a60b2ba00e4812c286)

2 years agoif_vtnet(4): Restore the ability to set promisc mode.
Aleksandr Fedorov [Sat, 5 Feb 2022 15:47:46 +0000 (18:47 +0300)]
if_vtnet(4): Restore the ability to set promisc mode.

PR: 254343, 255054
Reviewed by: vmaffione (mentor), donner
Approved by: vmaffione (mentor), donner
MFC after: 2 weeks
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D30639

(cherry picked from commit fc035df8af32d496885e5da26e519ce6a262c9bf)

2 years agoif_vxlan(4): Allow netmap_generic to intercept RX packets.
Aleksandr Fedorov [Sun, 6 Feb 2022 12:27:46 +0000 (15:27 +0300)]
if_vxlan(4): Allow netmap_generic to intercept RX packets.

Netmap (generic) intercepts the if_input method to handle RX packets.

Call ifp->if_input() instead of netisr_dispatch().
Add stricter check for incoming packet length.

This change is very useful with bhyve + vale + if_vxlan.

Reviewed by: vmaffione (mentor), kib, np, donner
Approved by: vmaffione (mentor), kib, np, donner
MFC after: 2 weeks
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D30638

(cherry picked from commit ceaf442ff236dd0dcd303001ff41e6c64a0cfc1f)

2 years agomd(4): Add dummy support of the BIO_FLUSH command for malloc and swap
Aleksandr Fedorov [Thu, 17 Feb 2022 19:21:56 +0000 (22:21 +0300)]
md(4): Add dummy support of the BIO_FLUSH command for malloc and swap
backend.

PR: 260200
Reported by: editor@callfortesting.org
Reviewed by: vmaffione (mentor), markj
Approved by: vmaffione (mentor), markj
Differential Revision: https://reviews.freebsd.org/D34260

(cherry picked from commit cb28dfb27d12f1cbd7831f370c01493c01d74b10)

2 years agolibarchive: merge vendor bugfix
Martin Matuska [Mon, 21 Feb 2022 11:06:54 +0000 (12:06 +0100)]
libarchive: merge vendor bugfix

OSS-Fuzz #44843 (security):
RAR reader: fix null-dereference in RAR (v4) filter code

(cherry picked from commit 5ccf909af9c1117172ff0742515da2d2e0cef89e)

2 years agolibarchive: merge vendor bugfixes
Martin Matuska [Fri, 18 Feb 2022 23:57:56 +0000 (00:57 +0100)]
libarchive: merge vendor bugfixes

Bugfixes:
OSS-Fuzz #44547: fix heap-use-after-free in RAR (v4) filter code
PR #1671: Fix 7z PPMD reading beyond boundary

(cherry picked from commit 47a2e541dc68cfcc49e5ab9e6020227e3b0db2d7)

2 years agolibarchive: import changes from upstream
Martin Matuska [Wed, 9 Feb 2022 23:35:42 +0000 (00:35 +0100)]
libarchive: import changes from upstream

Libarchive 3.6.0

New features:
PR #1614: tar: new option "--no-read-sparse"
PR #1503: RAR reader: filter support
PR #1585: RAR5 reader: self-extracting archive support

New features (not used in FreeBSD base):
PR #1567: tar: threads support for zstd (#1567)
PR #1518: ZIP reader: zstd decompression support

Security Fixes:
PR #1491, #1492, #1493, CVE-2021-36976:
   fix invalid memory access and out of bounds read in RAR5 reader
PR #1566, #1618, CVE-2021-31566:
   extended fix for following symlinks when processing the fixup list

Other notable bugfixes and improvements:
PR #1620: tar: respect "--ignore-zeros" in c, r and u modes
PR #1625: reduced size of application binaries

Relnotes: yes

(cherry picked from commit 833a452e9f082a7982a31c21f0da437dbbe0a39d)

2 years agortsx: Add RTS5260 support and replace bootverbose with sysctl.
Henri Hennebert [Sat, 19 Feb 2022 16:41:53 +0000 (11:41 -0500)]
rtsx: Add RTS5260 support and replace bootverbose with sysctl.

Tested by: mav
MFC after: 4 days
Differential Revision: https://reviews.freebsd.org/D34246

(cherry picked from commit 577130e56e524eb185ff4d32644dae26be4d28d4)

2 years agortsx: Update driver version number to 2.1c
Henri Hennebert [Thu, 3 Feb 2022 23:24:27 +0000 (18:24 -0500)]
rtsx: Update driver version number to 2.1c

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

(cherry picked from commit ad494d3b2d4d46af5d27e2b569ba708adeea7624)

2 years agortsx: Do not display pci_read_config() errors during rtsx_init()
Henri Hennebert [Thu, 3 Feb 2022 23:22:24 +0000 (18:22 -0500)]
rtsx: Do not display pci_read_config() errors during rtsx_init()

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

(cherry picked from commit 1e800a593445b83e010e3d2985ca66e56107dd76)

2 years agortsx: Add CTLFLAG_STATS flag for read and write counters
Henri Hennebert [Thu, 3 Feb 2022 23:18:08 +0000 (18:18 -0500)]
rtsx: Add CTLFLAG_STATS flag for read and write counters

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

(cherry picked from commit ec1f122b56f9e88397dfae26078d6f1ca53094ed)

2 years agortsx: Prefer __FreeBSD_version over __FreeBSD__
Henri Hennebert [Thu, 3 Feb 2022 23:10:02 +0000 (18:10 -0500)]
rtsx: Prefer __FreeBSD_version over __FreeBSD__

No functional change.

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

(cherry picked from commit 7e5933b33301c194345364b9cf45d425ea6dbd1a)

2 years agortsx: Convert driver to use the mmc_sim interface
Henri Hennebert [Thu, 3 Feb 2022 22:58:57 +0000 (17:58 -0500)]
rtsx: Convert driver to use the mmc_sim interface

A lot more generic cam related things were done in mmc_sim so this
simplifies the driver a lot.

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

(cherry picked from commit 8e9740b62e950b40dcf7dbe729855be14450d40d)

2 years agosctp: remove KASSERT() which not always holds
Michael Tuexen [Sun, 20 Feb 2022 14:59:21 +0000 (15:59 +0100)]
sctp: remove KASSERT() which not always holds

Reported by: syzbot+c907045aed2043011f3c@syzkaller.appspotmail.com

(cherry picked from commit bdb99f6f5e311cded759abceee8ee17c951a3b8d)

2 years agosctp: make sure new locking requirements are satisfied.
Michael Tuexen [Sun, 20 Feb 2022 14:31:53 +0000 (15:31 +0100)]
sctp: make sure new locking requirements are satisfied.

Reported by: syzbot+cd3c1dd64861b8c200bd@syzkaller.appspotmail.com

(cherry picked from commit e255f0c9fbd2e1b27f57459d3af18fa19166969d)

2 years agosctp: don't hold the assoc create lock longer than needed
Michael Tuexen [Sun, 20 Feb 2022 13:55:41 +0000 (14:55 +0100)]
sctp: don't hold the assoc create lock longer than needed

Reported by: syzbot+c738e3df67cf425c49a2@syzkaller.appspotmail.com

(cherry picked from commit 2f0656fb9ba2b962be7f545763fd8c55640ded00)

2 years agosctp: cleanup sctp_lower_sosend
Michael Tuexen [Sun, 20 Feb 2022 00:09:30 +0000 (01:09 +0100)]
sctp: cleanup sctp_lower_sosend

This is a preparation for retiring the tcp send lock in the
next step.

(cherry picked from commit a4a31271cc7a018b0a7120bf7d8fa40c39264914)

2 years agosctp: improve robustness
Michael Tuexen [Fri, 18 Feb 2022 13:30:07 +0000 (14:30 +0100)]
sctp: improve robustness

(cherry picked from commit fd0d53f85c9f5d1a31367eb1b8b5e74cc83afd52)

2 years agosctp: cleanup, no functional change intended.
Michael Tuexen [Fri, 18 Feb 2022 13:20:01 +0000 (14:20 +0100)]
sctp: cleanup, no functional change intended.

(cherry picked from commit 274a0e4a8d817d88ce7e3d40c4aad71db102c6ff)

2 years agosctp: remove unused parameter
Michael Tuexen [Fri, 18 Feb 2022 11:20:44 +0000 (12:20 +0100)]
sctp: remove unused parameter

(cherry picked from commit 3ca204c97aa74a6509ccf59ff421fed2e9a11d4f)

2 years agosctp: fix a signed/unsigned mismatch.
Michael Tuexen [Thu, 17 Feb 2022 21:44:41 +0000 (22:44 +0100)]
sctp: fix a signed/unsigned mismatch.

(cherry picked from commit 11c4d4b9668c3092838beb168e0bbb3187433748)

2 years agosctp: avoid undefined behaviour and cleanup the code.
Michael Tuexen [Thu, 17 Feb 2022 18:23:59 +0000 (19:23 +0100)]
sctp: avoid undefined behaviour and cleanup the code.

(cherry picked from commit 76e03cc940fed57d580b1d5c0605e8af2e14f05b)

2 years agosockstat: fix usage string
Michael Tuexen [Tue, 1 Feb 2022 14:44:57 +0000 (15:44 +0100)]
sockstat: fix usage string

Sponsored by: Netflix, Inc.

(cherry picked from commit 6ad26abca5389bc1cc74d6e533fb317df6ab5f89)

2 years agosockstat: add -i to display inp_gencnt
Michael Tuexen [Tue, 1 Feb 2022 14:37:03 +0000 (15:37 +0100)]
sockstat: add -i to display inp_gencnt

The inp_gencnt will be used to identify a TCP endpoint by an upcoming
command line tool to set TCP socket options.

Reviewed by: rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D34137

(cherry picked from commit 5f64777a4fe38acb412762fa92da583a1018e609)

2 years agosctp: improve counting of incoming chunks
Michael Tuexen [Sat, 1 Jan 2022 19:59:47 +0000 (20:59 +0100)]
sctp: improve counting of incoming chunks

(cherry picked from commit 502d5e8500b9537d90ae225eed2b600ddcef2afd)

2 years agoudp: use appropriate pcbinfo when signalling EHOSTDOWN
Michael Tuexen [Sat, 1 Jan 2022 18:17:17 +0000 (19:17 +0100)]
udp: use appropriate pcbinfo when signalling EHOSTDOWN

Sponsored by: Netflix, Inc.

(cherry picked from commit 4760956e9ad39b940df01477e5a86d06c39ac217)

2 years agosctp: retire sctp_mtu_size_reset()
Michael Tuexen [Thu, 30 Dec 2021 14:30:11 +0000 (15:30 +0100)]
sctp: retire sctp_mtu_size_reset()

Thanks to Timo Voelker for making me aware that sctp_mtu_size_reset()
is very similar to sctp_pathmtu_adjustment().

(cherry picked from commit 1adb91e52164af634c816327f8cdb3751dc76ce4)

2 years agosctp: improve sctp_pathmtu_adjustment()
Michael Tuexen [Thu, 30 Dec 2021 14:16:05 +0000 (15:16 +0100)]
sctp: improve sctp_pathmtu_adjustment()

Allow the resending of DATA chunks to be controlled by the caller,
which allows retiring sctp_mtu_size_reset() in a separate commit.
Also improve the computaion of the overhead and use 32-bit integers
consistently.
Thanks to Timo Voelker for pointing me to the code.

(cherry picked from commit 2de2ae331be2504d1038b2124e7d44f23aa70405)

2 years agosctp: minor improvements in sctp_get_frag_point
Michael Tuexen [Tue, 28 Dec 2021 09:23:31 +0000 (10:23 +0100)]
sctp: minor improvements in sctp_get_frag_point

(cherry picked from commit a7ba00a438a64b34219f2990b3f7348126f7b4ab)

2 years agosctp: check that the computed frag point is a multiple of 4
Michael Tuexen [Tue, 28 Dec 2021 08:40:52 +0000 (09:40 +0100)]
sctp: check that the computed frag point is a multiple of 4

Reported by: syzbot+5da189fc1fe80b31f5bd@syzkaller.appspotmail.com

(cherry picked from commit ca0dd19f09335496390829851862c894f89a87f9)

2 years agosctp: cleanup the SCTP_MAXSEG socket option.
Michael Tuexen [Mon, 27 Dec 2021 22:40:31 +0000 (23:40 +0100)]
sctp: cleanup the SCTP_MAXSEG socket option.

This patch makes the handling of the SCTP_MAXSEG socket option
compliant with RFC 6458 (SCTP socket API) and fixes an issue
found by syzkaller.

Reported by: syzbot+a2791b89ab99121e3333@syzkaller.appspotmail.com

(cherry picked from commit 989453da0589b8dc5c1948fd81f986a37ea385eb)

2 years agosctp: cleanup, on functional change intended.
Michael Tuexen [Mon, 27 Dec 2021 17:28:44 +0000 (18:28 +0100)]
sctp: cleanup, on functional change intended.

(cherry picked from commit 34ae6a1a442881681a9c63e93a189b9191db50ed)

2 years agosctp: apply limit for socket buffers as indicated in comment
Michael Tuexen [Mon, 27 Dec 2021 17:15:29 +0000 (18:15 +0100)]
sctp: apply limit for socket buffers as indicated in comment

(cherry picked from commit a859e9f9aa258841e988d2f6c5f860048e168923)

2 years agoif_oce: fix epoch handling
Michael Tuexen [Sat, 18 Dec 2021 22:43:00 +0000 (23:43 +0100)]
if_oce: fix epoch handling

Thanks to gallatin@ for suggesting the patch.

PR: 260330
Reported by: Vincent Milum Jr.
Reviewed by: gallatin, glebius
Tested by: Vincent Milum Jr.
Differential Revision: https://reviews.freebsd.org/D33395

(cherry picked from commit e363f832cfb283a543fa8e47ebd9e51817994fde)

2 years agosctp: improve consistency, no functional change intended
Michael Tuexen [Fri, 26 Nov 2021 11:53:12 +0000 (12:53 +0100)]
sctp: improve consistency, no functional change intended

(cherry picked from commit 3c1ba6f394d2711beabc961f0bda10e1212b7ca6)

2 years agosctp: add some asserts, no functional changes intended
Michael Tuexen [Fri, 26 Nov 2021 11:19:33 +0000 (12:19 +0100)]
sctp: add some asserts, no functional changes intended

This might help in narrowing down
https://syzkaller.appspot.com/bug?id=fbd79abaec55f5aede63937182f4247006ea883b

(cherry picked from commit 0906362646546843f371bebccb51d5578a99cc7c)

2 years agosctp: improve KASSERT messages
Michael Tuexen [Fri, 8 Oct 2021 09:32:55 +0000 (11:32 +0200)]
sctp: improve KASSERT messages

(cherry picked from commit bd19202c92e3d73e90aedd518f0963797744e50f)

2 years agosctp: don't keep being locked on a stream which is removed
Michael Tuexen [Fri, 1 Oct 2021 22:48:01 +0000 (00:48 +0200)]
sctp: don't keep being locked on a stream which is removed

Reported by: syzbot+f5f551e8a3a0302a4914@syzkaller.appspotmail.com

(cherry picked from commit 3ff3733991ba049959c4fd2e7179ea96241a396e)

2 years agosctp: provide a specific stream scheduler function for FCFS
Michael Tuexen [Wed, 29 Sep 2021 00:08:37 +0000 (02:08 +0200)]
sctp: provide a specific stream scheduler function for FCFS

A KASSERT in the genric routine does not apply and triggers
incorrectly.

Reported by: syzbot+8435af157238c6a11430@syzkaller.appspotmail.com

(cherry picked from commit 28ea9470782d4d01004b801c3ec7d74761fcf611)

2 years agosctp: cleanup and adding KASSERT()s, no functional change
Michael Tuexen [Tue, 28 Sep 2021 18:29:43 +0000 (20:29 +0200)]
sctp: cleanup and adding KASSERT()s, no functional change

(cherry picked from commit fa947a3687b98b387de55a33154fce7d6e3dffa3)

2 years agosctp: fix usage of stream scheduler functions
Michael Tuexen [Tue, 28 Sep 2021 03:25:58 +0000 (05:25 +0200)]
sctp: fix usage of stream scheduler functions

sctp_ss_scheduled() should only be called for streams that are
scheduled. So call sctp_ss_remove_from_stream() before it.
This bug was uncovered by the earlier cleanup.

Reported by: syzbot+bbf739922346659df4b2@syzkaller.appspotmail.com
Reported by: syzbot+0a0857458f4a7b0507c8@syzkaller.appspotmail.com
Reported by: syzbot+a0b62c6107b34a04e54d@syzkaller.appspotmail.com
Reported by: syzbot+0aa0d676429ebcd53299@syzkaller.appspotmail.com
Reported by: syzbot+104cc0c1d3ccf2921c1d@syzkaller.appspotmail.com

(cherry picked from commit 5b53e749a95e7f18475df9f9ce7984a31880a7ee)

2 years agosctp: avoid locking an already locked mutex
Michael Tuexen [Tue, 28 Sep 2021 03:14:56 +0000 (05:14 +0200)]
sctp: avoid locking an already locked mutex

Reported by: syzbot+f048680690f2e8d7ddad@syzkaller.appspotmail.com
Reported by: syzbot+0725c712ba89d123c2e9@syzkaller.appspotmail.com

(cherry picked from commit 171633765c4367dc233a4bf0e5926cb7c4decfc1)

2 years agosctp: Cleanup stream schedulers.
Michael Tuexen [Thu, 23 Sep 2021 12:16:56 +0000 (14:16 +0200)]
sctp: Cleanup stream schedulers.

No functional change intended.

(cherry picked from commit 414499b3f911812d49a8c9af05102c0dc37ff878)

2 years agosctp: Simplify stream scheduler usage
Michael Tuexen [Tue, 21 Sep 2021 15:13:57 +0000 (17:13 +0200)]
sctp: Simplify stream scheduler usage

Callers are getting the stcb send lock, so just KASSERT that.
No need to signal this when calling stream scheduler functions.
No functional change intended.

(cherry picked from commit 762ae0ec8d83ed0e3c084e19174b4bd809a7ef2d)

2 years agosctp: improve consistency when calling stream scheduler
Michael Tuexen [Mon, 20 Sep 2021 22:54:13 +0000 (00:54 +0200)]
sctp: improve consistency when calling stream scheduler

Hold always the stcb send lock when calling sctp_ss_init() and
sctp_ss_remove_from_stream().

(cherry picked from commit 0b79a76f848768068d409edcb36f2a58cdd17e61)

2 years agosctp: use a valid outstream when adding it to the scheduler
Michael Tuexen [Mon, 20 Sep 2021 13:52:10 +0000 (15:52 +0200)]
sctp: use a valid outstream when adding it to the scheduler

Without holding the stcb send lock, the outstreams might get
reallocated if the number of streams are increased.

Reported by: syzbot+4a5431d7caa666f2c19c@syzkaller.appspotmail.com
Reported by: syzbot+aa2e3b013a48870e193d@syzkaller.appspotmail.com
Reported by: syzbot+e4368c3bde07cd2fb29f@syzkaller.appspotmail.com
Reported by: syzbot+fe2f110e34811ea91690@syzkaller.appspotmail.com
Reported by: syzbot+ed6e8de942351d0309f4@syzkaller.appspotmail.com

(cherry picked from commit 34b1efcea19dd4324eecd19d2de313d039fd9656)

2 years agosctp: fix FCFS stream scheduler
Michael Tuexen [Sun, 19 Sep 2021 09:56:26 +0000 (11:56 +0200)]
sctp: fix FCFS stream scheduler

Reported by: syzbot+c6793f0f0ce698bce230@syzkaller.appspotmail.com

(cherry picked from commit e19d93b19dce276bdf178bb6a449728238d1c6f8)

2 years agosctp: cleanup, no functional change intended
Michael Tuexen [Wed, 15 Sep 2021 08:18:11 +0000 (10:18 +0200)]
sctp: cleanup, no functional change intended

(cherry picked from commit 454216468583481746845a1c8a45a8c18898ee72)

2 years agosctp: avoid LOR
Michael Tuexen [Sun, 12 Sep 2021 19:11:14 +0000 (21:11 +0200)]
sctp: avoid LOR

Don't lock the inp-info lock while holding an stcb lock.

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

(cherry picked from commit 29545986bdf6c949671e61fc46ee3f2440b1535b)

2 years agosctp: minor cleanup, no functional change
Michael Tuexen [Sun, 12 Sep 2021 17:21:15 +0000 (19:21 +0200)]
sctp: minor cleanup, no functional change

(cherry picked from commit 4181fa2a209e0709939ac2f9fb86884522855600)

2 years agosctp: Tighten up locking around sctp_aloc_assoc()
Mark Johnston [Sat, 11 Sep 2021 14:15:21 +0000 (10:15 -0400)]
sctp: Tighten up locking around sctp_aloc_assoc()

All callers of sctp_aloc_assoc() mark the PCB as connected after a
successful call (for one-to-one-style sockets).  In all cases this is
done without the PCB lock, so the PCB's flags can be corrupted.  We also
do not atomically check whether a one-to-one-style socket is a listening
socket, which violates various assumptions in solisten_proto().

We need to hold the PCB lock across all of sctp_aloc_assoc() to fix
this.  In order to do that without introducing lock order reversals, we
have to hold the global info lock as well.

So:
- Convert sctp_aloc_assoc() so that the inp and info locks are
  consistently held.  It returns with the association lock held, as
  before.
- Fix an apparent bug where we failed to remove an association from a
  global hash if sctp_add_remote_addr() fails.
- sctp_select_a_tag() is called when initializing an association, and it
  acquires the global info lock.  To avoid lock recursion, push locking
  into its callers.
- Introduce sctp_aloc_assoc_connected(), which atomically checks for a
  listening socket and sets SCTP_PCB_FLAGS_CONNECTED.

There is still one edge case in sctp_process_cookie_new() where we do
not update PCB/socket state correctly.

Reviewed by: tuexen
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31908

(cherry picked from commit 2d5c48eccd9f29b9df8020bb1c3a8ffda38df37b)

2 years agosctp: add explicit cast, no functional change intended
Michael Tuexen [Thu, 9 Sep 2021 17:13:47 +0000 (19:13 +0200)]
sctp: add explicit cast, no functional change intended

(cherry picked from commit 3ea2cdd45ec1e057315ccc3aea16a65d62aad337)

2 years agosctp: use appropriate argument when freeing association
Michael Tuexen [Thu, 9 Sep 2021 16:01:35 +0000 (18:01 +0200)]
sctp: use appropriate argument when freeing association

Reported by: syzbot+7fe26e26911344e7211d@syzkaller.appspotmail.com

(cherry picked from commit 0c1a20beb4560eaae69202bc49026ab9e2a677a4)

2 years agosctp: cleanup timewait handling for vtags
Michael Tuexen [Wed, 8 Sep 2021 23:18:58 +0000 (01:18 +0200)]
sctp: cleanup timewait handling for vtags

(cherry picked from commit 58a7bf124cc2b20e069bb89f2fd9ea5c1b7049c2)

2 years agosctp: minor cleanups, no functional change intended
Michael Tuexen [Wed, 8 Sep 2021 13:13:05 +0000 (15:13 +0200)]
sctp: minor cleanups, no functional change intended

(cherry picked from commit aab1d593b2ec2c24a808eed39c39890b066d5fba)

2 years agotcp: make network epoch expectations of LRO explicit
Michael Tuexen [Wed, 25 Aug 2021 15:09:25 +0000 (17:09 +0200)]
tcp: make network epoch expectations of LRO explicit

Reviewed by: gallatin, hselasky
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D31648

(cherry picked from commit dc6ab77d66f892566de926274e6a58a637975510)

2 years agosctp: improve handling of illegal parameters of INIT-ACK chunks
Michael Tuexen [Fri, 20 Aug 2021 12:03:49 +0000 (14:03 +0200)]
sctp: improve handling of illegal parameters of INIT-ACK chunks

(cherry picked from commit a3665770d7d85e990f7703170a27f8e2d3e455b5)

2 years agosctp: improve handling of INIT chunks with invalid parameters
Michael Tuexen [Wed, 18 Aug 2021 22:31:35 +0000 (00:31 +0200)]
sctp: improve handling of INIT chunks with invalid parameters

(cherry picked from commit eba8e643b19cb7acd7c9a79acfab376b3967f20d)

2 years agosctp: remove some set, but unused variables
Michael Tuexen [Mon, 9 Aug 2021 13:58:46 +0000 (15:58 +0200)]
sctp: remove some set, but unused variables

Thanks to pkasting for submitting the patch for the userland stack.

(cherry picked from commit 3808ab732e6a044cc101cf22027a0db2ac4ad58d)

2 years agoipv6: Fix getsockopt() for some IPPROTO_IPV6 level socket options
Michael Tuexen [Mon, 9 Aug 2021 07:23:42 +0000 (09:23 +0200)]
ipv6: Fix getsockopt() for some IPPROTO_IPV6 level socket options

Fix getsockopt() for the IPPROTO_IPV6 level socket options with the
following names: IPV6_HOPOPTS, IPV6_RTHDR, IPV6_RTHDRDSTOPTS,
IPV6_DSTOPTS, and IPV6_NEXTHOP.

Reviewed by: markj
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D31458

(cherry picked from commit a8d54fc903cca354572ddd7a890baefd81baa7e8)

2 years agosctp: improve handling of IPv4 addresses on IPV6 sockets
Michael Tuexen [Sat, 7 Aug 2021 15:27:56 +0000 (17:27 +0200)]
sctp: improve handling of IPv4 addresses on IPV6 sockets

Reported by: syzbot+08fe66e4bfc2777cba95@syzkaller.appspotmail.com

(cherry picked from commit 784692c74019fa69b5298fb1693a97f107c56b4b)