]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agosyslog.conf.5: Fix the message priority order
Felix Guest [Tue, 21 Sep 2021 15:29:39 +0000 (11:29 -0400)]
syslog.conf.5: Fix the message priority order

PR: 219942

(cherry picked from commit 8678140127296c15894094087b81f71fe79a21d9)

2 years agofreebsd32: Fix a double copyin in sendmsg() and recvmsg()
Mark Johnston [Sun, 19 Sep 2021 17:45:09 +0000 (13:45 -0400)]
freebsd32: Fix a double copyin in sendmsg() and recvmsg()

freebsd32_sendmsg() and freebsd32_recvmsg() both copyin the message
header twice, once directly and once in freebsd32_copyinmsghdr().  The
iovec length from the former is used when copying in msg_iov, but the
rest of the kernel uses the iovec length from the latter.  When
kern_sendit() and kern_recvit() iterate over the iovec to compute the
residual for I/O, they can therefore end up walking past the end of the
copied in iovec, either resulting in a system call error, userspace
memory corruption from uiomove() with invalid iovecs, or a kernel page
fault if the copied-in iovec is followed by an unmapped KVA region.

Reported by: syzbot+7cc64cd0c49605acd421@syzkaller.appspotmail.com
Reviewed by: kib, emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit fea1a98ead918b39280b586773a923e76194400b)

2 years agofreebsd32: Provide an ANSI definition for freebsd32_recvmsg()
Mark Johnston [Sun, 19 Sep 2021 17:41:43 +0000 (13:41 -0400)]
freebsd32: Provide an ANSI definition for freebsd32_recvmsg()

Fix style in the freebsd32_sendmsg() definition.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4bda16ff184bfca5ee4bf9709a06323d9cf5945b)

2 years agovt: bound buffer access in redraw optimization
Ed Maste [Wed, 22 Sep 2021 18:41:00 +0000 (14:41 -0400)]
vt: bound buffer access in redraw optimization

PR: 248628
Reported by: oleg
Reviewed by: cem, oleg (both earlier)
Fixes: ee97b2336aa4 ("Speed up vt(4) by keeping...")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32059

(cherry picked from commit dbc7ca59451561a179f9852642e13ef024169d84)

2 years agoUpdate leap-seconds to leap-seconds.3676924800.
Xin LI [Mon, 20 Sep 2021 05:26:22 +0000 (22:26 -0700)]
Update leap-seconds to leap-seconds.3676924800.

Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800.
MFC after: 3 days

(cherry picked from commit 7ba7bf48d5bd6ca89f4e81579456b74ee7aa9e4f)

2 years agoe1000: Catch up commit with DPDK
Kevin Bowling [Fri, 17 Sep 2021 02:30:49 +0000 (19:30 -0700)]
e1000: Catch up commit with DPDK

Various syncs with the e1000 shared code from DPDK:
"cid-gigabit.2020.06.05.tar.gz released by ND"

Approved by: imp
Obtained from: DPDK
MFC after: 1 week

(cherry picked from commit 984d1616be883bc2c351aff9aa69b1abd7d1214c)

2 years agoe1000: prevent ULP flow if cable connected
Wenzhuo Lu [Fri, 16 Oct 2015 02:51:03 +0000 (10:51 +0800)]
e1000: prevent ULP flow if cable connected

Enabling ulp on link down when cable is connect caused an infinite
loop of linkup/down indications in the NDIS driver.
After discussed, correct flow is to enable ULP only when cable is
disconnected.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Approved by: imp
Obtained from: DPDK (4bff263d54d299269966365f9697941eecaa241b)
MFC after: 1 week

(cherry picked from commit 40fa6e53f53cde84f6f5c7330f89e4ae373d7d93)

