OPNSense/src bf2ff4esys/dev/virtio/network if_vtnet.c

vtnet: Do not compare boolean with integer

The type of variable promisc and allmulti was changed from int to bool
by commit [1].

[1] 7dce56596f36 Convert to if_foreach_llmaddr() KPI

MFC after:      3 days

(cherry picked from commit 80dfed11fc1c61ce9168db01dee263447619e859)
DeltaFile
+2-2sys/dev/virtio/network/if_vtnet.c
+2-21 files

OPNSense/src f0d7e7dsys/dev/virtio/network if_vtnet.c

vtnet: improve control of transmit offloading

Keep the hwassist flags for transmit checksum offload and transmit
segment offload in sync with the enabled capabilities.

Reported by:            Timo Völker
Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D52765

(cherry picked from commit f2575d56c8c9a8acad4a61a3586546dff4febce1)
DeltaFile
+12-4sys/dev/virtio/network/if_vtnet.c
+12-41 files

OPNSense/src 63f53b6share/man/man4 vtnet.4

vtnet.4: use transmit checksum offloading

Use transmit checksum offloading instead transmission checksum
offloading to be consistent with other man pages.

Reported by:    Peter Lei
Sponsored by:   Netflix, Inc.

(cherry picked from commit c7263f873ee9abb772f67b5536e2380a046e1b94)
DeltaFile
+5-5share/man/man4/vtnet.4
+5-51 files

OPNSense/src c7cd488share/man/man4 vtnet.4, sys/dev/virtio/network if_vtnet.c

vtnet: disable hardware TCP LRO by default

Hardware TCP LRO results in problems in settings with IP forwarding
being enabled. In case of nodes without IP forwarding, using
software LRO is also beneficial in general, since it can provide better
information about what was received on the wire.
Therefore, disable hardware TCP LRO by default.
By tuning the loader tunable, this can be changed.

PR:                     263229
Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D52684

(cherry picked from commit 6e4b811009d63f33c59d51f28fd4a030ca90843e)
DeltaFile
+17-5share/man/man4/vtnet.4
+1-1sys/dev/virtio/network/if_vtnet.c
+18-62 files

OPNSense/src b0b3245share/man/man4 vtnet.4, sys/dev/virtio/network if_vtnet.c

vtnet: improve interface capability handling

Enable the handling of the IFCAP_RXCSUM_IPV6 handling by handling
IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 as a pair. Also make clear, that
software and hardware LRO require receive checksum offload.

Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D52682

(cherry picked from commit eaf619fddcb21859311b895a0836da3171a01531)
DeltaFile
+11-20sys/dev/virtio/network/if_vtnet.c
+3-1share/man/man4/vtnet.4
+14-212 files

OPNSense/src 4ac0fb6share/man/man4 vtnet.4

vtnet: deprecate loader tunable fixup_needs_csum

If this tunable is enabled and vtnet receives a packet with
VIRTIO_NET_HDR_F_NEEDS_CSUM set, vtnet computes the TCP/UDP checksum
and writes it in the checksum field.
This was somewhat useful when vtnet pretended that such a packet has
a correct checksum and set the mbuf flag CSUM_DATA_VALID.
But this is not the case anymore.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D52546

(cherry picked from commit 5da388d93917f5fa74022960cc65452592f71539)
DeltaFile
+3-1share/man/man4/vtnet.4
+3-11 files

OPNSense/src d92ff32sys/dev/virtio/network if_vtnet.c

vtnet: Prefer "hardware" accounting for the multicast and total number of octets sent

When ALTQ is enabled, this driver does "hardware" accounting and soft
accounting at the same time. Prefer the "hardware" one to make the logic
simpler.

Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D44817

(cherry picked from commit 2a346c8993cbb92a321a7c25bd9ac4dcaae352d1)
DeltaFile
+0-2sys/dev/virtio/network/if_vtnet.c
+0-21 files

OPNSense/src e71ace0sys/dev/virtio/network if_vtnet.c

vtnet: Do "hardware" accounting for the total number of received octets

