summaryrefslogtreecommitdiff
path: root/sys/dev/dpaa
AgeCommit message (Collapse)Author
2 daysdpaa: Simplify CPU binding for bman and qmanJustin Hibbits
If cpu-handle property doesn't exist simply iterate and assign the CPUs in sequence rather than following the convoluted search which may not bear fruit in some cases. If cpu-handle doesn't exist for one portal it probably doesn't exist for any of them.
2025-12-09bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin
The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
2024-12-06Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
2024-06-28net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang
Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
2024-04-24dpaa: uma_zcreate() does not failMark Johnston
No functional change intended. MFC after: 1 week
2024-03-13new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin
The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
2024-03-13new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCEJohn Baldwin
The public bus_activate/deactivate_resource() API still accepts both forms, but the internal kobj methods no longer pass the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44130
2024-03-13sys: Set the type of allocated bus resourcesJohn Baldwin
Use rman_set_type to set the type of allocated resources everywhere rman_set_rid is currently called. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44123
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
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-09-02dtsec(4): Restore IFCAP_JUMBO_MTU lost in IfAPI conversionJustin Hibbits
Also add IFCAP_VLAN_MTU, since it's supported. Fixes: 0083fc5c7 ("Mechanically convert dtsec(4) to IfAPI") MFC after: 1 week
2023-08-26dtsec: Support multicast receive.Justin Hibbits
Implemented based on the tsec(4) multicast support. This is the minimum required to support VLANs. The hardware does support vlan tagging, among other acceleration features, which will be added at a later time. MFC after: 2 weeks
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-03-11dtsec: Complete mechanical conversion to IfAPIJustin Hibbits
Some changes were missed in 0083fc5c76. Sponsored by: Juniper Networks, Inc.
2023-02-09mi_switch(): clean up switch types and their usageMitchell Horne
Overall, this is a non-functional change, except for kernels built with SCHED_STATS. However, the switch types are useful for communicating the intent of the caller. 1. Ensure that every caller provides a type. In most cases, we upgrade the basic yield to sched_relinquish() aka SWT_RELINQUISH. 2. The case of sched_bind() is distinct, so add a new switch type SWT_BIND. 3. Remove the two unused types, SWT_PREEMPT and SWT_SLEEPQTIMO. 4. Remove SWT_NONE altogether and assert that callers always provide a type flag. 5. Reference the mi_switch(9) man page in the comments, as these flags will be documented there. Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38184
2023-01-24Mechanically convert dtsec(4) to IfAPIJustin Hibbits
Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37815
2022-11-28dpaa: Don't assume the MDIO is on the same fman as the MACJustin Hibbits
The P5040 has the MDIO for FMAN2 on FMAN1 for some reason. Instead of trying to manually find the MDIO, use a real xref.
2022-11-26dpaa: Don't probe disabled devicesJustin Hibbits
Probing disabled devices just adds noise.
2022-11-26dpaa: Use BUS_PASS_SUPPORTDEV for pqmdioJustin Hibbits
BUS_PASS_SUPPORTDEV is semantically better than BUS_PASS_RESOURCE, since it's a support device for dtsec, so only needs probed before dtsec, not before interrupts. Suggested by: manu
2022-11-26dpaa: Probe and attach pqmdio at BUS_PASS_RESOURCEJustin Hibbits
Avoid the fragile nature of depending on ordering of the devices in the FDT by forcing the MDIO driver to precede the DTSEC driver.
2022-11-26dpaa: Account for MDIO device not being foundJustin Hibbits
It's possible the MDIO device hasn't been and attached, or is incorrect in the device tree so can't probe and attach. In this case, ofw_bus_find_child_device_by_phandle() will fail, and return NULL. Return an error from find_mdio() here to prevent the MAC from attaching, rather than worry about a NULL pointer dereference later on when accessing the PHY.
2022-11-05dpaa: Go to cleanup exit point on fman attach errorJustin Hibbits
If fman_init() fails it can leave things in a state where it cannot attach at all in the future, because it would simply exit without tearing down everything that was already set up. Go to the exit point to clean up on error instead, so that it can try again later. MFC after: 1 week
2022-05-10dpaa: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin
2022-05-10dpaa bman: Remove unused bman_devclass.John Baldwin
2022-05-06Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin
2022-04-13dpaa: Remove unused variables.John Baldwin
2020-02-25[PowerPC] [Book-E] Remove obsolete interrupt binding workaroundBrandon Bergren
Remove an old workaround that is no longer necessary since rS343824. There used to be a problem with FMan interrupts firing on multiple CPUS at the same time. This ended up being due to multicast interrupts being unsupported in the Freescale PIC (so instead of using a selection algorithm, it would do some unspecified action, such as interrupting multiple cpus at random.) Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23829 Notes: svn path=/head/; revision=358322
2020-02-25[PowerPC] [Book-E] Fix dpaa interrupt binding.Brandon Bergren
After the network epoch was added, we lost the ability to migrate the ithread in the middle of dispatch, as being in the network epoch will pin the current thread (for safety reasons.) Luckily, we don't actually have to do this workaround in the first place, as we can just bind it to the correct cpu when we preallocate it. Pass dev through to XX_PreallocAndBindIntr() and actually bind it to the cpu like it was supposed to in the first place, instad of leaving it floating and moving it to the correct cpu the first time it fires. This fixes panics while bringing up dtsec on my X5000. Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23826 Notes: svn path=/head/; revision=358307
2020-02-24Although most of the NIC drivers are epoch ready, due to peer pressureGleb Smirnoff
switch over to opt-in instead of opt-out for epoch. Instead of IFF_NEEDSEPOCH, provide IFF_KNOWSEPOCH. If driver marks itself with IFF_KNOWSEPOCH, then ether_input() would not enter epoch when processing its packets. Now this will create recursive entrance in epoch in >90% network drivers, but will guarantee safeness of the transition. Mark several tested drivers as IFF_KNOWSEPOCH. Reviewed by: hselasky, jeff, bz, gallatin Differential Revision: https://reviews.freebsd.org/D23674 Notes: svn path=/head/; revision=358301
2020-01-23Introduce flag IFF_NEEDSEPOCH that marks Ethernet interfaces thatGleb Smirnoff
supposedly may call into ether_input() without network epoch. They all need to be reviewed before 13.0-RELEASE. Some may need be fixed. The flag is not planned to be used in the kernel for a long time. Notes: svn path=/head/; revision=357010
2019-12-15schedlock 4/4Jeff Roberson
Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption disabled to prevent local concurrency. This means that mi_switch() is entered with the thread locked but returns without. This dramatically simplifies scheduler locking because we will not hold the schedlock while spinning on blocked lock in switch. This change has not been made to 4BSD but in principle it would be more straightforward. Discussed with: markj Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22778 Notes: svn path=/head/; revision=355784
2019-08-21dpaa: Fix warnings in dtsec(4) found by clangJustin Hibbits
These are all trivial warnings that have no real functional change. Notes: svn path=/head/; revision=351322
2018-10-23dpaa: Mark BMan and QMan as earlier driver modulesJustin Hibbits
The BMan softc must exist when dtsec devices are created, else a NULL pointer is dereferenced. QMan likely as well. Until now, we have relied on order within the fdt parsing to attach correctly, but this obviously is not foolproof. Mark these as BUS_PASS_SUPPORTDEV so they're probed and attached explicitly before dtsec devices. Notes: svn path=/head/; revision=339632
2018-04-09Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_allocOleksandr Tymoshenko
Change OF_getencprop_alloc semantics to be combination of malloc and OF_getencprop and return size of the property, not number of elements allocated. For the use cases where number of elements is preferred introduce OF_getencprop_alloc_multi helper function that copies semantics of OF_getencprop_alloc prior to this change. This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi function signatures consistent with OF_getencprop_alloc and OF_getencprop_alloc_multi. Functionality-wise this patch is mostly rename of OF_getencprop_alloc to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo where 1 was used as a block size. Notes: svn path=/head/; revision=332341
2017-12-14Allow bman-portals and qman-portals to attach to simple-busJustin Hibbits
Official Linux dts's put the individual portals under a simple-bus, rather than under a '*-portals' grouping. This adds a hack to permit that, which gets us closer to using stock device trees for DPAA-based devices. Notes: svn path=/head/; revision=326840
2017-11-20Eliminate 1 XX_VirtToPhys() and 2 XX_PhysToVirt() calls from if_dtsec(4)Justin Hibbits
XX_VirtToPhys(), by way of pmap_kextract(), is an expensive operation. Profiling via dtrace during a series of iperf tests I found 16111 / 30432 stack frames were located in mmu_booke_kextract(), so eliminating this expensive call should improve performance slightly. XX_PhysToVirt() is not as expensive, but redundant calls in this context is wasteful. Notes: svn path=/head/; revision=326004
2017-11-17Add jumbo frame support to dtsec(4)Justin Hibbits
MFC after: 2 weeks Notes: svn path=/head/; revision=325927
2017-11-02Fix interrupt handling for dtsecJustin Hibbits
The macId is the dTSEC unit within the FMan, so use the cell-index, not the unit number, which may not match the cell index. MFC after: 1 week Notes: svn path=/head/; revision=325305
2017-11-01Remove a singleton in the DPAA driver, to allow multiple fman instancesJustin Hibbits
Some devices (P5040, P4080) have multiple frame managers in their DPAA subsystems. This was prevented by use of a softc singleton in the DPAA driver. Since if_dtsec(4) has moved to be a child of fman, it can access the fman device data via the parent object. Notes: svn path=/head/; revision=325255
2017-10-31Make DPAA work in 64-bit modeJustin Hibbits
Rework the dTSEC and FMan drivers to be more like a full bus relationship, so that dtsec can use bus_alloc_resource() instead of trying to handle the offset from the dts. This required taking some code from the sparc64 ebus driver to allow subdividing the fman region for the dTSEC devices. Notes: svn path=/head/; revision=325204
2017-10-30Update DPAA SDK to SDK 2.0Justin Hibbits
This adds some support for ARM as well as 64-bit. 64-bit on PowerPC is currently not working, and ARM support has not been completed or tested on the FreeBSD side. As this was imported from a Linux tree, it includes some Linux-isms (ioread/iowrite), so compile with the LinuxKPI for now. This may change in the future. Notes: svn path=/head/; revision=325118
2017-10-12Fix build after r324446.Gleb Smirnoff
Notes: svn path=/head/; revision=324569
2017-10-09Shorten list of arguments to mbuf external storage freeing function.Gleb Smirnoff
All of these arguments are stored in m_ext, so there is no reason to pass them in the argument list. Not all functions need the second argument, some don't even need the first one. The second argument lives in next cache line, so not dereferencing it is a performance gain. This was discovered in sendfile(2), which will be covered by next commits. The second goal of this commit is to bring even more flexibility to m_ext mbufs, allowing to create more fields in m_ext, opaque to the generic mbuf code, and potentially set and dereferenced by subsystems. Reviewed by: gallatin, kbowling Differential Revision: https://reviews.freebsd.org/D12615 Notes: svn path=/head/; revision=324446
2017-05-12Use UMA_ALIGN_PTR to specify pointer alignmentJustin Hibbits
Suggested by: jhb Notes: svn path=/head/; revision=318209
2017-05-11Fix uma_zcreate() align argument, now that the constraint is asserted.Justin Hibbits
The alignment argument is the mask of low bits to mask off when allocating items in a zone, not the block-size alignment. Notes: svn path=/head/; revision=318171
2016-11-16Simplify the page tracking for VA<->PA translations.Justin Hibbits
Drop the tracking down to the pmap layer, with optimizations to only track necessary pages. This should give a (slight) performance improvement, as well as a stability improvement, as the tracking is already mostly handled by the pmap layer. Notes: svn path=/head/; revision=308718
2016-11-12Make dpaa work with only slightly modified Linux device trees.Justin Hibbits
Linux has a slightly different device tree definition for DPAA than originally done in the FreeBSD driver. This changes the driver to be mostly compatible with the Linux device tree definitions. Currently the differences are: bman-portals: compatible = "fsl,bman-portals" (Linux is "simple-bus") qman-portals: compatible = "fsl,qman-portals" (Linux is "simple-bus") fman: compatible = "fsl,fman" (Linux is "simple-bus") The Linux device tree doesn't specify anything for rgmii in the mdio. This change still requires the device tree to specify the phy-handle, and doesn't yet support tbi. Notes: svn path=/head/; revision=308584
2016-11-11Use ofw_bus_node_is_compatible() instead of fdt_is_compatible()Justin Hibbits
No need to have two functions that do the same thing, let's let fdt_* go away, and use ofw_bus_* equivalents instead. Requested by: andrew Notes: svn path=/head/; revision=308536
2016-10-23Use the correct name for the qm_portals class.Justin Hibbits
This file was copy&pasted from bman_fdt, and it still shows. Notes: svn path=/head/; revision=307830
2016-10-22Initialize the ofw_bus_devinfo on the portals to prevent a crash.Justin Hibbits
If the device tree doesn't contain a cpu-handle field in any bman-portal or qman-portal, it will exit without setting up the devinfo, leaving it uninitialized. This will lead to attempts to free random memory, and ultimately panic. Notes: svn path=/head/; revision=307763