2 years agoe1000: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:15 +0000 (16:03 +0100)]
e1000: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: 'link' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  if (link) {

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Approved by: imp
Obtained from: DPDK (46136031f19107f4e9b6b3a952cb7f57877a7f0f)
MFC after: 1 week

(cherry picked from commit 089cdb3990f47be3cd34d1a57567a2e89c917929)

2 years agoe1000: fix multicast setting in VF
Yong Wang [Tue, 21 Feb 2017 09:33:23 +0000 (04:33 -0500)]
e1000: fix multicast setting in VF

In function e1000_update_mc_addr_list_vf(), "msgbuf[0]" is used prior
to initialization at "msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW".
And "msgbuf[0]" is overwritten at "msgbuf[0] = E1000_VF_SET_MULTICAST".

Fix it by moving the second line prior to the first one that mentioned
above.

Fixes: dffbaf7880a8 ("e1000: revert fix for multicast in VF")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Approved by: imp
Obtained from: DPDK (f58ca2f9ef6)
MFC after: 1 week

(cherry picked from commit ecf2a89a997ad4a14339b6a2f544e44b422620a0)

2 years agoe1000: fix timeout for shadow RAM write
Chengwen Feng [Wed, 21 Apr 2021 09:15:35 +0000 (17:15 +0800)]
e1000: fix timeout for shadow RAM write

This fixes the timed out for shadow RAM write EEWR can't be detected.

Fixes: 5a32a257f957 ("e1000: more NICs in base driver")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Approved by: imp
Obtained from: DPDK (4a8ab48ec47b3616272e50620b8e1a9599358ea6)
MFC after: 1 week

(cherry picked from commit f6517a7e69c10c6057d6c990a9f3ea22a2b62398)

2 years agoe1000: cleanup pre-processor tags
Guinan Sun [Mon, 6 Jul 2020 08:12:20 +0000 (08:12 +0000)]
e1000: cleanup pre-processor tags

The codes has been exposed correctly, so remove pre-processor tags.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (a50e998a0fd94e5db508710868a3417b1846425c)
MFC after: 1 week

(cherry picked from commit 9c4a0fabc8b88af0d9fd3f0d67bd080714d1ee4b)

2 years agoe1000: introduce DPGFR register
Guinan Sun [Mon, 6 Jul 2020 08:12:19 +0000 (08:12 +0000)]
e1000: introduce DPGFR register

Defined DPGFR, Dynamic Power Gate Force Control Register.

Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (1469e5aceffbdcebe834292aadb40b1bd1602867)
MFC after: 1 week

(cherry picked from commit 7fb2111413c799414c86d7bfdcc72bc1c6302726)

2 years agoe1000: expose FEXTNVM registers and masks
Guinan Sun [Mon, 6 Jul 2020 08:12:16 +0000 (08:12 +0000)]
e1000: expose FEXTNVM registers and masks

Adding defines for FEXTNVM8 and FEXTNVM12 registers with new masks for
future use.

Signed-off-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (6d208ec099cd870a73c6b444b350a82c7a26c5e4)
MFC after: 1 week

(cherry picked from commit de965d042fa4d341cec3fa7cacac0f30f224bde4)

2 years agoe1000: add missed define for VFTA
Guinan Sun [Mon, 6 Jul 2020 08:12:13 +0000 (08:12 +0000)]
e1000: add missed define for VFTA

VLAN filtering using the VFTA (VLAN Filter Table Array) and
should be initialized prior to setting rx mode.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (fc9933953c90e99970aa867c38f9c6e6c5d0488d)
MFC after: 1 week

(cherry picked from commit a8bb4ab7cfb84195ef8af3c788fecdc8830fc960)

2 years agoe1000: increase timeout for ME ULP exit
Guinan Sun [Mon, 6 Jul 2020 08:12:09 +0000 (08:12 +0000)]
e1000: increase timeout for ME ULP exit

Due timing issues in WHL and since recovery by host is
not always supported, increased timeout for Manageability Engine(ME)
to finish Ultra Low Power(ULP) exit flow for Nahum before timer expiration.

Signed-off-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (cf1f3ca45d33e793ca581200b4000c39a798113e)
MFC after: 1 week

(cherry picked from commit e8e3171d992f3255cc8e5a0f59912d07679cc94c)

2 years agoe1000: add missing register defines
Guinan Sun [Mon, 6 Jul 2020 08:12:08 +0000 (08:12 +0000)]
e1000: add missing register defines

Added defines for the EEC, SHADOWINF and FLFWUPDATE registers needed for
the nvmupd_validate_offset function to correctly validate the NVM update
offset.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (2c7fe65ab9a31e6ebf438dad7ccc59bcde83a89f)
MFC after: 1 week

(cherry picked from commit 09888d4bc1a2c45d121046f79be5c01e4889a67e)

2 years agoe1000: add PCIm function state
Guinan Sun [Mon, 6 Jul 2020 08:12:07 +0000 (08:12 +0000)]
e1000: add PCIm function state

Added define to pcim function state.

Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (7ee1a3b273c7f321b50e6ba17c3d9537b1b08347)
MFC after: 1 week

(cherry picked from commit a6f0cc373f0afc24c9c27bbba45a6a7a3ac268d1)

2 years agoe1000: expose MAC functions
Guinan Sun [Mon, 6 Jul 2020 08:12:06 +0000 (08:12 +0000)]
e1000: expose MAC functions

Now the functions are being accessed outside of the file, we need
to properly expose them for silicon families to use.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (df01c0ee277d51f81d7d72501dba97550d3b6c4a)
MFC after: 1 week

(cherry picked from commit d1c37752e2afb51dfb2e08afe714a799788b6ede)

2 years agoe1000: update for i210 slow system clock
Guinan Sun [Mon, 6 Jul 2020 08:11:56 +0000 (08:11 +0000)]
e1000: update for i210 slow system clock

This code is required for the update for system clock.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (3f0188c8f29847038bc9f306b2570ace57e3811c)
MFC after: 1 week

(cherry picked from commit 1883a6ff3b2ebaf108c45717c8eb94e0a76bb0b9)

2 years agoe1000: remove duplicated phy codes
Guinan Sun [Mon, 6 Jul 2020 08:12:05 +0000 (08:12 +0000)]
e1000: remove duplicated phy codes

Add two files base.c and base.h to reduce the redundancy
in the silicon family code.
Remove the code duplication from e1000_82575 files.
Clean family specific functions from base.
Fix up a stray and duplicate function declaration.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (44dddd14059f151f39f7e075b887decfc9a10f11)
MFC after: 1 week

(cherry picked from commit 6b9d35fac12bf657cd1df8f1521c70704ff62b61)

2 years agoe1000: modify HW level time sync mechanisms
Guinan Sun [Mon, 6 Jul 2020 08:12:04 +0000 (08:12 +0000)]
e1000: modify HW level time sync mechanisms

Add additional configuration space access to allow HW
level time sync mechanism.

Signed-off-by: Evgeny Efimov <evgeny.efimov@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (d53391f1fe2e0eba8818517fdf285f893d95dcc8)
MFC after: 1 week

(cherry picked from commit d50f362b505e9026fbd33d00dc43e09cac26a209)

2 years agoe1000: fix minor issues and improve code style
Guinan Sun [Mon, 6 Jul 2020 08:12:03 +0000 (08:12 +0000)]
e1000: fix minor issues and improve code style

Fix typo in piece of code of NVM access for SPT.
And cleans up the remaining instances in the shared code
where it was not adhering to the Linux code standard.
Wrong description was found in the mentioned file, so fix them.
Remove shadowing variable declarations.

Relating to operands in bitwise operations having different sizes.
Unreachable code since *clock_in_i2c_* always return success.
Don't return unused s32 and don't check for constants.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (b8592c89c8fbc871d22313dcac0b86c89a7d5a62)
MFC after: 1 week

(cherry picked from commit 6c59e1866ca7a48d84f1d298bb3e6a07d2e6f756)

2 years agoe1000: add function parameter descriptions
Guinan Sun [Mon, 6 Jul 2020 08:12:02 +0000 (08:12 +0000)]
e1000: add function parameter descriptions

Add function parameter descriptions to address gcc 7 warnings.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (1bf35d435c9764e83be76042fa6489dd127b6c40)
MFC after: 1 week

(cherry picked from commit 5b426b3e8cbd5abdb3a57ff49cd27c36cac03427)

2 years agoe1000: expose xMDIO methods
Guinan Sun [Mon, 6 Jul 2020 08:12:00 +0000 (08:12 +0000)]
e1000: expose xMDIO methods

Move read and write xmdio methods to e1000_phy.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (b14d20f1b2bb0e6d95f19963c5d7f55374e0ead9)
MFC after: 1 week

(cherry picked from commit da24467c7a162691a14f2f74d90ff8dedb816cfc)

2 years agoe1000: add missing device ID
Guinan Sun [Mon, 6 Jul 2020 08:12:10 +0000 (08:12 +0000)]
e1000: add missing device ID

Adding Intel(R) I210 Gigabit Network Connection 15F6 device ID for SGMII
flashless automotive device.

Signed-off-by: Kamil Bednarczyk <kamil.bednarczyk@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (586d770bfefc01d4af97c0ddf17c960c3e49ec22)
MFC after: 1 week

(cherry picked from commit 82a9d0c2c1ef75703d16e49e96d1e7b0bf046882)

2 years agoe1000: support flashless i211 PBA
Guinan Sun [Mon, 6 Jul 2020 08:11:59 +0000 (08:11 +0000)]
e1000: support flashless i211 PBA

Add support to print PBA when using flashless.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (d3c41d90dfd5b39dec14c74cf53086f4e6634aed)
MFC after: 1 week

(cherry picked from commit de0ae5d1cb896dbc04c5334ef0b864b3c841c3ce)

2 years agoe1000: Update copyrights and readme
Kevin Bowling [Thu, 16 Sep 2021 11:35:45 +0000 (04:35 -0700)]
e1000: Update copyrights and readme

Copyrights in sync with "cid-gigabit.2020.06.05.tar.gz released by ND"
(from DPDK).

README from the latest em-7.7.8 on intel.com

Approved by: imp
MFC after: 1 week

(cherry picked from commit 702cac6c6bf20ca43db26c38185f65fc9ed1935e)

2 years agoFix -Wpointer-sign warnings in usr.bin/grep
Alex Richardson [Mon, 21 Sep 2020 09:03:37 +0000 (09:03 +0000)]
Fix -Wpointer-sign warnings in usr.bin/grep

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D26479

(cherry picked from commit 86ce5365215ab252e0d1904b410381c96cfc4076)

2 years agousr.bin/grep: Fix Address OOB read error
Alex Richardson [Tue, 19 Jan 2021 11:35:07 +0000 (11:35 +0000)]
usr.bin/grep: Fix Address OOB read error

I found this when compiling all the bootstrap tools with -fsanitize=addres:

==65590==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62d000008400 at pc 0x000000473053 bp 0x7ffc1c7dd910 sp 0x7ffc1c7dd0b8
READ of size 32769 at 0x62d000008400 thread T0
    #0 0x473052 in regexec (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052)
    #1 0x4c9cf3 in procline /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:539:8
    #2 0x4c8687 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:379:18
    #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8

0x62d000008400 is located 0 bytes to the right of 32768-byte region [0x62d000000400,0x62d000008400)
allocated by thread T0 here:
    #0 0x493d5d in malloc (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x493d5d)
    #1 0x4cad75 in grep_malloc /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:656:13
    #2 0x4c8129 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c
    #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8

SUMMARY: AddressSanitizer: heap-buffer-overflow (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052) in regexec

Reviewed By: kevans
MFC after: 1 week

(cherry picked from commit 81c3f64110bb76e24d6062eafd7206c10f676d6f)

2 years agoreadelf: document that -u / --unwind is not yet implemented
Ed Maste [Fri, 17 Sep 2021 13:59:41 +0000 (09:59 -0400)]
readelf: document that -u / --unwind is not yet implemented

ELF tool chain readelf accepts -u / --unwind but just ignores the
option.  This was previously undocumented, which could be confusing for
someone encountering `readelf -u` (in a script or GNU readelf example).

Reported by: markj (in D32003)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8)