While here, advertise the IFCAP_HWSTATS capability to avoid the net
stack from double counting it.

Co-authored-by: zlei
Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D44816

(cherry picked from commit a14d561e58529c9686a2efc47f4828ad82026e63)
DeltaFile
+3-0sys/dev/virtio/network/if_vtnet.c
+3-01 files

OPNSense/src 244acf8sys/dev/virtio/network if_vtnet.c

vtnet: fix compilation for NOIP configs

Reported by:    bz
Fixes:          3008f30d2c2c ("vtnet: improve checksum offloading")

(cherry picked from commit 614e9b33bf5594d9d09b5d296afa4f3aa6971823)
DeltaFile
+9-0sys/dev/virtio/network/if_vtnet.c
+9-01 files

OPNSense/src 52cbb08share/man/man4 vtnet.4, sys/dev/virtio/network if_vtnet.c if_vtnetvar.h

vtnet: improve checksum offloading

When transmitting a packet over the vtnet interface, map the
csum flags CSUM_DATA_VALID | CSUM_PSEUDO_HDR to the virtio
flag VIRTIO_NET_HDR_F_DATA_VALID.
When receiving a packet over the virtio network channel, translate
the virtio flag VIRTIO_NET_HDR_F_NEEDS_CSUM not to CSUM_DATA_VALID |
CSUM_PSEUDO_HDR, but to CSUM_TCP, CSUM_TCP_IPV6, CSUM_UDP, or
CSUM_UDP_IPV6.
The second change fixes a series of issue related to checksum
offloading for if_vtnet.
While there, improve the stats counters to allow a detailed view
on what is going on in relation to checksum offloading.

PR:                     165059
Reviewed by:            tuexen, manpages
Differential Revision:  https://reviews.freebsd.org/D51686

(cherry picked from commit 3008f30d2c2cabdd7e17f7fb922139da8681ffbd)
DeltaFile
+123-119sys/dev/virtio/network/if_vtnet.c
+19-9share/man/man4/vtnet.4
+1-1sys/dev/virtio/network/if_vtnetvar.h
+143-1293 files

OPNSense/src 911cfd8share/man/man4 vtnet.4

vtnet.4: remove stray line

Reported by:    Timo Völker
Fixes:          ac87d70563f8 ("vtnet.4: improve existing descriptions and add missing ones")
Sponsored by:   Netflix, Inc.

(cherry picked from commit 491986942dd2b3be8a6f232c487b3bb7c1ea412b)
DeltaFile
+1-2share/man/man4/vtnet.4
+1-21 files

OPNSense/src 7941abcshare/man/man4 vtnet.4

vtnet.4: improve existing descriptions and add missing ones

Improve several descriptions for loader tunables and add descriptions
of the statistics provided by read only sysctl-variables.

Reviewed by:            bcr
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D51985

(cherry picked from commit ac87d70563f85d53575956c6fe40615b2e501c13)
DeltaFile
+136-6share/man/man4/vtnet.4
+136-61 files

OPNSense/src 69287adshare/man/man4 vtnet.4

vtnet.4: update description of loader tunables

This is based on the description of sysctl -d.

Reviewed by:            Timo Völker, bcr
Differential Revision:  https://reviews.freebsd.org/D51604

(cherry picked from commit 0ded4647215cffde9076ab4e82870b0f491bd0b2)
DeltaFile
+22-1share/man/man4/vtnet.4
+22-11 files

OPNSense/src 81907edsys/dev/virtio/network if_vtnet.c

vtnet: mark statistic counters with CTLFLAG_STATS

Reviewed by:    Timo Völker
Differential Revision:  https://reviews.freebsd.org/D51999

(cherry picked from commit e6253eac1ab346d70db79d638c200bffa65cae02)
DeltaFile
+42-28sys/dev/virtio/network/if_vtnet.c
+42-281 files

OPNSense/src eb0203bsys/dev/virtio/network if_vtnet.c

vtnet: fix computation of sysctl variables

