312762 |
25-Jan-2017 |
loos |
MFC r312604 and r312605:
Simplify the handling of small packets padding in cpsw: - Pad small packets to 60 bytes and not 64 (exclude the CRC bytes); - Pad the packet using m_append(9), if the packet has enough space for padding, which is usually true, it will not be necessary append a newly allocated mbuf to the chain.
Suggested by: yongari
MFC r312608:
Handle the rx queue stall while reading the packets from NIC (when the descriptor state will not change anymore). This seems to eliminate the race where we can miss a stalled queue under high load.
While here remove the unnecessary curly brackets.
Reported by: Konstantin Kormashev <konstantin@netgate.com>
MFC r312636:
Properly assemble an mbuf chain out of received fragments.
Remove the rx_batch hack, it makes no difference now that most of bugs have been sorted out.
MFC r312637:
Be a little more pedantic here, the TRM says the hardware is supposed to only clean the OWNER bit on SOP descriptors.
Sponsored by: Rubicon Communications, LLC (Netgate) |
310860 |
30-Dec-2016 |
loos |
MFC r306717:
if_cpsw overhaul: - Fix RX and TX teardown: . TX teardown would not reclaim the abandoned descriptors; . Interrupt storms in RX teardown; . Fixed the acknowledge of the teardown completion interrupt.
- Remove temporary lists for the descriptors;
- Simplified the descriptor handling (less writes and reads from descriptors where possible);
- Better debug;
- Add support for the RX threshold interrupts: With interrupt moderation only, an RX overrun is likely to happen. The RX threshold is set to trigger a non paced interrupt everytime your RX free buffers are under the minimum threshold, helping to prevent the rx overrun.
The NIC now survive when pushed over its limits (where previously it would lock up in a few seconds).
uFW (600MHz SoC) can now forward up to 560Mb/s of UDP traffic (netmap pkt-gen as source and sink). TCP forwarding rate is over 350Mb/s.
No difference (other than CPU use) was seen on Beaglebone black (1GHz SoC) for his fast ethernet.
Tested on: uFW, BBB Sponsored by: Rubicon Communications, LLC (Netgate) |
310858 |
30-Dec-2016 |
loos |
MFC of r306388, r306510, r306511 and r306513:
Fix a typo.
Sort and remove unnecessary includes.
Fix a typo in CPSW_DEBUG MACRO and then replace all the CPSWP_DEBUG() calls with CPSW_DEBUG().
Remove the GLOBAL queue lock which just adds unnecessary complexity to code (when used together with the individual tx and rx locks).
Sponsored by: Rubicon Communications, LLC (Netgate) |
310855 |
30-Dec-2016 |
loos |
MFC of r305112, r305113, r305119, r305141 and r305432:
Replace magic numbers with the proper register names.
Fix the build, revert r305119, move the control module register data to am335x_scm.h and fix if_cpsw.c to include the correct header.
Sponsored by: Rubicon Communications, LLC (Netgate) |
302394 |
07-Jul-2016 |
loos |
Fix a lockup in tx path for cspw.
Sometimes the software loses the race when appending more descriptors to the tx ring and the tx queue stops.
This commit detects this condition and restart the tx queue whenever it stall.
Tested by: sobomax@, Keith White <kwhite@site.uottawa.ca>, Paul Mather <paul@gromit.dlib.vt.edu> Sponsored by: Rubicon Communications (Netgate) Approved by: re (kib)
|
299477 |
11-May-2016 |
gonzo |
Add OF_prop_free function as a counterpart for OF_*prop_alloc
- Introduce new OF API function OF_prop_free to free memory allocated by OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9) with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc functions' internals and leads to unneccessary code coupling
- Convert some of the free(..., M_OFWPROP) instances to OF_prop_free
Files affected by this commit are the ones I was able to test on real hardware. The rest of free(..., M_OFWPROP) instances will be handled with idividual maintainers
Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D6315
|
296993 |
17-Mar-2016 |
loos |
Add support for dual emac mode.
In dual emac mode, the CPSW subsystem provides two independent ethernets.
This is implemented (as recommended by TI's TRM) with a mixture of switch settings (vlans) and specific features of CPSW subsystem.
The driver was splitted to accommodate the shared parts (RX and TX rings for example) while it still provides two independent ethernets.
Each of the ethernet ports driver has it's own set of MDIO registers among the other private settings.
Previously this driver always operate in promisc mode, now the Switch ALE (address table entry) is properly initialized and enabled.
The driver is also tested (and known to work) with both ports operating in single port mode (active_slave 0 or 1).
Tested on uBMC (dual emac mode, both ports in single mode, giga and fast ethernet) and BBB (single port, fast ethernet).
Sponsored by: Rubicon Communications (Netgate)
|
283276 |
22-May-2015 |
gonzo |
Switch TI platform support code from using FreeBSD's custom-baked DTS files to vendor-provided ones. It should make easier to adopt platform code to new revisions of hardware and to use DTS overlays for various Beaglebone extensions (shields/capes).
Original dts filenames were not changed, they're now wrappers over dts files provided by TI. So make sure you update .dtb files on your devices as part of kernel update
GPIO addressing was changed: instead of one global /dev/gpioc0 there are per-bank instances of /dev/gpiocX. Each bank has 32 pins so for instance pin 121 on /dev/gpioc0 in old addressing scheme is now pin 25 on /dev/gpioc3
On Pandaboard serial console devices was changed from /dev/ttyu0 to /dev/ttyu2 so you'll have to update /etc/ttys to get login prompt on serial port in multiuser mode. Single user mode serial console should work as-is
Differential Revision: https://reviews.freebsd.org/D2146 Reviewed by: rpaulo, ian, Michal Meloun, Svatopluk Kraus
|
273606 |
24-Oct-2014 |
loos |
Fix cpsw_detach() to not panic when called from cpsw_attach().
For an unkown reason (at moment), sometimes if_cpsw cannot read from PHY and fails to attach calling cpsw_detach() which end up in a panic.
Fix it by doing the proper check before detach the miibus and also fix the leak of few variables.
And to actually make it work, ether_ifattach() has to be moved to the end of cpsw_attach() to avoid a race where calling ether_ifdetach() before domain_init() (which will only run later on) would make it crash at INP_INFO_RLOCK() on in_pcbpurgeif0().
Tested on: BBB (am335x) MFC after: 1 week
|
261410 |
02-Feb-2014 |
ian |
Follow r261352 by updating all drivers which are children of simplebus to check the status property in their probe routines.
Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings.
Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper.
|
248407 |
17-Mar-2013 |
ian |
Add a macro that gets the physical address of a memory mapped device register from a bus space resource.
Note that this macro is just for ARM, and is intended to have a short lifespan. The DMA engines in some SoCs need the physical address of a memory-mapped device register as one of the arguments for the transfer. Several scattered ad-hoc solutions have been converted to use this macro, which now also serves to mark the places where a more complete fix needs to be applied (after that fix has been designed).
|
245064 |
05-Jan-2013 |
kientzle |
While trying to track down the root cause for TX stalls in this driver, I've also had some time to evaluate the effectiveness of different watchdog strategies.
This is the latest attempt, which consolidates all of the watchdog logic in one place and consistently detects TX stalls and resets within a couple of seconds.
|