2 years agoreadelf: include notes (-n) and unwind (-u) in --all/-a
Ed Maste [Fri, 17 Sep 2021 12:06:27 +0000 (08:06 -0400)]
readelf: include notes (-n) and unwind (-u) in --all/-a

This matches the GNU and LLVM versions of readelf.

As markj noted in the review -u is not actually implemented yet and has
no effect.  The option is accepted and just ignored.

Reported by: andrew
Reviewed by: andrew, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32003

(cherry picked from commit f161abf9f2cd7fdd28543f9774de82c89675477c)

2 years agogrep: fix combination of quiet and count flag
Mariusz Zaborski [Fri, 9 Jul 2021 12:09:14 +0000 (14:09 +0200)]
grep: fix combination of quiet and count flag

When the quiet (-q) flag is provided, we don't expect any output.
Currently, the behavior is broken:
$ grep -cq flag util.c
1

$ grep -cs flag util.c
55

First of all, we print a number to stdout. Secondly, it just returns
0 or 1 (which is unexpected). GNU grep with c and q flags doesn't
print anything.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D31108

(cherry picked from commit 24c681a7f6d6c777221fdbd289da64ff65ad8785)

2 years agoimport nvi 2.2.0-3bbdfe4
Baptiste Daroussin [Fri, 21 May 2021 20:50:50 +0000 (22:50 +0200)]
import nvi 2.2.0-3bbdfe4

(cherry picked from commit 6680e5a52f8abf059bbbd3e0be66d9dce476cdf9)

2 years agonvi: fix catalog generation
dankm [Fri, 26 Feb 2021 15:32:01 +0000 (16:32 +0100)]
nvi: fix catalog generation

Upstream broke catalog generation with some over-eagre style cleanups.
This brings in my pull request.

Obtained from: https://github.com/lichray/nvi2/pull/88
Differential Revision: https://reviews.freebsd.org/D28594

(cherry picked from commit 888ae5725257c251319f14f31c2e941717b675f2)

2 years agoFix buildworld on Linux/macOS after nvi update
Alex Richardson [Mon, 12 Oct 2020 10:42:24 +0000 (10:42 +0000)]
Fix buildworld on Linux/macOS after nvi update

This re-applies r365941 which was lost in the nvi update.

(cherry picked from commit 5ce117c698bce69808f214781fe03a2c0f451d9f)

2 years agoUpdate nvi to 2.2.0-05ed8b9
Baptiste Daroussin [Thu, 1 Oct 2020 04:46:23 +0000 (04:46 +0000)]
Update nvi to 2.2.0-05ed8b9

This version incorporates many fixes in particular a fix for vi -w
Another approach was proposed to merge those fixes (see review), I find
it easier to track changes if we keep importing snapshot on regular
basis

PR: 241985
Reported by: fernape
Differential Revision: https://reviews.freebsd.org/D26158

(cherry picked from commit 755cc40c21ca63388c6a67ba848a908b429e9391)

2 years agovi(1): Add URL to the vi/ex reference manual in the man page
Fernando Apesteguía [Fri, 25 Sep 2020 10:20:12 +0000 (10:20 +0000)]
vi(1): Add URL to the vi/ex reference manual in the man page

Reported in PR 241985

The manual page references the "vi/ex reference manual" but there is no
information about where to find that document. Add a reference to the manual in
the SEE ALSO section since the Project hosts a copy of it[1].

Change sent upstream[2]

If D26158 gets reviewed and committed, we could close that PR.

[1] https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf).
[2] https://github.com/lichray/nvi2/pull/85

Submitted by: freebsd@tim.thechases.com
Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D26163

(cherry picked from commit f1cba2b70cd1f705d7b878e7b8d9f99fe389dc7a)

2 years agoFix vi build on Linux/macOS
Alex Richardson [Mon, 21 Sep 2020 09:03:42 +0000 (09:03 +0000)]
Fix vi build on Linux/macOS

This absolute include causes a build failure on Linux for me:
.../cheri/freebsd/contrib/nvi/cl/../common/common.h:10:10: fatal error: '/usr/include/db.h' file not found

This change patches the file to use #include <db.h> instead until a
solution has been found upstream. See also https://github.com/lichray/nvi2/issues/69

