- Jul 21, 2020
-
-
Peter Ujfalusi authored
commit 6fea8735 upstream. The in_ring_cnt is not used for anything, it can be removed. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200512134611.6015-1-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit 5bbeea34 upstream. The TR mode rx flush descriptor did not had a dma_sync_single_for_device() call to make sure that the DMA see the correct information. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200512134544.5839-1-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit 26cf132d upstream. Create a placeholder directory for each registered DMA device. DMA drivers can use the dmaengine_get_debugfs_root() call to get their debugfs root and can populate with custom files to aim debugging. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200306142839.17910-4-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit db8d9b4c upstream. With the custom dbg_summary_show the driver can show useful information about the used channels. dma0 (285c0000.dma-controller): number of channels: 24 dma1 (31150000.dma-controller): number of channels: 84 dma1chan0 | 2b00000.mcasp:tx (MEM_TO_DEV, tchan16 [0x1010 -> 0xc400], PDMA[ ACC32 BURST ], TR mode) dma1chan1 | 2b00000.mcasp:rx (DEV_TO_MEM, rchan16 [0x4400 -> 0x9010], PDMA[ ACC32 BURST ], TR mode) dma1chan2 | 2ba0000.mcasp:tx (MEM_TO_DEV, tchan17 [0x1011 -> 0xc507], PDMA[ ACC32 BURST ], TR mode) dma1chan3 | 2ba0000.mcasp:rx (DEV_TO_MEM, rchan17 [0x4507 -> 0x9011], PDMA[ ACC32 BURST ], TR mode) dma1chan4 | in-use (MEM_TO_MEM, chan0 pair [0x1000 -> 0x9000], PSI-L Native, TR mode) dma1chan5 | in-use (MEM_TO_MEM, chan1 pair [0x1001 -> 0x9001], PSI-L Native, TR mode) dma1chan6 | in-use (MEM_TO_MEM, chan4 pair [0x1004 -> 0x9004], PSI-L Native, TR mode) dma1chan7 | in-use (MEM_TO_MEM, chan5 pair [0x1005 -> 0x9005], PSI-L Native, TR mode) Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200306142839.17910-3-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit e937cc1d upstream. Via the /sys/kernel/debug/dmaengine/summary users can get information about the DMA devices and the used channels. Example output on am654-evm with audio using two channels and after running dmatest on 4 channels: dma0 (285c0000.dma-controller): number of channels: 96 dma1 (31150000.dma-controller): number of channels: 267 dma1chan0 | 2b00000.mcasp:tx dma1chan1 | 2b00000.mcasp:rx dma1chan2 | in-use dma1chan3 | in-use dma1chan4 | in-use dma1chan5 | in-use For slave channels we can show the device and the channel name a given channel is requested. For non slave devices the only information we know is that the channel is in use. DMA drivers can implement the optional dbg_summary_show callback to provide controller specific information instead of the generic one. It is easy to extend the generic dmaengine_summary_show() to print additional information about the used channels. I have taken the idea from gpiolib and clk subsystems. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200306142839.17910-2-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit bad83565 upstream. No need to use goto to jump over the return chan ? chan : ERR_PTR(-EPROBE_DEFER); We can just revert the check and return right there. Do not fail the channel request if the chan->name allocation fails, but print a warning about it. Change the dev_err to dev_warn if sysfs_create_link() fails as it is not fatal. Only attempt to remove the DMA_SLAVE_NAME symlink if it is created - or it was attempted to be created. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20200131093859.3311-2-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Marek Szyprowski authored
commit 474809a2 upstream. Commit 71723a96 ("dmaengine: Create symlinks between DMA channels and slaves") changed the dma_request_chan() function flow in such a way that it always returns EPROBE_DEFER in case of channels that cannot be found. This break the operation of the devices which have optional DMA channels as it puts their drivers in endless deferred probe loop. Fix this by propagating the proper error value. Fixes: 71723a96 ("dmaengine: Create symlinks between DMA channels and slaves") Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20200130070834.17537-1-m.szyprowski@samsung.com [vkoul: fix typo in patch title] Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Geert Uytterhoeven authored
commit 71723a96 upstream. Currently it is not easy to find out which DMA channels are in use, and which slave devices are using which channels. Fix this by creating two symlinks between the DMA channel and the actual slave device when a channel is requested: 1. A "slave" symlink from DMA channel to slave device, 2. A "dma:<name>" symlink slave device to DMA channel. When the channel is released, the symlinks are removed again. The latter requires keeping track of the slave device and the channel name in the dma_chan structure. Note that this is limited to channel request functions for requesting an exclusive slave channel that take a device pointer (dma_request_chan() and dma_request_slave_channel*()). Signed-off-by:
Geert Uytterhoeven <geert+renesas@glider.be> Tested-by:
Niklas Söderlund <niklas.soderlund@ragnatech.se> Link: https://lore.kernel.org/r/20200117153056.31363-1-geert+renesas@glider.be Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Christophe JAILLET authored
commit 018af9be upstream. All but one error handling paths in the 'k3_udma_glue_cfg_rx_flow()' function 'goto err' and call 'k3_udma_glue_release_rx_flow()'. This not correct because this function has a 'channel->flows_ready--;' at the end, but 'flows_ready' has not been incremented here, when we branch to the error handling path. In order to keep a correct value in 'flows_ready', un-roll 'k3_udma_glue_release_rx_flow()', simplify it, add some labels and branch at the correct places when an error is detected. Doing so, we also NULLify 'flow->udma_rflow' in a path that was lacking it. Fixes: d7024191 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine user") Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200318191209.1267-1-christophe.jaillet@wanadoo.fr Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
- Jul 14, 2020
-
-
LCPD Auto Merger authored
TI-Feature: connectivity TI-Branch: connectivity-ti-linux-5.4.y * 'connectivity-ti-linux-5.4.y' of ssh://bitbucket.itg.ti.com/lcpdpublicdom/connectivity : (37 commits) net: ti: prueth_core: hsr/prp: VLAN filter to receive tagged SV frames net: ti: prueth_core: hsr/prp: add Multicast filtering net: ti: prueth_core: hsr/prp: add VLAN filtering net: ti: prueth_core: hsr/prp: update for ethtool stats support net: ti: prueth_core: add helper functions to support lre offload ARM: dts: am335x-icev2: add interrupts for HSR/PRP queue interrupts ARM: dts: am437x: add interrupts for HSR/PRP queue interrupts ARM: dts: am57x: add interrupts for hsr/prp queue interrupts net: ti: prueth_core: hsr/prp: add NSP support net: ti: prueth_core: hsr/prp: add ethtool command to switch Ethenet type net: ti: prueth_core: add HSR/PRP driver dt-bindings: net: ti-prueth: Add interrupt properties for HSR/PRP net: ti: prueth_core: add HSR/PRP firmware specific init functions net: ti: prueth_core: hsr/prp: set mux_sel and Min/Max frame sizes net: ti: prueth_core: move timer utility functions to prueth_core net: ti: prueth_core: move prueth_hostinit() to inside ndo_open() ARM: dts: am437x-idk : remove firmware-name from DTS ARM: dts: am335x-icev2 : remove firmware-name from DTS ARM: dts: k2g-ice : remove firmware-name from DTS ARM: dts: am57xx-idk : remove firmware-name from DTS ... Signed-off-by:
LCPD Auto Merger <lcpd_integration@list.ti.com>
-
- Jul 10, 2020
-
-
Murali Karicheri authored
HSR/PRP networks may use VLAN for management messages such as that for sending and receiving tagged supervision frames. So implement lredev_set_sv_vlan_id() ops of the LRE offloaded device to add VLAN filter entry for receiving these tagged frames. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Similar to Dual EMAC firmware, HSR/PRP (LRE) firmware also supports a hashed Multicast filter table of 256 entries. This patch extends the MC filtering support to HSR/PRP Ethernet types. This is a shared table for LRE. So protect access using a spinlock. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This patch add VLAN filtering support for LRE offload. VLAN table has 512 entries with 8 VIDs supported per entry. It is a shared table. So use a spinlock to protect access. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This patch adds Link Redundancy Entity (LRE) stats through ethtool command. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Firmware requires node table entries to be inserted by driver to save PRU cycles for packet processing. Node table provides a view of remote nodes in the network. The nodes send supervision frames periodically with its own mac address and the same is processed by firmware. First firmware lookup the source MAC address. If not found, it indicates a flag in the descriptor which driver uses to insert the MAC address in the node table. The rx packet processing code kicks a worker thread to insert the mac address. This patch adds the required function to do the insert function and also clear the table on demand. Firmware also requires driver to run a timer for 10 msec to update check flags in dram for firmware to do periodic table maintenance functions for LRE offload. So change basic timer period to 10 msec and use a counter to track the NSP timer which needs to be done every 100 msec. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This adds interrupts property for HSR/PRP priority queue interrupts for the supported platforms. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This adds interrupts property for HSR/PRP priority queue interrupts for the supported platforms. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This adds interrupts property for hsr/prp priority queue interrupts for the supported platforms. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
For HSR/PRP the timer has to be run at 10 msec due to requirement to support offload function in firmware. So run the basic timer at 10 msec when Ethernet type is HSR/PRP and use a counter to count 100 msec for NSP timer. Keep the basic timer at 100 msec when in Dual EMAC mode to reduce CPU cycle usage. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
PRUETH driver now supports Dual EMAC/HSR/PRP/SWITCH Ethernet types. The user requires to switch between these Ethernet types at run time without rebooting the device. This patch introduces Ethtool -K option to switch the Ethernet types between Dual EMAC/HSR/PRP Ethernet types. User first bring down the interface and then set the HSR or PRP offload flag in the Ethernet device using ethtool -K option. Then bring up the Ethernet interfaces and setup the HSR/PRP interface using ip link command. For example to Switch from Dual EMAC to HSR, user do ifconfig eth2 down ifconfig eth3 down ifconfig eth2 hw ether <MAC Addr> ifconfig eth3 hw ether <MAC Addr> ethtool -K eth2 hsr-rx-offload on ethtool -K eth3 hsr-rx-offload on Now ready to create hsr interface as ip link add name hsr0 type hsr slave1 eth2 slave2 eth3 supervision 45 version 1 Similarly to switch from Dual EMAC to prp user do similar steps ifconfig eth2 down ifconfig eth3 down ifconfig eth2 hw ether <MAC Addr> ifconfig eth3 hw ether <MAC Addr> ethtool -K eth2 prp-rx-offload on ethtool -K eth3 prp-rx-offload on ip link add name prp0 type hsr slave1 eth2 slave2 eth3 supervision 45 proto 1 To switch back to Dual EMAC, user clear the respective flags through ethtool command and bring up the interface. Switching between HSR and PRP is done in a similar way. First needs to reset the existing flag and then set the new flag before creating the hsr/prp interface. User is not allowed to switch between Switch and HSR/PRP. To switch, user first needs to change to Dual EMAC eth type and then do the switching of ethtype. Driver continues to support the existing method for switching between Dual EMAC and Switch eth types. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
HSR/PRP is a industrial Ethernet protocol defined by IEC 62439 standard. Both use 6 bytes of protocol bytes to implement redundancy. This consists of 2 bytes of sequence number, 1 byte of Ethernet type identifying the protocol and LSDU length and pathid/network id bits. Link Redundancy Entity (LRE) implements 1) duplication of Ethernet frames at Egress and 2) discard of duplicates at the ingress and 3) processing of Supervision frames to build the Node Table information. Node table contains the health status of remote nodes in the network. HSR/PRP driver offload part of LRE function. In the current version of the firmware 2 & 3 are offloaded to PRU firmware. 1) is still performed by upper HSR/PRP driver under net/hsr. This patch initialize the firmware based on the Ethernet type. HSR/PRP firmware uses same memory map as Switch firmware. So all places in the driver that initializes the basic Switch firmware is re-used for HSR/PRP as well using the !PRUETH_IS_EMAC() macro. Any HSR/PRP specific function is initialized under PRUETH_IS_LRE() macro. This update support both v1.0 and v2.1 of the ICSS firmware by using fw offsets that are assigned at probe based on platform. A list of firmware names are also picked at probe and then based on ethtype appropriate firmware is picked to load on the PRUs. For Packet handling, NAPI is used at at Ingress. There are two pair of Queues at the Ingress for each port. Low priority and High priority. A NAPI instance is added for each of the priority queue. An interrupt is raised by firmware when packets are en-queued to one of the priority queue. red_emac_rx_packets() ensures that packets are scanned from both queues at a specific priority and sends them to network stack based on timestamp associated with the packet. At the egress, packets are en-queued based on pcp bits. There are 2 queues per port and other queues are for port to port traffic. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
- Jul 08, 2020
-
-
Murali Karicheri authored
This document the bindings update to support HSR/PRP offload in PRUETH driver. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This patch adds HSR/PRP Ethernet specific firmware init/config functions, firmware header files, data types etc. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
As an preparatory patch to support other Ethernet types in the driver, driver needs to configure min/max frame sizes in MII_RT registers as well as MUX_SEL as part of prueth_mii_init(). It is expected that this function gets called in ndo_open() and Ethernet type may be different than EMAC or SWITCH. So update prueth_mii_init() to configure the values for High Seamless Redundancy (HSR) and Parallel Redundancy Protocol (PRP) Ethernet types. HSR and PRP are two industrial protocols that operates at Layer 2 to implement redundancy. They extend the frame size by 6 octets of protocol bytes at Layer 2. Thus update the max frame size for these Ethernet types in MII_RT_RX_FRMS. As standard management frames are expected to be received as well, min frame size remains unaffected. Introduce a new macro PRUETH_IS_LRE() to check for HSR or PRP and use that to configure the Max frame value differently. Link Redundancy Entity (LRE) is the common function in HSR and PRP that implements redundancy for HSR and PRP. Also MUX_SEL reg values are same for HSR, PRP and SWITCH. So adjust the code accordingly. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
As a preparatory patch to introduce additional Ethernet types in the driver that also requires timer related functions, it is cleaner to have timer related main code in prueth_core driver and on event make calls to appropriate firmware specific functions as needed. So this add a function prueth_enable_nsp(), to configure storm prevention and define the same in prueth_qos.c. On timeout, call prueth_enable_nsp() to configure storm prevention feature. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
As preparatory patch to introduce support for additional Ethernet types, move prueth_hostinit() to inside ndo_open() as prueth_hostinit() is common across all Ethernet types and make sense to do it as part of ndo_open() since driver needs to support run time changing of Ethernet type. Currently Ethernet type is set inside prueth_change_to_switch_mode() or prueth_change_to_emac_mode() and prueth_hostinit() is invoked there. So move this to inside ndo_open(). Now that driver always do rproc_set_firmware() in ndo_open() based on Ethernet type, remove the restore of firmware names to EMAC firmware in prueth_sw_shutdown_prus(). For switch based firmwarem there are common resources to be initialized when the first port is initialized which are done part of prueth_hostinit(). So introduce a mutex to enter the critical region inside ndo_open() for initialization and in ndo_stop() when last port is down. Also set emac_configured at the end after the port is enabled and use proper input to prueth_port_enable() call. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Now that driver lists the firmware names, remove this from the dts. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Now that driver lists the firmware names, remove this from the dts. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Now that driver lists the firmware names, remove this from the dts. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Now that driver lists the firmware names, remove this from the dts. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Use functions to initialize the fdb table and to free the memory and move the code to prueth_switch.c. While at it place the fdb init function ahead of booting the PRUs as this memory is used by PRU. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Now that firmware filenames are listed in the driver as a static table, remove this from DTS. So update the documentation accordingly. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Remove firmware filename usage in dts and use compatibility private data to specify firmware files names in the driver as driver is expected to support run time change of Ethernet type in which case file name has to be determined dynamically when network device is opened as Ethernet type can be other than Dual EMAC. As file names are dependent on the platform and Ethernet type, introduce an array to hold these names and use in the driver. While at it move the macros to check Ethernet type to common header file prueth.h as it this is common across all Ethernet types Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Many functions such as prueth_hostconfig(), prueth_hostinit() doesn't return any error code and can be void. Fix the return type to void in such cases. Also check for return type of prueth_sw_emac_config() since the function has a return value. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
if driver is in single emac mode, then nsp code will crash because there is no check for emac ptr. So fix it by adding a check for null ptr. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
tx irq is optional in the driver. So remove the same from dts to get a better egress performance for small size frames. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
tx irq is optional in the driver. So remove the same from dts to get a better egress performance for small size frames. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
tx irq is optional in the driver. So remove the same from dts to get a better egress performance for small size frames. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
tx irq is optional in the driver. So remove the same from dts to get a better egress performance for small size frames. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Egress throughput with small size packet is better with tx irq removed along with reduction in CPU usage. With DUT-DUT test, a reduction in CPU usage of 7% is seen with iperf3 UDP test using payload size of 76 bytes. 41% before change vs 34% after the change on a RT kernel. CPU usage measured using mpstat -P ALL 3 50 command. iperf command used Server iperf3 -s -i5 Client iperf3 -c <server IP> -u -b18M -l76 -i5 -t60& DUT to PC test gives a higher throughput of 26-27 Mbits/sec at this payload size of 76 bytes. client side command is iperf3 -c <server IP> -u -b30M -l76 -i5 -t60& All tested on AM57x with ksoftirqd/0 & ksoftirqd/1 priority raised as chrt -f -p 40 9 chrt -f -p 40 20 With DUT to PC test, an improvement in effective throughput of 1.5Mbits/sec along with a reduction in CPU usage of ~1%. The offered traffic is at 30Mbits/sec. However with MTU size frames, a degradation in performance of about 7% seen based on testing with Tx IRQ removed. For industrial networks, it is important to have higher performance at small size packets since majority of the traffic is small sized. So make Tx IRQ use in the driver optional for Dual EMAC firmware so that users can add Tx IRQ entry in the DTS as needed if a specific application uses predominantly MTU or near MTU sized frames and thus get the benefit of higher throughput at that size. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-