Fix the aggregation of the interface level counters
* dev.vtnet.X.tx_task_rescheduled,
* dev.vtnet.X.tx_tso_offloaded,
* dev.vtnet.X.tx_csum_offloaded,
* dev.vtnet.X.rx_task_rescheduled,
* dev.vtnet.X.rx_csum_offloaded, and
* dev.vtnet.X.rx_csum_failed.
Also ensure that dev.vtnet.X.tx_defrag_failed only counts the number
of times m_defrag() fails.
While there, mark sysctl-variables used for exporting statistics as
such (CTLFLAG_STATS).

Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D51999

(cherry picked from commit 03da4395158d374b5e38623f6744ce31302b530c)
DeltaFile
+117-14sys/dev/virtio/network/if_vtnet.c
+117-141 files

OPNSense/src 85edba4usr.sbin/bsdinstall/scripts zfsboot

bsdinstall: Remove support for ZFS + MBR disk layouts

It hasn't worked for some time -- as reported in review D40816
"Installing FreeBSD with Auto ZFS + MBR has been broken ever since the
move to OpenZFS with FreeBSD 13."  It relied on the partition table and
ZFS data overlapping in a very fragile way and is not a good idea.

Reviewed by:    jhb
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51028

(cherry picked from commit ee110941e35c4354baa2e5b6fd64d3025cff4b7e)
DeltaFile
+8-133usr.sbin/bsdinstall/scripts/zfsboot
+8-1331 files

OPNSense/src 545752ausr.sbin/bsdinstall/scripts zfsboot

bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oid

Signed-off-by: Siva Mahadevan <me at svmhdvn.name>
PR: 266374
Pull request: https://github.com/freebsd/freebsd-src/pull/1851
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 87a7b35f04b60956e9aa192680ae80773ec38f14)
(cherry picked from commit 093f3f26e95198bf1db082763e915d7a53c6ba82)
DeltaFile
+5-5usr.sbin/bsdinstall/scripts/zfsboot
+5-51 files

OPNSense/src 71586fausr.sbin/bsdinstall/scripts bootconfig zfsboot

bsdinstall: Add loader.efi to all ESPs we create

For proper redundancy, add copies of loader.efi to each of the ESPs we
create when we create multi-volume ZFS datasets. zfsboot creates a list
of secondary ESPs, while bootpart doesn't create any (it's the UFS
partitioning tool) because we don't supporg UFS over gmirror. The
primary ESP is mounted and is what we use efibootmgr to boot from. The
redundant copies allow the system to boot if the primary disks fails.

Sponsored by:           Netflix
MFC After:              2 days
PR:                     208802
Reviewed by:            cperciva
Differential Revision:  https://reviews.freebsd.org/D52780

(cherry picked from commit 494de51bc0074472d1b01604f085daea0844f240)
DeltaFile
+39-20usr.sbin/bsdinstall/scripts/bootconfig
+15-11usr.sbin/bsdinstall/scripts/zfsboot
+3-0usr.sbin/bsdinstall/scripts/auto
+57-313 files

OPNSense/src 57f383bshare/man/man4 epair.4, sys/net if_epair.c

epair: add support for checksum offloading

Add capabilities RXCSUM and RXCSUM6 as well as TXCSUM and TXCSUM6 for
for receive and transmit checksum offloading for TCP and UDP to the
epair interface and enable them by default.
RXCSUM and RXCSUM6 are enabled because an epair interface may receive
a packet with the csum_flag CSUM_DATA_VALID set, which is expected
only if these capabilities are enabled. Since it seems not helpful to
remove this flag, it is not possible to disable these capabilities.
TXCSUM and TXCSUM6 are synchronized between the two epair interface
ends. If enabled/disabled on one end, it will be enabled/disabled on
the other end. If the sending epair interface end has TXCSUM or TXCSUM6
enabled and the receiving end is in a bridge, it is assumed that all
interfaces in the bridge have that capability enabled. Otherwise the
bridge would have disabled that capability on the receiving epair
interface end in the bridge which would have disabled that capability
on the sending epair interface end as well due to the synchronization.

Reviewed by:            bcr, Seyed Pouria Mousavizadeh Tehrani

    [3 lines not shown]