Reviewed By: bapt
Differential Revision: https://reviews.freebsd.org/D26480

(cherry picked from commit 2bd2b113353d79cc7bdd315c3c76e0fc13218219)

2 years agoUpdate nvi to 2.2.0
Baptiste Daroussin [Wed, 9 Sep 2020 08:38:47 +0000 (08:38 +0000)]
Update nvi to 2.2.0

Main changes:
* Vim-style expandtab option
* Provides Turkish translation
* Backspace now deletes \ rather than being escaped
* T during motion commands is now VI-compatible
* Encoding related fixes, such as UTF-8 detection
* Fixed a number of memory management issues

(cherry picked from commit 110d525ec6188f3c9dc4f54c4bc1cced2f7184cd)

2 years agovi.1: Fix a typo
Mateusz Piotrowski [Mon, 9 Dec 2019 17:58:22 +0000 (17:58 +0000)]
vi.1: Fix a typo

Reviewed by: bcr
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D22734

(cherry picked from commit 2486d00026666397c4f9b42187af6ecf9765bf4b)

2 years agoixl(4): Fix 2.5 and 5G speeds reporting and update shared code
Krzysztof Galazka [Mon, 13 Sep 2021 20:39:59 +0000 (13:39 -0700)]
ixl(4): Fix 2.5 and 5G speeds reporting and update shared code

Fix 2.5 and 5G speeds reporting and update shared code with recent
changes:
- Update expected FW API versions for X710 and X722 adapters
- Define pointers related to Preservation Rules Module
- Add definitions for Shadow RAM pointers to new modules: 5th and 6th
  FPA, and Preservation Rules Module.
- Add I40E_RX_PTYPE_PARSER_ABORTED definition, so the driver will know
  opcode for parser aborted packets.
- Add the new filter types needed for custom cloud filters.
- Add support for Minimum Rollback Revision
- Fix RX_ONLY mode for unicast promiscuous on VLAN
- Add EEE LPI status check for X722 adapters
- Fix PHY type identifiers for 2.5G and 5G adapters
- Fix update link data for X722
- Increase the timeout value for PF reset to give PF more time to finish
  reset if it is loaded with filters.
- Added support for Min Rollback Revision for 4 more X722 modules
- Fix reporting of Active Optical Cable media type
- Add flags and fields for double VLAN processing
- Fix potentially uninitialized variables in NVM code

Reviewed by: kbowling@, mike.jakubik@gmail.com
Tested by: gowtham.kumar.ks@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D31565

(cherry picked from commit abf774528d7e497460510b0026db85e30f054142)

2 years agoixl(4): Fix reporting of unqualified transceivers
Krzysztof Galazka [Fri, 20 Aug 2021 21:12:28 +0000 (14:12 -0700)]
ixl(4): Fix reporting of unqualified transceivers

When link_active_on_if_down flag is disabled and link is brought down
with ifconfig, FW reports a false positive link event about an
unqualified transceiver. The condition used in the driver to filter out
those false positive events was incorrect and caused that unqualified
module event to also not be reported when the event was valid.

Change the condition to rely on IFF_UP flag instead of
link_active_on_if_down and bump driver version to 2.3.1-k.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: stallamr@netapp.com, erj@
Tested by: gowtham.kumar.ks@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D30733

(cherry picked from commit c4622b01d2f12b889b57ff7d0b03a38dfcb00fd8)

2 years agoixl(4): Add tunable to override Flow Control settings
Krzysztof Galazka [Mon, 5 Apr 2021 18:08:33 +0000 (11:08 -0700)]
ixl(4): Add tunable to override Flow Control settings

Add flow_control to hw.ixl tunables tree to let override
initial flow control configuration for all interfaces.
Keep using configuration set by NVM by default.

Reviewed by: erj@, gallatin@
Tested by: gowtham.kumar.ks_intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D29338

(cherry picked from commit 20a52706c814ccfd91c65586404abd2a1563a330)

2 years agoice(4): Update to version 0.28.1-k
Eric Joyner [Tue, 23 Feb 2021 01:45:09 +0000 (17:45 -0800)]
ice(4): Update to version 0.28.1-k

This updates the driver to align with the version included in
the "Intel Ethernet Adapter Complete Driver Pack", version 25.6.

There are no major functional changes; this mostly contains
bug fixes and changes to prepare for new features. This version
of the driver uses the previously committed ice_ddp package
1.3.19.0.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28640

(cherry picked from commit d08b8680e12ad692736c84238dcf45c70c228914)

2 years agoice_ddp: Update package file to 1.3.19.0
Eric Joyner [Tue, 23 Feb 2021 01:43:54 +0000 (17:43 -0800)]
ice_ddp: Update package file to 1.3.19.0

This package is intended to be used with ice(4) version 0.28.1-k.
That update will happen in a forthcoming commit.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation
(cherry picked from commit a7ac518bff64d48cf262c60c4dc57eef34e74a07)

2 years agoix(4): Report RX errors as sum of all RX error counters
Piotr Pietruszewski [Wed, 3 Mar 2021 01:21:58 +0000 (17:21 -0800)]
ix(4): Report RX errors as sum of all RX error counters

HW keeps track of RX errors using several counters, each for
specific type of errors. Report RX errors to OS as sum
of all those counters: CRC errors, illegal bytes, checksum,
length, undersize, fragment, oversize and jabber errors.

Also, add new "rx_errs" sysctl in the dev.ix.N.mac_stats tree. This is
to provide an another way to display the sum of RX errors.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reviewed By: erj
Tested By: gowtham.kumar.ks@intel.com
Sponsored By: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D27191

(cherry picked from commit afb1aa4e6df245d38fd2ba683fa521d5dabe8392)

2 years agoixl(4): Report RX errors as sum of all RX error counters
Krzysztof Galazka [Wed, 3 Mar 2021 01:33:11 +0000 (17:33 -0800)]
ixl(4): Report RX errors as sum of all RX error counters

HW keeps track of RX errors using several counters, each for
specific type of errors. Report RX errors to OS as sum
of all those counters: CRC errors, illegal bytes, checksum,
length, undersize, fragment, oversize and jabber errors.

There is no HW counter for frames with invalid L3/L4 checksums
so add a SW one.

Also add a "rx_errors" sysctl with a copy of netstat IERRORS
counter value to make it easier accessible from scripts.

Reviewed By: erj
Tested By: gowtham.kumar.ks@intel.com
Sponsored By: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D27639

(cherry picked from commit 9f99061ef9c95b171fc92d34026222bb5e052337)

2 years agoixl(4): Add ability to control link state on ifconfig down
Krzysztof Galazka [Wed, 3 Mar 2021 01:38:51 +0000 (17:38 -0800)]
ixl(4): Add ability to control link state on ifconfig down

