[PATCH] net: ethernet: ti: davinci_cpdma: free memory while channel destroy

2016-11-08 Thread Ivan Khoronzhuk
While create/destroy channel operation memory is not freed. It was supposed that memory is freed while driver remove. But a channel can be created and destroyed many times while changing number of channels with ethtool. Based on net-next/master Signed-off-by: Ivan Khoronzhuk --- drivers/net

Re: [PATCH] net: ethernet: ti: davinci_cpdma: fix fixed prio cpdma ctlr configuration

2016-11-09 Thread Ivan Khoronzhuk
On 09.11.16 23:09, Grygorii Strashko wrote: On 11/08/2016 07:10 AM, Ivan Khoronzhuk wrote: The dma ctlr is reseted to 0 while cpdma start, thus cpdma ctlr I assume this is because cpdma_ctlr_start() does soft reset. Is it correct? Probably not. I've seen this register doesn'

[PATCH v2] net: ethernet: ti: davinci_cpdma: free memory while channel destroy

2016-11-11 Thread Ivan Khoronzhuk
While create/destroy channel operation memory is not freed. It was supposed that memory is freed while driver remove. But a channel can be created and destroyed many times while changing number of channels with ethtool. Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk --- Based

[PATCH v2] net: ethernet: ti: davinci_cpdma: fix fixed prio cpdma ctlr configuration

2016-11-11 Thread Ivan Khoronzhuk
ethtool. In order to not restore content in many places, move it to cpdma_ctlr_start(). Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master Since v1: - don't use redundant parameters for cpdma, make prio fixed to be constant drivers/net/ethernet/ti/cpsw.c | 4 -- driver

[PATCH] net: ethernet: ti: davinci_cpdma: don't stop ctlr if it was stopped

2016-11-11 Thread Ivan Khoronzhuk
No need to stop ctlr if it was already stopped. It can cause timeout warns. Steps: - ifconfig eth0 down - ethtool -l eth0 rx 8 tx 8 - ethtool -l eth0 rx 1 tx 1 Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/davinci_cpdma.c | 2 +- 1 file changed, 1

Re: [PATCH] net: ethernet: ti: davinci_cpdma: fix access to uninitialized variable in cpdma_chan_set_descs()

2016-12-28 Thread Ivan Khoronzhuk
On Wed, Dec 28, 2016 at 05:42:13PM -0600, Grygorii Strashko wrote: Grygorii, > Now below code sequence causes "Unable to handle kernel NULL pointer > dereference.." exception and system crash during CPSW CPDMA initialization: > > cpsw_probe > |-cpdma_chan_create (TX channel) > |-cpdma_chan_spli

Re: [PATCH 2/7] net: ethernet: ti: cpdma: fix desc re-queuing

2016-12-02 Thread Ivan Khoronzhuk
On Thu, Dec 01, 2016 at 05:34:27PM -0600, Grygorii Strashko wrote: > The currently processing cpdma descriptor with EOQ flag set may > contain two values in Next Descriptor Pointer field: > - valid pointer: means CPDMA missed addition of new desc in queue; It shouldn't happen in normal circumstance

Re: [PATCH 5/7] Documentation: DT: net: cpsw: allow to specify descriptors pool size

2016-12-02 Thread Ivan Khoronzhuk
On Thu, Dec 01, 2016 at 05:34:30PM -0600, Grygorii Strashko wrote: > Add optional property "descs_pool_size" to specify buffer descriptor's > pool size. The "descs_pool_size" should define total number of CPDMA > CPPI descriptors to be used for both ingress/egress packets > processing. If not speci

Re: [PATCH 2/7] net: ethernet: ti: cpdma: fix desc re-queuing

2016-12-02 Thread Ivan Khoronzhuk
On Fri, Dec 02, 2016 at 10:45:07AM -0600, Grygorii Strashko wrote: > > > On 12/02/2016 05:03 AM, Ivan Khoronzhuk wrote: > > On Thu, Dec 01, 2016 at 05:34:27PM -0600, Grygorii Strashko wrote: > >> The currently processing cpdma descriptor with EOQ flag set may > &g

Re: [PATCH 5/7] Documentation: DT: net: cpsw: allow to specify descriptors pool size

2016-12-02 Thread Ivan Khoronzhuk
On Fri, Dec 02, 2016 at 11:22:28AM -0600, Grygorii Strashko wrote: > > > On 12/02/2016 05:28 AM, Ivan Khoronzhuk wrote: > > On Thu, Dec 01, 2016 at 05:34:30PM -0600, Grygorii Strashko wrote: > >> Add optional property "descs_pool_size" to specify buffe

[PATCH] net: ethernet: ti: cpdma: use desc_read in chan_process instead of raw read

2016-12-02 Thread Ivan Khoronzhuk
There is desc_read() macros to read desc fields, so no need to use __raw_readl(); Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/davinci_cpdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b

