genet: Add a detach routinePR: 288309Co-authored by: Mike Belanger <mibelanger@qnx.com>MFC after: 2 weeks
if_genet: Plug memory leaksThe rx_buf_tag should be checked when destroying rx dma mappings.PR: 288309Reviewed by: zleiSubmitted by: Mike Belanger <mibelanger@qnx.com>MFC after: 3 days
if_genet: Consistently use the boolean formThe variable eaddr_found is declared as bool. This change improvesreadability a little.No functional change intended.MFC after: 3 days
Use device_delete_children instead of explicit calls to device_delete_childThis is simpler and more robust in the face of potential double-frees(e.g. if called after bus_generic_detach which will
Use device_delete_children instead of explicit calls to device_delete_childThis is simpler and more robust in the face of potential double-frees(e.g. if called after bus_generic_detach which will delete devices ina future commit).Reviewed by: manu, impDifferential Revision: https://reviews.freebsd.org/D47958
show more ...
Replace calls to bus_generic_attach with bus_attach_childrenReviewed by: impDifferential Revision: https://reviews.freebsd.org/D47675
newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYSponsored by: Netflix
if_genet: don't load DMA mapping when tx_queue is fullgen_encap() always calls bus_dmamap_load_mbuf_sg() into 'map' (which isthe current tx_queue). If the tx_queue is full, it will load with a'ma
if_genet: don't load DMA mapping when tx_queue is fullgen_encap() always calls bus_dmamap_load_mbuf_sg() into 'map' (which isthe current tx_queue). If the tx_queue is full, it will load with a'map' that already has a currently active mapping. This violates thebusdma(9) KPI.Checking for a full queue and returning ENOBUFS will allowgen_start_locked() to set the IFF_DRV_OACTIVE faster without having toneedlessly check if the mbuf will fit (it won't).PR: 256482Reviewed by: mhorneMFC after: 1 weekSubmitted by: ghuckriede@blackberry.com
sys: Automated cleanup of cdefs and other formattingApply the following automated changes to try to eliminateno-longer-needed sys/cdefs.h includes as well as now-emptyblank lines in a row.Remov
sys: Automated cleanup of cdefs and other formattingApply the following automated changes to try to eliminateno-longer-needed sys/cdefs.h includes as well as now-emptyblank 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
IfAPI: Retire if_etherbpfmtap() and if_bpfmtap()Summary:These came in the original DrvAPI commits in 2014, and are obsoleted bybpf_mtap_if() and ether_bpf_mtap_if(). The `_if` suffix, rather tha
IfAPI: Retire if_etherbpfmtap() and if_bpfmtap()Summary:These came in the original DrvAPI commits in 2014, and are obsoleted bybpf_mtap_if() and ether_bpf_mtap_if(). The `_if` suffix, rather thanprefix, conveys that it's operating on the bpf of the interface, insteadthan the interface itself.Reviewed by: glebiusSponsored by: Juniper Networks, Inc.Differential Revision: https://reviews.freebsd.org/D41146
sys: Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
sys: Remove $FreeBSD$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
Mechanically convert genet(4) to IfAPISponsored by: Juniper Networks, Inc.Differential Revision: https://reviews.freebsd.org/D37832
genet: add another case where headers need pullupWake On LAN packets sent by wake(8) via BPF are lost if txcsum isenabled. These fall into the "other protocol" case where gen_parse_txdid nothing
genet: add another case where headers need pullupWake On LAN packets sent by wake(8) via BPF are lost if txcsum isenabled. These fall into the "other protocol" case where gen_parse_txdid nothing. Add code to shift up to gen_tx_hdr_min bytes of thepacket along with the Ethernet header in this case.
genet: cnt here is write only and can be removedSponsored by: Netflix
arm/arm64 broadcom: Remove unused devclass arguments to DRIVER_MODULE.
genet: fix output packet corruption in uncommon caseThe code for the "shift" block in the COPY macro set the pointer forthe next copy block to the wrong value. In this case, the link-layerheader
genet: fix output packet corruption in uncommon caseThe code for the "shift" block in the COPY macro set the pointer forthe next copy block to the wrong value. In this case, the link-layerheader would be overwritten by the network-layer header. This case isdifficult or impossible to exercise in the current driver withoutchanging the value of the hw.genet.tx_hdr_min sysctl. Correct thepointer. While here, remove a line in the macro that was marked"unneeded", which was actually wrong.PR: 263824Submitted by: jiahali@blackberry.comMFC after: 2 weeks
Remove unused miibus_devclass and miibus_fdt_devclass.
genet: fix problems with interface down/upThe genet interface did not resume operation correctly after doingifconfig down then up. The down/reset procedure did not clear theRUNNING flag, and did
genet: fix problems with interface down/upThe genet interface did not resume operation correctly after doingifconfig down then up. The down/reset procedure did not clear theRUNNING flag, and did not reset enough of the hardware state. Thispatch is modeled on OpenBSD code, with a call to gen_reset addedto reset the controller completely. Regularize the parameter togen_dma_disable() while here.PR: 263091Submitted by: jiahali@blackberry.com
genet: pullup minimum header amount for IPv4The genet driver (RPi4 Ethernet) had code to pull headers into thefirst mbuf if there was only an Ethernet header there. This wasoriginally needed for
genet: pullup minimum header amount for IPv4The genet driver (RPi4 Ethernet) had code to pull headers into thefirst mbuf if there was only an Ethernet header there. This wasoriginally needed for ICMPv6 replies, then for forwarded IPv6/TCP.Now a situation has been found where it is needed for IPv4, whenusing NAT with IPFW. Generalize to do this for all protocols.Rather than using an IPv6-related definition for the length, movethe length to a variable that can be set with sysctl(hw.genet.tx_hdr_min). Move an old tunable to a new RDTUN variablewith a better name.PR: 25607MFC after: 3 daysReviewers: emasteDifferential Revision: https://reviews.freebsd.org/D30831
genet: Fix potential crash during attachAs pointed out in the bug, the genet driver (RPi4 Ethernet) wasattaching the interrupts before the data structures were fullyinitialized, causing a crash i
genet: Fix potential crash during attachAs pointed out in the bug, the genet driver (RPi4 Ethernet) wasattaching the interrupts before the data structures were fullyinitialized, causing a crash if an interrupt came in during theattach. Fix by reordering code blocks.PR: 256334Reported by: < ghuckriede at blackberry.com >Reviewed by: < ghuckriede at blackberry.com > (informally)MFC after: 3 days
genet: Use device_t in preference to struct device *MFC after: 1 weekSponsored by: The FreeBSD Foundation
genet: Fix problem with forwarding some TCP/IPv6 packetsTCP/IPv6 packets to be forwarded can be laid out with only the Ethernetheader in the first mbuf, and these packets are lost. There was apr
genet: Fix problem with forwarding some TCP/IPv6 packetsTCP/IPv6 packets to be forwarded can be laid out with only the Ethernetheader in the first mbuf, and these packets are lost. There was aprevious hack to pullup ICMPv6 packets with such a layout for thesame reason. Generalize, and pullup any IPv6 packets with only theEthernet header in the first mbuf. Possibly this should also includeIPv4, but that situation has not been observed to fail.PR: 254060Reported by: denis at h3q.comMFC after: 3 days
arm64: genet: Add bcm2711-genet-v5 compatibleLater dtb from the RPI Foundation removed the brcm,genet-v5 compatiblefor some unknown reason, add brcm,bcm2711-genet-v5 to the list of compatibledevi
arm64: genet: Add bcm2711-genet-v5 compatibleLater dtb from the RPI Foundation removed the brcm,genet-v5 compatiblefor some unknown reason, add brcm,bcm2711-genet-v5 to the list of compatibledevice for if_genet
arm64: clean up empty lines in .c and .h files
Add support for bcm54213PE in brgphy.This chip is used in the Rasperry Pi 4, and is supported by the if_genetdriver. Currently we use the ukphy mii driver, this patch switches overto the brgphy m
Add support for bcm54213PE in brgphy.This chip is used in the Rasperry Pi 4, and is supported by the if_genetdriver. Currently we use the ukphy mii driver, this patch switches overto the brgphy mii driver instead. To support the rgmii-rxid phy mode,which is now the default in the Linux dtb, we add support for clockskewing.These changes are taken from OpenBSD and NetBSD, except for the bailoutin brgphy_bcm54xx_clock_delay() in rgmii mode, which was found necessaryafter testing.Submitted by: Robert Crowston, crowston at protomail.comDifferential Revision: https://reviews.freebsd.org/D25251
12