Add sysctl link_active_on_if_down, which allows user to control
if interface is kept in active state when it is brought
down with ifconfig. Set it to enabled by default to preserve
backwards compatibility.

Reviewed by: erj
Tested by: gowtham.kumar.ks@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28028

(cherry picked from commit 21802a127d83e8a8c721d69b697e7ddb223d7797)

2 years agoRemove unnecessary WITNESS check in x86 bus_dma
Jason A. Harmening [Wed, 3 Jun 2020 00:16:36 +0000 (00:16 +0000)]
Remove unnecessary WITNESS check in x86 bus_dma

When I did some bus_dma cleanup in r320528, I brought forward some sketchy
WITNESS checks from the prior x86 busdma wrappers, instead of recognizing
them as technical debt and just dropping them.  Two of these were removed in
r346351 and r346851, but one remains in bounce_bus_dmamem_alloc(). This check
could be constrained to only apply in the BUS_DMA_NOWAIT case, but it's cleaner
to simply remove it and rely on the checks already present in the sleepable
allocation paths used by this function.

While here, remove another unnecessary witness check in bus_dma_tag_create
(the tag is always allocated with M_NOWAIT), and fix a couple of typos.

Reported by: cem
Reviewed by: kib, cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25107

(cherry picked from commit 1dccf71b4b6dca1a912f3085918239559498c508)

2 years agobsd.lib.mk: add conditions for building _pie.a archives
Ed Maste [Sun, 12 Sep 2021 16:45:50 +0000 (12:45 -0400)]
bsd.lib.mk: add conditions for building _pie.a archives

As with other .a targets, build _pie.a archives only if LIB is set.

At present we build _pie.a only for INTERNALLIBs, and none of them
include bsd.lib.mk without setting LIB.  However, we might want to build
_pie.a for non-INTERNALLIBs in the future.

Reviewed by: arichardson
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31920

(cherry picked from commit 7c0226cad3f36a05832f9c5216dfa3dadb91c92d)

2 years agotest/ptrace/scescx.c: fix printing of braces for syscalls without args
Konstantin Belousov [Thu, 16 Sep 2021 17:23:11 +0000 (20:23 +0300)]
test/ptrace/scescx.c: fix printing of braces for syscalls without args

(cherry picked from commit 9a8eb5db55964c2fc7aca0db5939d8300badc9ab)

2 years agoAdd -Wno-error=unused-but-set-variable when building with Clang 13+
Dimitry Andric [Thu, 26 Aug 2021 15:36:03 +0000 (17:36 +0200)]
Add -Wno-error=unused-but-set-variable when building with Clang 13+

This warning triggers many times while building world. Downgrade it to a
warning until all occurrences have been fixed. Once the Clang warnings
have been fixed we should be able to turn it on for GCC as well. See
also f4fed768bba45a406f73ed1491d7e52fd1a8711d which did the same for the
kernel builds.

Reviewed by: arichardson, imp
Differential Revision: https://reviews.freebsd.org/D31927

(cherry picked from commit 45feade38ec3e8e30086dedc6ee81cbf816293e3)

2 years agoe1000: Revert Update intel shared code
Kevin Bowling [Wed, 8 Sep 2021 22:43:13 +0000 (15:43 -0700)]
e1000: Revert Update intel shared code

This reverts commit fc7682b17f3738573099b8b03f5628dcc8148adb.

This will be done incrementally to help with bisecting an issue in
later I21x devices (ich8lan).

PR: 258153
Approved by: imp
MFC after: 1 day

(cherry picked from commit a4378873e9ce1b35b55378c21f8eae69e58c2525)

2 years agocalendar.freebsd: Fix off-by-one error
Kevin Bowling [Fri, 17 Sep 2021 23:05:27 +0000 (16:05 -0700)]
calendar.freebsd: Fix off-by-one error

(cherry picked from commit 007c2463d6d017ad5321d5cd2bc500e577d22196)

2 years agopf: fix NOINET6 builds
Kristof Provost [Fri, 10 Sep 2021 15:20:39 +0000 (17:20 +0200)]
pf: fix NOINET6 builds

MFC after: 1 week
Sponsored by: Modirum MDPay

(cherry picked from commit 9bdff593ead9434e01cfb6084f21c3e93a22963d)

2 years agopf: qid and pqid can be uint16_t
Kristof Provost [Tue, 7 Sep 2021 12:41:37 +0000 (14:41 +0200)]
pf: qid and pqid can be uint16_t

tag2name() returns a uint16_t, so we don't need to use uint32_t for the
qid (or pqid). This reduces the size of struct pf_kstate slightly. That
in turn buys us space to add extra fields for dummynet later.

Happily these fields are not exposed to user space (there are user space
versions of them, but they can just stay uint32_t), so there's no ABI
breakage in modifying this.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31873

(cherry picked from commit b64f7ce98f5286721a38b31fa2180313f800fb1d)

2 years agopf tests: synproxy to localhost test
Kristof Provost [Wed, 30 Jun 2021 12:22:27 +0000 (14:22 +0200)]
pf tests: synproxy to localhost test

Test syn-proxying a connection to the local host.

Sponsored by: Modirum MDPay
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31854

(cherry picked from commit 6598cababf6425181a755ec97c3fa66d7ee31393)

2 years agopf: fix synproxy to local
Kristof Provost [Wed, 1 Sep 2021 07:54:55 +0000 (09:54 +0200)]
pf: fix synproxy to local

When we're synproxy-ing a connection that's going to us (as opposed to a
forwarded one) we wound up trying to send out the pf-generated tcp
packets through pf_intr(), which called ip(6)_output(). That doesn't
work all that well for packets that are destined for us, so in that case
we must call ip(6)_input() instead.

MFC after: 1 week
Sponsored by:   Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D31853

(cherry picked from commit 0a51d74c3ab8e7ee8771cc3ee78ffba831c953ef)

2 years agogeli(8): Do not report error on resize to the same size.
Alexander Motin [Wed, 18 Aug 2021 21:11:03 +0000 (17:11 -0400)]
geli(8): Do not report error on resize to the same size.

Just validate the old metadata and exit.  Originally the check was
added to not thash the only copy of metadata, but we can achieve the
same just by skipping the writing/trashing.  The metadata validation
should protect user from wrongly specifying new size instead of old.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

(cherry picked from commit c7cf100aafb4cb881e05a5153de152907f6c07f3)

2 years agoopenssh: remove login class restrictions leftovers
Ed Maste [Thu, 2 Sep 2021 21:13:29 +0000 (17:13 -0400)]
openssh: remove login class restrictions leftovers