Re: [PATCH net 2/3] cpsw/netcp: davinci_cpdma: sanitize inter-module API

2016-12-16 Thread Ivan Khoronzhuk
On Fri, Dec 16, 2016 at 10:19:58AM +0100, Arnd Bergmann wrote: > The davinci_cpdma module is a helper library that is used by the > actual device drivers and does nothing by itself, so all its API > functions need to be exported. > > Four new functions were added recently without an export, so now

[PATCH 5/5] net: ethernet: ti: cpsw: split tx budget according between channels

2016-11-29 Thread Ivan Khoronzhuk
Split device budget between channels according to channel rate. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 159 + 1 file changed, 130 insertions(+), 29 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net

[PATCH 4/5] net: ethernet: ti: cpsw: optimize end of poll cycle

2016-11-29 Thread Ivan Khoronzhuk
Check budget fullness only after it's updated and update channel mask only once to keep budget balance between channels. It's also needed for farther changes. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 24 ++-- 1 file changed, 6 inserti

[PATCH 2/5] net: ethernet: ti: davinci_cpdma: add set rate for a channel

2016-11-29 Thread Ivan Khoronzhuk
channel priority is set in low-hi direction already, so that when a new channel is added with ethtool and it doesn't have rate yet, it cannot affect on rate limited channels. It can be useful for TSN streams and just in cases when h/w rate limited channels are needed. Signed-off-by: Ivan Khoro

[PATCH 0/5] cpsw: add per channel shaper configuration

2016-11-29 Thread Ivan Khoronzhuk
This series is intended to allow user to set rate for per channel shapers at cpdma level. This patchset doesn't have impact on performance. The rate can be set with: echo 100 > /sys/class/net/ethX/queues/tx-0/tx_maxrate Tested on am572xx Based on net-next/master Ivan Khoronzhuk (5

[PATCH 3/5] net: ethernet: ti: cpsw: add .ndo to set per-queue rate

2016-11-29 Thread Ivan Khoronzhuk
ocol ip prio 1 u32 match ip\ dport 5004 0x action skbedit queue_mapping 3 iperf -c 192.168.2.1 -b 110M -p 5001 -f m -t 60 iperf -c 192.168.2.1 -b 215M -p 5002 -f m -t 60 iperf -c 192.168.2.1 -b 55M -p 5003 -f m -t 60 iperf -c 192.168.2.1 -b 32M -p 5004 -f m -t 60 Signed-off-by: Iva

[PATCH 1/5] net: ethernet: ti: davinci_cpdma: add weight function for channels

2016-11-29 Thread Ivan Khoronzhuk
The weight of a channel is needed to split descriptors between channels. The weight can depend on maximum rate of channels, maximum rate of an interface or other reasons. The channel weight is in percentage and is independent for rx and tx channels. Signed-off-by: Ivan Khoronzhuk --- drivers

Re: [PATCH] net: ethernet: ti: cpsw: fix ASSERT_RTNL() warning during resume

