Commit graph

21 commits

Author SHA1 Message Date
Warner Losh fdafd315ad sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:00 -07:00
Warner Losh 685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh 95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
John Baldwin 463edaf441 al: Replace boolean_t with either al_bool or bool.
Use al_bool for interfaces and structures defined in the
OS-independent HAL in sys/contrib, and use plain bool for
FreeBSD-specific APIs and structures in sys/dev/al_eth.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D39923
2023-05-04 12:32:40 -07:00
Justin Hibbits f46a05b5d3 al_eth: Finish conversion to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38955
2023-04-25 14:25:31 -04:00
Dimitry Andric 9ea31d78f0 al_eth: make function definitions consistent with declarations
The declarations for al_eth_lm_retimer_ds25_signal_detect() and
al_eth_lm_retimer_ds25_cdr_lock() say that these functions return
'al_bool', but the definitions actually return 'boolean_t'.

Make the definitions match the declarations.

Reviewed by:	jhb, emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D39759
2023-04-25 20:02:04 +02:00
Justin Hibbits bc14c73b7b Mechanically convert al_eth(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37834
2023-02-06 12:32:13 -05:00
Gordon Bergling 45b143d2ea al_eth: Fix a typo in a source code comment
- s/enought/enough/

MFC after:	3 days
2022-06-04 15:33:36 +02:00
John Baldwin 6a9d865c2b al: Remove unused devclass argument to DRIVER_MODULE. 2022-05-09 14:26:44 -07:00
John Baldwin 3e38757d4c Remove unused miibus_devclass and miibus_fdt_devclass. 2022-05-06 15:39:28 -07:00
Gordon Bergling 6a734168cb al_eth: Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:06:18 +02:00
Mark Johnston d8b1601d54 al_eth: Use device_t in preference to struct device *
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-04-12 09:32:02 -04:00
Mateusz Guzik 0e9080cb12 al_eth: clean up empty lines in .c and .h files 2020-09-01 21:37:35 +00:00
Warner Losh 27dc15d2f6 Remove FreeBSD 7 conditional code... We've had a lot of other changes since then
and al_eth appears only in the Annapurna ARM designs which arrived in the tree
after that.
2020-03-01 16:45:54 +00:00
Gleb Smirnoff 6c3e93cb5a Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D23518
2020-02-11 18:57:07 +00:00
Gleb Smirnoff 57d361630d Convert to if_foreach_llmaddr() KPI.
This driver seems to have a bug.  The bug was carefully saved during
conversion.  In the al_eth_mac_table_unicast_add() the argument 'addr',
which is the actual address is unused.  So, the function is called as
many times as we have addresses, but with the exactly same argument
list.  This doesn't make any sense, but was preserved.
2019-10-21 18:05:43 +00:00
Marcin Wojtas 0b5cab4e0f Use ip/ipv6 structures in al_eth only if they are supported
The ip/ipv6 header files are included only if the appropriate definition
exists, but the driver was missing similar checks when using the
ip and ip6_hdr structures.

If the kernel was not built with the INET or INET6 option, the driver
was preventing kernel from being built.

To fix that, the missing ifdef checks were added to the driver.

PR: Bug 230886
Submitted by: Michal Krawczyk <mk@semihalf.com>
Reported by: O. Hartmann
Approved by: re (gjb)
Obtained from: Semihalf
MFC after: 1 week
Sponsored by: Amazon, Inc.
2018-08-28 17:09:41 +00:00
Matt Macy d7c5a620e2 ifnet: Replace if_addr_lock rwlock with epoch + mutex
Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
4.98   0.00   4.42   0.00 4235592     33   83.80 4720653 2149771   1235 247.32
4.73   0.00   4.20   0.00 4025260     33   82.99 4724900 2139833   1204 247.32
4.72   0.00   4.20   0.00 4035252     33   82.14 4719162 2132023   1264 247.32
4.71   0.00   4.21   0.00 4073206     33   83.68 4744973 2123317   1347 247.32
4.72   0.00   4.21   0.00 4061118     33   80.82 4713615 2188091   1490 247.32
4.72   0.00   4.21   0.00 4051675     33   85.29 4727399 2109011   1205 247.32
4.73   0.00   4.21   0.00 4039056     33   84.65 4724735 2102603   1053 247.32

After the patch

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
5.43   0.00   4.20   0.00 3313143     33   84.96 5434214 1900162   2656 245.51
5.43   0.00   4.20   0.00 3308527     33   85.24 5439695 1809382   2521 245.51
5.42   0.00   4.19   0.00 3316778     33   87.54 5416028 1805835   2256 245.51
5.42   0.00   4.19   0.00 3317673     33   90.44 5426044 1763056   2332 245.51
5.42   0.00   4.19   0.00 3314839     33   88.11 5435732 1792218   2499 245.52
5.44   0.00   4.19   0.00 3293228     33   91.84 5426301 1668597   2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

Reviewed by:	gallatin
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15366
2018-05-18 20:13:34 +00:00
Alexander Kabaev 151ba7933a Do pass removing some write-only variables from the kernel.
This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385
2017-12-25 04:48:39 +00:00
Pedro F. Giffuni 4d24901ac9 sys/dev: Replace zero with NULL for pointers.
Makes things easier to read, plus architectures may set NULL to something
different than zero.

Found with:	devel/coccinelle
MFC after:	3 weeks
2017-02-20 03:43:12 +00:00
Wojciech Macek 7902c8dca8 Driver for PCI Ethernet NIC on Alpine V1 and V2.
Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7814
2016-10-20 11:31:11 +00:00