MFC after: 2 weeks
Fixes: 27ceebbc2402 ("openssh: simplify login class...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ba91e31f478aaade96bbdbf01560e8b7cbe41b56)

2 years agoConvert cryptostats to a counter_u64 array.
Mark Johnston [Tue, 30 Jun 2020 22:01:21 +0000 (22:01 +0000)]
Convert cryptostats to a counter_u64 array.

The global counters were not SMP-friendly.  Use per-CPU counters
instead.

Reviewed by: jhb
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D25466

(cherry picked from commit 7290cb47fced28b5d0654cd1de7cc721e214ea32)

2 years agoRemove unused 32-bit compatibility structures from cryptodev.
Mark Johnston [Tue, 30 Jun 2020 15:57:11 +0000 (15:57 +0000)]
Remove unused 32-bit compatibility structures from cryptodev.

The counters are exported by a sysctl and have the same width on all
platforms anyway.

Reviewed by: cem, delphij, jhb
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D25465

(cherry picked from commit a5ae70f5a0554235c499016bec3a721adbb1043a)

2 years agoRemove CRYPTO_TIMING.
Mark Johnston [Tue, 30 Jun 2020 15:56:54 +0000 (15:56 +0000)]
Remove CRYPTO_TIMING.

It was added a very long time ago.  It is single-threaded, so only
really useful for basic measurements, and in the meantime we've gotten
some more sophisticated profiling tools.

Reviewed by: cem, delphij, jhb
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D25464

(cherry picked from commit a5c053f5a78ca68f9dcace37186142266787eaa0)

2 years agoopencrypto: add kern.crypto sysctl node
Mateusz Guzik [Wed, 15 Sep 2021 13:23:48 +0000 (13:23 +0000)]
opencrypto: add kern.crypto sysctl node

This is a direct commit to facilitate upcoming merges.

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agobnxt(4): Fix bugs in WOL support.
Alexander Motin [Thu, 2 Sep 2021 22:11:58 +0000 (18:11 -0400)]
bnxt(4): Fix bugs in WOL support.

Before this change driver reported IFCAP_WOL_MAGIC enabled, but not
supported.  It caused errors on some SIOCSIFCAP calls.  Instead
report the support if hardware supports WOL, and enabled status if
it has such filter installed on boot.

Also bnxt_wol_config() should check WOL status in if_getcapenable(),
not in if_getcapabilities() to get current one.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

(cherry picked from commit 8c14d7da5b9be78f71b1aa803e93ae7de973dd42)

2 years agoi386 loaders: avoid lld 13 garbage collecting linker sets
Dimitry Andric [Wed, 8 Sep 2021 12:04:13 +0000 (14:04 +0200)]
i386 loaders: avoid lld 13 garbage collecting linker sets

Because lld 13 and higher default to garbage collecting start/stop
symbols when using --gc-sections, the linker sets used in the i386 boot
loaders will disappear. This leads to the loaders not recognizing any
commands, and failure to boot.

Until we have a good set of linker scripts for the loaders, work around
it by disabling the start-stop-gc feature.

(cherry picked from commit c90cab0d668af5d947054e47184d4f8dcb874ec8)

2 years agoopenssh: simplify login class restrictions
Ed Maste [Tue, 31 Aug 2021 19:30:50 +0000 (15:30 -0400)]
openssh: simplify login class restrictions

Login class-based restrictions were introduced in 5b400a39b8ad.  The
code was adapted for sshd's Capsicum sandbox and received many changes
over time, including at least fc3c19a9fceebd393de91cc3, and
e8c56fba2926.

During an attempt to upstream the work a much simpler approach was
suggested.  Adopt it now in the in-tree OpenSSH to reduce conflicts with
future updates.

Submitted by: Yuchiro Naito (against OpenSSH-portable on GitHub)
Obtained from: https://github.com/openssh/openssh-portable/pull/262
Reviewed by: allanjude, kevans
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31760

(cherry picked from commit 27ceebbc2402e4c98203c7eef9696f4bd3d326f8)

2 years agoapr: Merge r1889604, r1807975 from trunk:
Joe Orton [Fri, 2 Jul 2021 11:10:33 +0000 (11:10 +0000)]
apr: Merge r1889604, r1807975 from trunk:

* random/unix/sha2.c (apr__SHA256_Final, apr__SHA256_End): Fix parameter
  buffer lengths to match declaration, avoiding GCC 11 warning.
  (no functional change)

Bounds-check human-readable date fields (credit: Stefan Sperling)

Submitted by: jorton, niq
Reviewed by: jorton

git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1891198 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit fc1b69d0311e50ed05c00c46ad7dd5d560e57cb6)

2 years agoAlign taskqueue_enqueue_timeout() to hardclock.
Alexander Motin [Wed, 1 Sep 2021 03:47:51 +0000 (23:47 -0400)]
Align taskqueue_enqueue_timeout() to hardclock.

It is done for all other KPIs using HZ, but was missed here.

MFC after: 2 weeks

(cherry picked from commit 706b1a5724d668a8752ac89cd67113e4c6917d54)

2 years agonetpfil tests: IPv6 dummynet queue test
Kristof Provost [Thu, 2 Sep 2021 13:40:51 +0000 (15:40 +0200)]
netpfil tests: IPv6 dummynet queue test

Same as the v4 test, but with IPv6.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31789

(cherry picked from commit 12184311c16160464a36ae05b1cd8c5e3c24fbaa)

2 years agonetpfil tests: dummynet queue test
Kristof Provost [Thu, 2 Sep 2021 13:38:04 +0000 (15:38 +0200)]
netpfil tests: dummynet queue test

Test prioritisation and dummynet queues.
We need to give the pipe sufficient bandwidth for dummynet to work.
Given that we can't rely on the TCP connection failing alltogether, but
we can measure the effect of dummynet by imposing a time limit on a
larger data transfer.

If TCP is prioritised it'll get most of the pipe bandwidth and easily
manage to transfer the data in 3 seconds or less. When not prioritised
this will not succeed.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31788

(cherry picked from commit cb6bfef9ca78623e33d2aef347dcee112a639103)

2 years agodummynet tests: pipe test for IPv6
Kristof Provost [Mon, 14 Jun 2021 19:24:59 +0000 (21:24 +0200)]
dummynet tests: pipe test for IPv6

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31787

(cherry picked from commit 5fda5913e16afac72f3f420e227803e33d4c1542)

2 years agonetpfil tests: Basic dummynet pipe test
Kristof Provost [Fri, 21 May 2021 09:14:34 +0000 (11:14 +0200)]
netpfil tests: Basic dummynet pipe test

Test dummynet pipes (i.e. bandwidth limitation) with ipfw. This is put
in the common tests because we hope to add dummynet support to pf in the
near future.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30380