DeltaFile
+59-2sys/net/if_epair.c
+23-1share/man/man4/epair.4
+82-32 files

OPNSense/src 2d705b2share/man/man4 epair.4, sys/net if_epair.c

590493c1:
if_epair(4): use ether_gen_addr(9) for stable MAC address

Before this change epair interfaces get a random MAC. This does
not help dhcp/dyndns when an epair gets destroyed/recreated
after restart of a jail.

With this change:
$ sysctl net.link.epair.ether_gen_addr=0
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
        ether 02:cb:78:56:e4:0a
        ether 02:cb:78:56:e4:0b
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
        ether 02:8b:9b:6a:8f:0a
        ether 02:8b:9b:6a:8f:0b

$ sysctl net.link.epair.ether_gen_addr=1
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
        ether 58:9c:fc:10:2b:b4

    [20 lines not shown]
DeltaFile
+31-4sys/net/if_epair.c
+17-5share/man/man4/epair.4
+48-92 files

OPNSense/src 7e2e14fsys/dev/ixgbe if_ix.c

ixgbe: Correct ixgbe_link_speed_to_str comment

PR:             288960
Reported by:    michaelo

(cherry picked from commit c1532f74e4684f4b4227e873bae05b16ccc0a17c)
DeltaFile
+1-1sys/dev/ixgbe/if_ix.c
+1-11 files

OPNSense/src a870283sys/dev/ixgbe if_ix.c

ixgbe: Fix incomplete speed coverage in link status logging

Originally ixgbe_if_update_admin_status() only handled 1G and 10G speeds,
causing any other speeds to display as "1 Gbps" in link status logs.

This issue is fixed by adding link speed to string conversion logic through
the introduction of a helper function, ixgbe_link_speed_to_str(), which
corrects the misleading logs to reflect accurate link speeds.

Signed-off-by: Yogesh Bhosale yogesh.bhosale at intel.com

PR:             288960
Reported by:    Mike Belanger - QNX
Differential Revision:  https://reviews.freebsd.org/D52442

(cherry picked from commit 46347b3619757e3d683a87ca03efaf2ae242335f)
DeltaFile
+31-3sys/dev/ixgbe/if_ix.c
+31-31 files

OPNSense/src fe13bb6sbin/ipfw nptv6.c

ipfw: Fix segfault in NPTv6 rule parser

If the user specified a prefix length with either the internal or
external prefix, we'd jump to check_prefix where we'd dereference p
which was most likely uninitialized.

Instead, store the various prefix lengths separately and check them
all after the loop.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D50597

(cherry picked from commit 64bc9ac8cd9a42259aeb1715d4e14902aa83fcac)
DeltaFile
+26-23sbin/ipfw/nptv6.c
+26-231 files

OPNSense/src 84a5cebcontrib/atf/atf-c tc.c atf-c.3, contrib/kyua/engine requirements.cpp

atf, kyua: Implement require.kmods.

This adds a metadata variable, require.kmods, and corresponding functions
or methods in C, C++, and shell, which allow a test to specify that it
requires particular kernel modules to run.  If the kernel modules are not
present, the test is skipped.  One might want to consider a kyua option
which makes it attempt to load the modules instead.

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

(cherry picked from commit 83a1ee578c9d1ab7013e997289c7cd470c0e6902)
DeltaFile
+61-0contrib/atf/atf-c/tc.c
+30-0contrib/kyua/engine/requirements.cpp
+22-0contrib/kyua/model/metadata.cpp
+17-1tests/sys/fs/tarfs/tarfs_test.sh
+4-11tests/sys/net/if_wg.sh
+13-1contrib/atf/atf-c/atf-c.3
+147-1312 files not shown
+214-1718 files

OPNSense/src fad9cb7sbin/ipfw Makefile, sbin/ipfw/tests ipfw_test.sh Makefile

ipfw: Add tests for the NPTv6 rule parser