2016-11-29 Thread Ivan Khoronzhuk
- cpsw_ndo_open() > |- netif_set_real_num_tx/rx_queues() > |- ASSERT_RTNL(); > > Hence, fix it by surrounding cpsw_ndo_open() by rtnl_lock/unlock() calls. > > Cc: Dave Gerlach > Cc: Ivan Khoronzhuk > Fixes: commit e05107e6b747 ("net: ethernet: ti: cpsw: add multi

[PATCH 1/5] net: ethernet: ti: cpsw: use same macros to get active slave

2016-12-10 Thread Ivan Khoronzhuk
Use the same, more convenient macros, to get active slave. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index b62d958..c45f7d2 100644

[PATCH 5/5] net: ethernet: ti: cpsw: sync rates for channels in dual emac mode

2016-12-10 Thread Ivan Khoronzhuk
The channels are common for both ndevs in dual emac mode. Hence, keep in sync their rates. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti

[PATCH 4/5] net: ethernet: ti: cpsw: re-split res only when speed is changed

2016-12-10 Thread Ivan Khoronzhuk
s sum of "linked" phys, thus res are split taken in account two interfaces, both for dual emac mode and for switch mode. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 64 ++ 1 file changed, 59 insertions(+), 5 deletions(-

[PATCH 3/5] net: ethernet: ti: cpsw: combine budget and weight split and check

2016-12-10 Thread Ivan Khoronzhuk
Re-split weight along with budget. It simplify code a little and update state after every rate change. Also it's necessarily to move arguments checks to this combined function. Replace maximum rate check for an interface on maximum possible rate. Signed-off-by: Ivan Khoronzhuk --- driver

[PATCH 1/5] net: ethernet: ti: cpsw: improve re-split policy

2016-12-10 Thread Ivan Khoronzhuk
net-next/master Ivan Khoronzhuk (5): net: ethernet: ti: cpsw: use same macros to get active slave net: ethernet: ti: cpsw: don't start queue twice net: ethernet: ti: cpsw: combine budget and weight split and check net: ethernet: ti: cpsw: re-split res only when speed is changed net

[PATCH 2/5] net: ethernet: ti: cpsw: don't start queue twice

2016-12-10 Thread Ivan Khoronzhuk
No need to start queues after cpsw is started as it will be done while cpsw_adjust_link(), after phy connection. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c

Re: [PATCH 04/15] drivers: net: cpsw: ethtool: fix accessing to suspended device

2016-06-16 Thread Ivan Khoronzhuk
, I'm going to add two additional ehttool ops containing RPM sensitive part and not, better to split code on those, if possible...and hiding put/get in begin op can call rpm when it's not needed at all.. -- Regards, Ivan Khoronzhuk

Re: [PATCH 04/15] drivers: net: cpsw: ethtool: fix accessing to suspended device

2016-06-16 Thread Ivan Khoronzhuk
On 16.06.16 15:48, Ivan Khoronzhuk wrote: On 15.06.16 19:45, Grygorii Strashko wrote: On 06/15/2016 07:14 PM, Florian Fainelli wrote: On 06/15/2016 04:55 AM, Grygorii Strashko wrote: The CPSW might be suspended by RPM if all ethX interfaces are down, but it still could be accesible

[PATCH v3 0/2] net: ethernet: ti: cpsw: delete rx_descs property

2016-06-17 Thread Ivan Khoronzhuk
master Since v2: - add declaration of buf_num in correct order Since v1: - separate device tree and driver patches - return number of rx buffers from cpdma driver Ivan Khoronzhuk (2): net: ethernet: ti: cpsw: remove rx_descs property Documentation: DT: cpsw: remove rx_descs property

[PATCH v3 1/2] net: ethernet: ti: cpsw: remove rx_descs property

2016-06-17 Thread Ivan Khoronzhuk
as anyway, the "redundant" descriptors were unused. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 13 +++-- drivers/net/ethernet/ti/cpsw.h | 1 - drivers/net/ethernet/ti/davinci_cpdma.c | 6 ++ drivers/net/ethernet/ti/davinci_cpdma.h |

[PATCH v3 2/2] Documentation: DT: cpsw: remove rx_descs property

2016-06-17 Thread Ivan Khoronzhuk
There is no reason to hold s/w dependent parameter in device tree. Even more, there is no reason in this parameter because davinici_cpdma driver splits pool of descriptors equally between tx and rx channels anyway. Acked-by: Rob Herring Signed-off-by: Ivan Khoronzhuk --- Documentation

[PATCH] net: ethernet: ti: cpsw: correct ale dev to cpsw

2017-02-15 Thread Ivan Khoronzhuk
The ale is a property of cpsw, so change dev to cpsw->dev, aka pdev->dev, to be consistent. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/d

Re: [PATCH] net: ethernet: ti: netcp_core: return netdev_tx_t in xmit

2017-02-10 Thread Ivan Khoronzhuk
On Fri, Feb 10, 2017 at 02:45:21PM -0500, David Miller wrote: > From: Ivan Khoronzhuk > Date: Thu, 9 Feb 2017 16:24:14 +0200 > > > @@ -1300,7 +1301,7 @@ static int netcp_ndo_start_xmit(struct sk_buff *skb, > > struct net_device *ndev) > > dev_war

Re: [PATCH 0/2] net: ethernet: ti: cpsw: fix susp/resume

2017-02-10 Thread Ivan Khoronzhuk
On Fri, Feb 10, 2017 at 12:05:07PM -0600, Grygorii Strashko wrote: > > > On 02/09/2017 07:45 PM, David Miller wrote: > >From: Ivan Khoronzhuk > >Date: Fri, 10 Feb 2017 00:54:24 +0200 > > > >>On Thu, Feb 09, 2017 at 05:21:26PM -0500, David Miller wrote: > &

[PATCH] net: ethernet: ti: cpsw: return NET_XMIT_DROP if skb_padto failed

2017-02-10 Thread Ivan Khoronzhuk
If skb_padto failed the skb has been dropped already, so it was consumed, but it doesn't mean it was sent, thus no need to update queue tx time, etc. So, return NET_XMIT_DROP as more appropriate. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.

[PATCH v2] net: ethernet: ti: cpsw: fix cpsw assignment in resume

2017-02-14 Thread Ivan Khoronzhuk
-by: Alexey Starikovskiy Signed-off-by: Ivan Khoronzhuk --- Based on net/master v1: https://patchwork.ozlabs.org/patch/725876/ Since v1: - rebased on net/master drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b

[PATCH] net: ethernet: ti: cpsw: use var instead of func for usage count

2017-02-14 Thread Ivan Khoronzhuk
device count. So, replace usage count function on var and inc and dec it in ndo_open/close. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.c | 42 -- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a

[PATCH] net: ethernet: ti: cpsw: remove netif_trans_update

2017-02-06 Thread Ivan Khoronzhuk
No need to update jiffies in txq->trans_start twice, it's supposed to be done in netdev_start_xmit() and anyway is re-written. Also, no reason to update trans time in case of an error. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.c | 2 --

[PATCH 1/2] net: ethernet: ti: cpsw: fix cpsw assignment in resume

2017-02-08 Thread Ivan Khoronzhuk
-by: Alexey Starikovskiy Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 4d1c0c3..9714fab 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b

[PATCH 0/2] net: ethernet: ti: cpsw: fix susp/resume

2017-02-08 Thread Ivan Khoronzhuk
These two patches fix suspend/resume chain. Ivan Khoronzhuk (2): net: ethernet: ti: cpsw: fix cpsw assignment in resume net: ethernet: ti: cpsw: fix resume because of usage count drivers/net/ethernet/ti/cpsw.c | 44 +- 1 file changed, 13 insertions

[PATCH 2/2] net: ethernet: ti: cpsw: fix resume because of usage count

2017-02-08 Thread Ivan Khoronzhuk
only device count. So, replace usage count function on var and inc and dec it in ndo_open/close. Fixes: 03fd01ad0eead23eb79294b6fb4d71dcac493855 "net: ethernet: ti: cpsw: don't duplicate ndev_running" Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet

[PATCH] net: ethernet: ti: netcp_core: remove netif_trans_update

2017-02-09 Thread Ivan Khoronzhuk
No need to update jiffies in txq->trans_start twice and only for tx 0, it's supposed to be done in netdev_start_xmit() and per tx queue. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/netcp_core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a

[PATCH] net: ethernet: ti: netcp_core: return netdev_tx_t in xmit

2017-02-09 Thread Ivan Khoronzhuk
The _xmit function should return netdev_tx_t type. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/netcp_core.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti

Re: [PATCH 0/2] net: ethernet: ti: cpsw: fix susp/resume

2017-02-09 Thread Ivan Khoronzhuk
On Thu, Feb 09, 2017 at 05:21:26PM -0500, David Miller wrote: > From: Ivan Khoronzhuk > Date: Thu, 9 Feb 2017 02:07:34 +0200 > > > These two patches fix suspend/resume chain. > > Patch 2 doesn't apply cleanly to the 'net' tree, please > respin this series

Re: [PATCH 3/4] net: ethernet: ti: cpsw: don't duplicate ndev_running

2017-01-10 Thread Ivan Khoronzhuk
On Mon, Jan 09, 2017 at 11:25:38AM -0600, Grygorii Strashko wrote: > > > On 01/08/2017 10:41 AM, Ivan Khoronzhuk wrote: > > No need to create additional vars to identify if interface is running. > > So simplify code by removing redundant var and checking usag

Re: [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime

2016-08-09 Thread Ivan Khoronzhuk
On 09.08.16 14:34, Grygorii Strashko wrote: On 08/06/2016 01:48 PM, Ivan Khoronzhuk wrote: No need to check const slave num in runtime for every packet, and ndev for slaves w/o ndev is anyway NULL. So remove redundant check. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c

Re: [PATCH v2 02/14] net: ethernet: ti: cpsw: remove redundant check in napi poll

2016-08-09 Thread Ivan Khoronzhuk
On 09.08.16 14:29, Grygorii Strashko wrote: On 08/06/2016 01:48 PM, Ivan Khoronzhuk wrote: No need to check number of handled packets, when in most cases (> 99%) it's not 0. It can be 0 only in rare cases, even in this case it's not bad to print just 0. Signed-off-by: Iv

[PATCH v3 07/13] net: ethernet: ti: cpsw: replace pdev on dev

2016-08-09 Thread Ivan Khoronzhuk
No need to hold pdev link when only dev is needed. This allows to simplify a bunch of cpsw->pdev->dev now and farther. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 65 ++ 1 file changed, 34 insertions(+), 31 deletions(-) diff

[PATCH v3 05/13] net: ethernet: ti: cpsw: don't check slave num in runtime

2016-08-09 Thread Ivan Khoronzhuk
No need to check const slave num in runtime for every packet, and ndev for slaves w/o ndev is anyway NULL. So remove redundant check and macro. Reviewed-by: Mugunthan V N Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 11 --- 1 file changed, 4 insertions(+), 7

[PATCH v3 10/13] net; ethernet: ti: cpsw: move irq stuff under cpsw_common

2016-08-09 Thread Ivan Khoronzhuk
ff-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 65 +++--- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 6d99d1e..b2482b6 100644 --- a/drivers/net/ethernet/ti/c

[PATCH v3 09/13] net: ethernet: ti: cpsw: move cpdma resources to cpsw_common

2016-08-09 Thread Ivan Khoronzhuk
Every net device private struct holds links to shared cpdma resources. No need to save and every time synchronize these resources per net dev. So, move it to common driver struct. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 97

[PATCH v3 11/13] net: ethernet: ti: cpsw: move platform data and slaves info to cpsw_common

2016-08-09 Thread Ivan Khoronzhuk
These data are common for net devs in dual_emac mode. No need to hold it for every priv instance, so move them under cpsw_common. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 265 + 1 file changed, 137 insertions(+), 128 deletions

[PATCH v3 13/13] net: ethernet: ti: cpsw: move ale, cpts and drivers params under cpsw_common

2016-08-09 Thread Ivan Khoronzhuk
The ale, cpts, version, rx_packet_max, bus_freq, interrupt pacing parameters are common per net device that uses the same h/w. So, move them to common driver structure. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 235 +++-- 1 file

[PATCH v3 12/13] net: ethernet: ti: cpsw: move napi struct to cpsw_common

2016-08-09 Thread Ivan Khoronzhuk
The napi structs are common for both net devices in dual_emac mode, In order to not hold duplicate links to them, move to cpsw_common. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 52 ++ 1 file changed, 22 insertions(+), 30

[PATCH v3 04/13] net: ethernet: ti: cpsw: remove clk var from priv

2016-08-09 Thread Ivan Khoronzhuk
There is no need to hold link to clk, it's used only once while probe. Reviewed-by: Mugunthan V N Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/driver

[PATCH v3 02/13] net: ethernet: ti: cpsw: remove intr dbg msg from poll handlers

2016-08-09 Thread Ivan Khoronzhuk
, so drop it from poll handler. Reviewed-by: Mugunthan V N Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 8972bf6..21cf367 100644 --- a/drivers/net

[PATCH v3 08/13] net: ethernet: ti: cpsw: move links on h/w registers to cpsw_common

2016-08-09 Thread Ivan Khoronzhuk
The pointers on h/w registers are common for every cpsw_private instance, so no need to hold them for every ndev. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 97 +++--- 1 file changed, 53 insertions(+), 44 deletions(-) diff --git a

[PATCH v3 00/13] net: ethernet: ti: cpsw: split driver data and per ndev data

2016-08-09 Thread Ivan Khoronzhuk
er cpsw_common net: ethernet: ti: cpsw: move data platform data and slaves info to cpsw_common net: ethernet: ti: cpsw: fix int dbg message net: ethernet: ti: cpsw: move napi struct to cpsw_common net: ethernet: ti: cpsw: move ale, cpts and drivers params under Based on net-next/master I

[PATCH v3 03/13] net: ethernet: ti: cpsw: remove priv from cpsw_get_slave_port() parameters list

2016-08-09 Thread Ivan Khoronzhuk
There is no need in priv here. Reviewed-by: Mugunthan V N Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti

[PATCH v3 06/13] net: ethernet: ti: cpsw: create common struct to hold shared driver data

2016-08-09 Thread Ivan Khoronzhuk
This patch simply create holder for common data and as a start moves pdev var to it. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 62 ++ 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c

[PATCH v3 01/13] net: ethernet: ti: cpsw: simplify submit routine

2016-08-09 Thread Ivan Khoronzhuk
As second net dev is created only in case of dual_emac mode, port number can be figured out in simpler way. Also no need to pass redundant ndev struct. Reviewed-by: Mugunthan V N Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 18

[PATCH v2 0/2] net: ethernet: ti: cpsw: delete rx_descs property

2016-06-07 Thread Ivan Khoronzhuk
patches - return number of rx buffers from cpdma driver Ivan Khoronzhuk (2): net: ethernet: ti: cpsw: remove rx_descs property Documentation: DT: cpsw: remove rx_descs property Documentation/devicetree/bindings/net/cpsw.txt | 1 - arch/arm/boot/dts/am33xx.dtsi | 1 - arch/arm

[PATCH v2 1/2] net: ethernet: ti: cpsw: remove rx_descs property

2016-06-07 Thread Ivan Khoronzhuk
as anyway, the "redundant" descriptors were unused. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 13 +++-- drivers/net/ethernet/ti/cpsw.h | 1 - drivers/net/ethernet/ti/davinci_cpdma.c | 6 ++ drivers/net/ethernet/ti/davinci_cpdma.h |

[PATCH v2 2/2] Documentation: DT: cpsw: remove rx_descs property

2016-06-07 Thread Ivan Khoronzhuk
There is no reason to hold s/w dependent parameter in device tree. Even more, there is no reason in this parameter because davinici_cpdma driver splits pool of descriptors equally between tx and rx channels anyway. Signed-off-by: Ivan Khoronzhuk --- Documentation/devicetree/bindings/net

[PATCH] net: ethernet: ti: cpsw: use destroy ctlr to destroy channels

2016-06-10 Thread Ivan Khoronzhuk
There is no reason to destroy channels that are destroyed while cpdma_ctlr destroy. In this case no need to remember how much channels where created and destroy them by one, as cpdma_ctlr destroys all of them. Signed-off-by: Ivan Khoronzhuk --- Based on master drivers/net/ethernet/ti/cpsw.c

Re: [PATCH] net: ethernet: ti: cpsw: use destroy ctlr to destroy channels

2016-06-11 Thread Ivan Khoronzhuk
On 11.06.16 04:17, David Miller wrote: From: Ivan Khoronzhuk Date: Sat, 11 Jun 2016 01:11:54 +0300 Based on master master... of what? master of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git but it's applicable on linux-next master also. -- Regards, Ivan Khoronzhuk

Re: [PATCH v2 1/2] net: ethernet: ti: cpsw: remove rx_descs property

2016-06-11 Thread Ivan Khoronzhuk
On 11.06.16 08:50, David Miller wrote: From: Ivan Khoronzhuk Date: Tue, 7 Jun 2016 16:59:35 +0300 if (!cpsw_common_res_usage_state(priv)) { + int buf_num; struct cpsw_priv *priv_sl0 = cpsw_get_slave_priv(priv, 0); Please always order local variable

Re: [PATCH] net: ethernet: ti: cpsw: use destroy ctlr to destroy channels

2016-06-11 Thread Ivan Khoronzhuk
On 11.06.16 12:24, Ivan Khoronzhuk wrote: On 11.06.16 04:17, David Miller wrote: From: Ivan Khoronzhuk Date: Sat, 11 Jun 2016 01:11:54 +0300 Based on master master... of what? master of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git but it's applicable on

Re: [PATCH] net: ethernet: ti: cpsw: remove rx_descs property

2016-06-03 Thread Ivan Khoronzhuk
On 03.06.16 19:50, Grygorii Strashko wrote: On 06/03/2016 01:43 AM, Ivan Khoronzhuk wrote: There is no reason to hold s/w dependent parameter in device tree. Even more, there is no reason in this parameter because davinici_cpdma driver splits pool of descriptors equally between tx and rx

Re: [PATCH] net: ethernet: ti: cpsw: remove rx_descs property

2016-06-03 Thread Ivan Khoronzhuk
On 03.06.16 22:13, Grygorii Strashko wrote: On 06/03/2016 09:25 PM, Ivan Khoronzhuk wrote: On 03.06.16 19:50, Grygorii Strashko wrote: On 06/03/2016 01:43 AM, Ivan Khoronzhuk wrote: There is no reason to hold s/w dependent parameter in device tree. Even more, there is no reason in this

[PATCH 1/4] net: ethernet: ti: davinci_cpdma: split descs num between all channels

2016-06-30 Thread Ivan Khoronzhuk
. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 59 + drivers/net/ethernet/ti/davinci_cpdma.c | 54 -- drivers/net/ethernet/ti/davinci_cpdma.h | 2 +- 3 files changed, 89 insertions(+), 26 deletions(-) diff

[PATCH 0/4] net: ethernet: ti: cpsw: add multi-queue support

2016-06-30 Thread Ivan Khoronzhuk
2 \ action skbedit queue_mapping 5 #get statistic for active channels: ethtool -S eth0 Ivan Khoronzhuk (4): net: ethernet: ti: davinci_cpdma: split descs num between all channels net: ethernet: ti: cpsw: add multi queue support net: ethernet: ti: davinci_cpdma: move cpdma channel struct mac

[PATCH 4/4] net: ethernet: ti: cpsw: add ethtool channels support

2016-06-30 Thread Ivan Khoronzhuk
These ops allow to control number of channels driver is allowed to work with. The maximum number of channels is 8 for rx and 8 for tx. After this patch the following commands are possible: $ ethtool -l eth0 $ ethtool -L eth0 rx 6 tx 6 Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti

[PATCH 3/4] net: ethernet: ti: davinci_cpdma: move cpdma channel struct macroses to internals

2016-06-30 Thread Ivan Khoronzhuk
Better to move functions that works with channel internals to C file. Currently it's not required for drivers to know rx or tx a channel is, except create function. So correct "channel create" function, and use all channel struct macroses only for internal use. Signed-off-by:

[PATCH 2/4] net: ethernet: ti: cpsw: add multi queue support

2016-06-30 Thread Ivan Khoronzhuk
, beginning from hi priority channel. The statistic for every channel can be read with: ethtool -S ethX Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 334 +--- drivers/net/ethernet/ti/davinci_cpdma.c | 12 ++ drivers/net/ethernet/ti

Re: [REGRESSION] firmware: dmi_scan: add SBMIOS entry and DMI tables

2016-03-28 Thread Ivan Khoronzhuk
be changed in a way that `cbmem` still works. If I should report this issue somewhere else, please tell me too, and I’ll do my best to follow up there. Thanks, Paul [1] https://www.coreboot.org [2] https://ticket.coreboot.org/issues/33 [3] https://www.coreboot.org/pipermail/coreboot/2015-October/080568.html -- Regards, Ivan Khoronzhuk

[PATCH] net: ethernet: cavium: octeon_mgmt: use phy_start and phy_stop

2020-09-25 Thread Ivan Khoronzhuk
atch, so add it as a fix. Fixes: 74a992b3598a ("net: phy: add phy_check_link_status") Signed-off-by: Ivan Khoronzhuk --- Based on net/master drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ca

[PATCH v3 net-next 3/7] net: ethernet: ti: cpsw: use cpsw as drv data

2019-06-05 Thread Ivan Khoronzhuk
No need to set ndev for drvdata when mainly cpsw reference is needed, so correct this legacy decision. Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers

[PATCH v3 net-next 0/7] net: ethernet: ti: cpsw: Add XDP support

2019-06-05 Thread Ivan Khoronzhuk
net: page_pool: add helper function to unmap dma addresses Ivan Khoronzhuk (5): net: ethernet: ti: cpsw: use cpsw as drv data net: ethernet: ti: cpsw_ethtool: simplify slave loops net: ethernet: ti: davinci_cpdma: add dma mapped submit net: ethernet: ti: davinci_cpdma: return handler

[PATCH v3 net-next 1/7] net: page_pool: add helper function to retrieve dma addresses

2019-06-05 Thread Ivan Khoronzhuk
From: Ilias Apalodimas On a previous patch dma addr was stored in 'struct page'. Use that to retrieve DMA addresses used by network drivers Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Ivan Khoronzhuk --- include/net/page_pool.h | 5 +++

[PATCH v3 net-next 6/7] net: ethernet: ti: davinci_cpdma: return handler status

2019-06-05 Thread Ivan Khoronzhuk
This change is needed to return flush status of rx handler for flushing redirected xdp frames after processing channel packets. Do it as separate patch for simplicity. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 23 +++-- drivers/net/ethernet/ti

[PATCH v3 net-next 7/7] net: ethernet: ti: cpsw: add XDP support

2019-06-05 Thread Ivan Khoronzhuk
all channels till appropriate changes are added in XDP infrastructure. Also, once page_pool recycling becomes part of skb netstack some simplifications can be added marked with comments. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/Kconfig| 1 + drivers/net/ethernet/ti

[PATCH v3 net-next 5/7] net: ethernet: ti: davinci_cpdma: add dma mapped submit

2019-06-05 Thread Ivan Khoronzhuk
In case if dma mapped packet needs to be sent, like with XDP page pool, the "mapped" submit can be used. This patch adds dma mapped submit based on regular one. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/davinci_cpdma.c | 88 - drivers/net/e

[PATCH v3 net-next 4/7] net: ethernet: ti: cpsw_ethtool: simplify slave loops

2019-06-05 Thread Ivan Khoronzhuk
Only for consistency reasons, do it like in main cpsw.c module and use ndev reference but not by means of slave. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw_ethtool.c | 40 ++ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/net

[PATCH v3 net-next 2/7] net: page_pool: add helper function to unmap dma addresses

2019-06-05 Thread Ivan Khoronzhuk
From: Ilias Apalodimas On a previous patch dma addr was stored in 'struct page'. Use that to unmap DMA addresses used by network drivers Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Ivan Khoronzhuk --- include/net/page_pool.h | 1 +

[PATCH net-next] net: ethernet: ti: cpsw: correct .ndo_open error path

2019-05-28 Thread Ivan Khoronzhuk
It's found while review and probably never happens, but real number of queues is set per device, and error path should be per device. Also correct label name for shared error path. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 5 +++-- 1 file changed, 3 insertions(

[PATCH v2 net-next] net: ethernet: ti: cpsw: correct .ndo_open error path

2019-05-28 Thread Ivan Khoronzhuk
It's found while review and probably never happens, but real number of queues is set per device, and error path should be per device. So split error path based on usage_count. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 7 +-- 1 file changed, 5 insertions(

Re: [PATCH net-next] net: ethernet: ti: cpsw: correct .ndo_open error path

2019-05-28 Thread Ivan Khoronzhuk
Please ignore this version, I've sent version 2 that do the same but is more adjustable for later on changes and based on usage counter. -- Regards, Ivan Khoronzhuk

Re: [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support

2019-05-29 Thread Ivan Khoronzhuk
On Wed, May 29, 2019 at 10:16:59AM +0200, Jesper Dangaard Brouer wrote: On Thu, 23 May 2019 21:20:35 +0300 Ivan Khoronzhuk wrote: +static struct page *cpsw_alloc_page(struct cpsw_common *cpsw) +{ + struct page_pool *pool = cpsw->rx_page_pool; + struct page *page, *prev_page = N

[PATCH] net: ethernet: ti: cpsw_ethtool: fix ethtool ring param set

2019-05-29 Thread Ivan Khoronzhuk
74fea58d28a51 ("ethtool: Ensure new ring parameters are within bounds during SRINGPARAM") Signed-off-by: Ivan Khoronzhuk --- Based on net/master drivers/net/ethernet/ti/cpsw_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpsw_ethtool

[PATCH net-next] net: ethernet: ti: davinci_cpdma: use idled submit

2019-06-15 Thread Ivan Khoronzhuk
n other places after stopping tx queues. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.c | 15 ++--- drivers/net/ethernet/ti/cpsw_ethtool.c | 12 +--- drivers/net/ethernet/ti/davinci_cpdma.c | 85 +++-- drivers/n

[PATCH v2 net-next 0/7] net: ethernet: ti: cpsw: Add XDP support

2019-05-30 Thread Ivan Khoronzhuk
addresses Ivan Khoronzhuk (5): net: ethernet: ti: cpsw: use cpsw as drv data net: ethernet: ti: cpsw_ethtool: simplify slave loops net: ethernet: ti: davinci_cpdma: add dma mapped submit net: ethernet: ti: davinci_cpdma: return handler status net: ethernet: ti: cpsw: add XDP support

[PATCH v2 net-next 7/7] net: ethernet: ti: cpsw: add XDP support

2019-05-30 Thread Ivan Khoronzhuk
infrastructure. Also, once page_pool recycling becomes part of skb netstack some simplifications can be added marked with comments. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/Kconfig| 1 + drivers/net/ethernet/ti/cpsw.c | 506 ++--- drivers

[PATCH v2 net-next 6/7] net: ethernet: ti: davinci_cpdma: return handler status

2019-05-30 Thread Ivan Khoronzhuk
This change is needed to return flush status of rx handler for flushing redirected xdp frames after processing channel packets. Do it as separate patch for simplicity. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 23 +++-- drivers/net/ethernet/ti

[PATCH v2 net-next 4/7] net: ethernet: ti: cpsw_ethtool: simplify slave loops

2019-05-30 Thread Ivan Khoronzhuk
Only for consistency reasons, do it like in main cpsw.c module and use ndev reference but not by means of slave. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw_ethtool.c | 40 ++ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/net

[PATCH v2 net-next 3/7] net: ethernet: ti: cpsw: use cpsw as drv data

2019-05-30 Thread Ivan Khoronzhuk
No need to set ndev for drvdata when mainly cpsw reference is needed, so correct this legacy decision. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers

[PATCH v2 net-next 1/7] net: page_pool: add helper function to retrieve dma addresses

2019-05-30 Thread Ivan Khoronzhuk
From: Ilias Apalodimas On a previous patch dma addr was stored in 'struct page'. Use that to retrieve DMA addresses used by network drivers Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Ivan Khoronzhuk --- include/net/page_pool.h | 5 +++

[PATCH v2 net-next 2/7] net: page_pool: add helper function to unmap dma addresses

2019-05-30 Thread Ivan Khoronzhuk
From: Ilias Apalodimas On a previous patch dma addr was stored in 'struct page'. Use that to unmap DMA addresses used by network drivers Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Ivan Khoronzhuk --- include/net/page_pool.h | 1 +

[PATCH v2 net-next 5/7] net: ethernet: ti: davinci_cpdma: add dma mapped submit

2019-05-30 Thread Ivan Khoronzhuk
In case if dma mapped packet needs to be sent, like with XDP page pool, the "mapped" submit can be used. This patch adds dma mapped submit based on regular one. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/davinci_cpdma.c | 88 - drivers/net/e

[PATCH v2] net: ethernet: ti: cpsw_ethtool: fix ethtool ring param set

2019-05-31 Thread Ivan Khoronzhuk
RINGPARAM") Signed-off-by: Ivan Khoronzhuk --- Based on net/master drivers/net/ethernet/ti/cpsw_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpsw_ethtool.c b/drivers/net/ethernet/ti/cpsw_ethtool.c index a4a7ec0d2531..6d1c9ebae7cc 100644

Re: [PATCH v2 net-next 7/7] net: ethernet: ti: cpsw: add XDP support

2019-05-31 Thread Ivan Khoronzhuk
ng? To be clear, a page_pool object is needed per RX-queue, as it is accessing a small RX page cache (which protected by NAPI/softirq). There is one RX interrupt and one RX NAPI for all rx channels. On Thu, 30 May 2019 21:20:39 +0300 Ivan Khoronzhuk wrote: @@ -1404,6 +1711,14 @@ static int cps

<    2   3   4   5   6   7   8   >