(cherry picked from commit ea3eca5cb6dbcb4deb7c7277a65c48911f0475d1)
(cherry picked from commit 1f4a6403969271885d1c37fd642820d5a6562791)

2 years agonetpfil tests: Add forward test for the three firewalls
Kristof Provost [Fri, 23 Aug 2019 12:11:46 +0000 (12:11 +0000)]
netpfil tests: Add forward test for the three firewalls

Submitted by: Ahsan Barkati
Reviewed by: kp
Sponsored by: Google, Inc. (GSoC 2019)
Differential Revision: https://reviews.freebsd.org/D21321

(cherry picked from commit 39cae0d5ed570804b4e689946f131447597122b8)

2 years agonetpfil tests: Add too many fragments test for pf, ipfw and ipf
Kristof Provost [Tue, 20 Aug 2019 14:46:12 +0000 (14:46 +0000)]
netpfil tests: Add too many fragments test for pf, ipfw and ipf

Add test for checking that the packets are dropped if it is fragmented into
more than the defined value.

Submitted by: Ahsan Barkati
Reviewed by: kp
Sponsored by: Google, Inc. (GSoC 2019)
Differential Revision: https://reviews.freebsd.org/D21307

(cherry picked from commit 3e1ebe7fb8244e6d9336216e9a982aa900a0a281)

2 years agonetpfil tests: Add the set ToS test for ipfw and pf
Kristof Provost [Tue, 20 Aug 2019 14:31:22 +0000 (14:31 +0000)]
netpfil tests: Add the set ToS test for ipfw and pf

This test tests the following:

 - The firewall is able to set the tos bits
 - The firewall is able to set the DSCP bits when EN bits is already set and
   the EN bits remains unchanged.
 - The firewall is able to drop the packets based on ToS value

Submitted by: Ahsan Barkati
Reviewed by: kp
Sponsored by: Google, Inc. (GSoC 2019)
Differential Revision: https://reviews.freebsd.org/D21305

(cherry picked from commit df3d236d96456f1c8400c7898045eae3ea93232d)

2 years agoAdd basic NAT test for pf, ipf and ipfw
Tom Jones [Sat, 17 Aug 2019 06:44:11 +0000 (06:44 +0000)]
Add basic NAT test for pf, ipf and ipfw

Add common firewall NAT tests for pf, ipf and ipfw (using both in-kernel and
userspace NAT).

Submitted by:   Ahsan Barkati
Sponsored by:   Google, Inc. (GSoC 2019)
Reviewed by:    kp
Approved by:    bz (mentor)
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D21199

(cherry picked from commit 0d9da68f01510ae4c5bb33b744f1e0b3711c7fb9)

2 years agoAdd common firewall test suite
Tom Jones [Mon, 5 Aug 2019 11:47:34 +0000 (11:47 +0000)]
Add common firewall test suite

Add a common test suite for the firewalls included in the base system. The test
suite allows common test infrastructure to test pf, ipfw and ipf firewalls from
test files containing the setup for all three firewalls.

Add the pass block test for pf, ipfw and ipf. The pass block test checks the
allow/deny functionality of the firewalls tested.

Submitted by:   Ahsan Barkati
Sponsored by:   Google, Inc. (GSoC 2019)
Reviewed by:    kp
Approved by:    bz (co-mentor)
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D21065

(cherry picked from commit f97a8a36153a9773d9f93018d66a7de2d050a59a)

2 years agodummynet: remove unused definitions
Kristof Provost [Wed, 16 Jun 2021 14:52:25 +0000 (16:52 +0200)]
dummynet: remove unused definitions

No functional change.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31806

(cherry picked from commit 415e81d5d9ed7a73825d371c0b538765fa57a801)

2 years agoipfw: Introduce dnctl
Kristof Provost [Tue, 25 May 2021 14:54:32 +0000 (16:54 +0200)]
ipfw: Introduce dnctl

Introduce a link to the ipfw command, dnctl, for dummynet configuration.
dnctl only handles dummynet configuration, and is part of the effort to
support dummynet in pf.

/sbin/ipfw continues to accept pipe, queue and sched commands, but these can
now also be issued via the new dnctl command.

Reviewed by: donner
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30465

(cherry picked from commit 0b95680e077b7ef5bc6930c7c0f1a41106251d5d)

2 years agopf: remove unused function prototype
Kristof Provost [Tue, 7 Sep 2021 12:33:59 +0000 (14:33 +0200)]
pf: remove unused function prototype

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit bb25e36e133bd723d5c5bdecf9f73452d597e100)

2 years agoixgbe: increase the timeout
Qiming Yang [Wed, 10 Jan 2018 16:04:33 +0000 (00:04 +0800)]
ixgbe: increase the timeout

Increase SECRX_RDY polling frequency and semaphore timeout which
fixes the FWSW.PT check in ixgbe_mng_present().

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Approved by: imp
Obtained from: DPDK (6175260d12cc22852cecf2fb7ecd95cdb07611b5)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 5fd1f4be8d81a0019c632103121d68e2f20bc238)

2 years agoixgbe: cleanup spelling mistakes in comments
Guinan Sun [Thu, 9 Jul 2020 08:00:33 +0000 (08:00 +0000)]
ixgbe: cleanup spelling mistakes in comments

Several functions in the driver code have a weird function comment
formatting which uses two spaces instead of only one space for the main
function body.

This formatting will be mechanically fixed by sed in a future patch, but
doing so leads to some spelling warnings on that patch. Cleanup the
spelling mistakes that will be detected first. This way, it is easier to
verify the mechanical transformation done by sed in the following patch.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (fc75eee32037c1379e77e57031c1c353badd2272)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 46981e903cf3e8e4a5bf7f6152f8ca5b92b37e07)

2 years agoixgbe: remove unnecessary return value check
Guinan Sun [Thu, 9 Jul 2020 08:00:38 +0000 (08:00 +0000)]
ixgbe: remove unnecessary return value check

Remove unnecessary return value check.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (4b0ee6529b7897c2a08dd56669f07ac1f46a8474)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 3a89005394bc5d82ce9b6baa9e7f8dee362354ae)

2 years agoixgbe: create function to restart autoneg
Guinan Sun [Thu, 9 Jul 2020 08:00:36 +0000 (08:00 +0000)]
ixgbe: create function to restart autoneg

This patch is for restarting auto negotiation on PHY.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (664ea2614eafbec8eda5c86764ff047475a1e5c6)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 80a39a2bda8208c716f614f792c8d9a3628d6c26)

2 years agoixgbe: add register definitions for NVM update
Guinan Sun [Thu, 9 Jul 2020 08:00:32 +0000 (08:00 +0000)]
ixgbe: add register definitions for NVM update

Added additional register for X550 and above device family.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (4a6847d78814b1c3df896efe31562643d419317d)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit ff8db817abbd348f0a7518ce32f0e52c6ab8e06e)