(cherry picked from commit d879f1c8961d99bdbe6727004bfc6c23924526f8)
DeltaFile
+107-0sbin/ipfw/tests/ipfw_test.sh
+3-0sbin/ipfw/Makefile
+1-0sbin/ipfw/tests/Makefile
+111-03 files

OPNSense/src 7668caacontrib/kyua/engine requirements.cpp requirements.hpp, contrib/kyua/model metadata.cpp

kyua: Improve required_kmods metadata

- Make it platform agnostic
- Separate FreeBSD related code
- Fix tests
- Make it report all non-loaded modules instead of the first occurrence
  only
- Update kyuafile.5 man page

Reviewed by:    ngie
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/kyua/pull/270

(cherry picked from commit 939fec44a79323ba06cf0ad60d4b69300a8abbc6)
DeltaFile
+27-30contrib/kyua/engine/requirements.cpp
+54-0contrib/kyua/os/freebsd/reqs_checker_kmods.hpp
+50-0contrib/kyua/os/freebsd/reqs_checker_kmods.cpp
+26-0contrib/kyua/engine/requirements.hpp
+6-10contrib/kyua/model/metadata.cpp
+11-0contrib/kyua/os/freebsd/main.cpp
+174-4010 files not shown
+203-5416 files

OPNSense/src f3f36d3sys/net if_gif.c if_bridge.c

EtherIP: Fix passing the address family from if_bridge(4) to gif(4)

Given IPPROTO_IPV4, IPPROTO_IPV6 and IPPROTO_ETHERIP have different
protocol numbers, then it is perfect valid to tunnel IPv4, IPv6 and
Ethernet traffic over IPv[46] by the same interface. Since gif(4) has
already utilized the inbound csum_data field to carry address family,
also teach if_bridge(4) to do that, rather than checking if a gif(4)
interface is member of a if_bridge(4) interface.

Without this fix, tunnel IPv[46] over IPv[46] will not work when the
gif(4) interface is member of a if_bridge(4) interface, aka the EtherIP
setup, as the address family passed from gif_output() will be overwritten
with the wrong one AF_LINK by gif_transmit(), and end up with incorrectly
encapsulated packets.

PR:             227450
Reviewed by:    kp
Tested by:      meta
Fixes:          8a0308722372 gif(4): Assert that gif_output() isn't called for EtherIP

    [4 lines not shown]
DeltaFile
+3-7sys/net/if_gif.c
+6-0sys/net/if_bridge.c
+9-72 files

OPNSense/src b0ff0e4sys/dev/random random_harvestq.c randomdev.h, sys/dev/virtio/random virtio_random.c

random: Make random_source definitions const

We can do so trivially, so make these tables read-only.  No functional
change intended.

Reviewed by:    cem, emaste
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52003

(cherry picked from commit d5f55356a2fbf8222fb236fe509821e12f1ea456)
DeltaFile
+3-3sys/dev/random/random_harvestq.c
+2-2sys/dev/random/randomdev.h
+1-1sys/dev/random/darn.c
+1-1sys/dev/random/ivy.c
+1-1sys/dev/virtio/random/virtio_random.c
+1-1sys/dev/random/nehemiah.c
+9-93 files not shown
+12-129 files

OPNSense/src 99461e2sys/dev/re if_re.c

if_re: Add PNP info for module

Add PNP info so it the module can be by devmatch(8) and automatically
loaded. On non-x86 platforms it is not included in GENERIC.

Reviewed by:    imp
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52557

(cherry picked from commit e13b5298ec87be03da2231bc7b44a6a4b976b850)
DeltaFile
+2-0sys/dev/re/if_re.c
+2-01 files

OPNSense/src 7db381asys/dev/re if_re.c

re: Make sure re_rxeof() is called in net epoch context

It may pass packets up the stack and so needs to be called in a network
epoch.  When a watchdog timeout happens, we need to enter a section
explicitly.

Reviewed by:    zlei, glebius, adrian
MFC after:      2 weeks
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D51885

(cherry picked from commit b653a281f5a977ba73b3d405874f8af8e8b6b50d)
DeltaFile
+3-0sys/dev/re/if_re.c
+3-01 files