2 years agoixgbe: move increments after evaluations
Guinan Sun [Thu, 9 Jul 2020 08:00:35 +0000 (08:00 +0000)]
ixgbe: move increments after evaluations

The retry variable was being incremented before it was evaluated by the
subsequent conditional against the maximum retries to figure out which
message to print.  So we'll move the increment op to the end.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (390445ec30b4c52a3d2887c3d2a202d9cf37ea8e)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit dc11ba4eb3fe5cce615f361de83e85e07005ca24)

2 years agoixgbe: remove whitespace in function comments
Kevin Bowling [Tue, 7 Sep 2021 03:26:44 +0000 (20:26 -0700)]
ixgbe: remove whitespace in function comments

Remove unnecessary extra whitespace on all function comments, replacing
' *  ' with ' * '.

This was done automatically via sed using the following transformation:

  sed 's/^ \*  / * /'

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (40023f73c76579e58a859dab87b4c30278eb2e48)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 4cdc5e12a849871e4e8062a62a31f28545901d84)

2 years agoixgbe: support DCB registers dump
Xiaoyun Li [Mon, 17 Sep 2018 09:28:13 +0000 (17:28 +0800)]
ixgbe: support DCB registers dump

Add support for DCB registers dump.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: imp
Obtained from: DPDK (36a036bc6fdd0da74576a39ab74e50954598ba82)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 9e65ae746da23e1affdf66adb8944656a9da003c)

2 years agoixgbe: update X550 SFP identification
Xiaoyun Li [Mon, 17 Sep 2018 09:28:12 +0000 (17:28 +0800)]
ixgbe: update X550 SFP identification

Use ixgbe_identify_sfp_module_X550em to update SFP identification
flow. ixgbe_identify_sfp_module_X550em includes specific checks for
X550 about supported SFP modules.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: imp
Obtained from: DPDK (175bedb0cc8f801be3050fa35b8d8d0971cea7cc)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 0a4f0befab9d3a048232b00bea77bf3da20cfdd0)

2 years agoixgbe: Update copyright to 2020
Kevin Bowling [Tue, 7 Sep 2021 03:11:44 +0000 (20:11 -0700)]
ixgbe: Update copyright to 2020

Synced to the ixgbe shared code with DPDK shared code which has local
fixes on top of "not-released-cid-ixgbe.2020.06.09.tar.gz"

Approved by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 8455e365f77f5b66ac9521dbcd690f79345ce147)

2 years agoixgbe: remove dead code
Ferruh Yigit [Tue, 30 Jun 2020 14:45:54 +0000 (15:45 +0100)]
ixgbe: remove dead code

The question around getting rid of the assignments seems lived
long enough, if they are not needed until now, we can drop them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: imp
Obtained from: DPDK (a6395d471e14e5a7432875dad8fb3533238c5167)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 0b487fb4547ad1a939be0d523e555557c94b7cd1)

2 years agoixgbe: replace an operation in X550 setup
Xiaoyun Li [Mon, 17 Sep 2018 09:28:11 +0000 (17:28 +0800)]
ixgbe: replace an operation in X550 setup

Replace "=" operation with "|=" operation to only set the intended
register bits.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: imp
Obtained from: DPDK (1b665ccd9cd73499e934b807bec2fd77193912ef)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit c85b6f2901e7804105ca1d6d41cc5eb9a60474b8)

2 years agoixgbe: Use C99 bool types
Kevin Bowling [Tue, 7 Sep 2021 02:54:22 +0000 (19:54 -0700)]
ixgbe: Use C99 bool types

Approved by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 79b36ec91decc18d062fc428e2fd34d41aba0630)

2 years agoixgbe: add FW recovery mode check
Xiaoyun Li [Mon, 17 Sep 2018 09:28:10 +0000 (17:28 +0800)]
ixgbe: add FW recovery mode check

Add FM NVM recovery mode check. Allow the software to detect this.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: imp
Obtained from: DPDK (5fb0a9acbb844b21691568c0014866e0e887bd19)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit b622bdb4ebdfc6dfe1a332fcc912426559c829f3)

2 years agoixgbe: add typecast for type mismatch
Guinan Sun [Thu, 9 Jul 2020 08:00:37 +0000 (08:00 +0000)]
ixgbe: add typecast for type mismatch

Add typecast for type mismatch.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (d8e52b2cf771c31b523b46852fd86225b5a2c721)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 994dd6328c66fc277438ad51ed074f3c52096147)

2 years agoixgbe: wait for link after copper MAC setup
Ashijeet Acharya [Fri, 24 May 2019 09:30:15 +0000 (11:30 +0200)]
ixgbe: wait for link after copper MAC setup

After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the
link does not get set up properly and as a result all the subsequent
calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail.

Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before
beginning to set up the external PHY link speed to ensure that the
controller can acquire the link.

Signed-off-by: Ashijeet Acharya <ashijeet.acharya@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: imp
Obtained from: DPDK (d31b95860d8e9dd7c6e242bd08baaac00a9714f0)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit d5bbb5500cf2ebeae078cb6ae38ecd4b15ec7f6d)

2 years agoixgbe: check host interface return status
Guinan Sun [Thu, 9 Jul 2020 08:00:44 +0000 (08:00 +0000)]
ixgbe: check host interface return status

Writing to read-only fields returns a non-OK Return Status
for shadow RAM write command for X550.
This information was previously discarded.

Signed-off-by: Stanislaw Grzeszczak <stanislaw.a.grzeszczak@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (db18e37090a3b9af47d6a6886248520f6b220bf9)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit c1a56b6f5ffd6f3180a654d058c1783ccb808e8b)

2 years agoixgbe: initialize data field in struct buffer
Guinan Sun [Thu, 9 Jul 2020 08:00:40 +0000 (08:00 +0000)]
ixgbe: initialize data field in struct buffer

While sending request using ixgbe_hic_unlocked() the data field in
buffer struct is not used. It is set when the struct is overwritten by
FW to deliver the response. To not pass random data to FW the whole
structure should be zeroed before use.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (40543be5376ca415b2a7e196315d0555725b8bdf)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b)

2 years agoixgbe: fix x550em 10G NIC link status
Guinan Sun [Thu, 9 Jul 2020 08:00:30 +0000 (08:00 +0000)]
ixgbe: fix x550em 10G NIC link status

With the NVM image for x550em XFI will not report
the auto-negotiation feature correctly. The auto-negotiation
should be "No" for supports and advertised items.
At the same time update speed makes it support 1G and 10G.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (fb03b51da940f1d56d701776fd85a0dfc1ace098)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31621

(cherry picked from commit 8e9f1b239dc00a2375af87c48321f85a1e37c14e)