]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: ethernet: ti: cpsw: add support for ringparam configuration
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 6 Jan 2017 20:07:34 +0000 (14:07 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jan 2017 01:48:14 +0000 (20:48 -0500)
commitbe034fc14015c7fcabe62317d156e98b508a759b
tree7a3478f186f9db69284ebe3cecb3db30849a7779
parent90225bf0ba35ab43d1e9825c22f3810826c8bfe8
net: ethernet: ti: cpsw: add support for ringparam configuration

The CPDMA uses one pool of descriptors for both RX and TX which by default
split between all channels proportionally depending on total number of
CPDMA channels and number of TX and RX channels. As result, more
descriptors will be consumed by TX path if there are more TX channels and
there is no way now to dedicate more descriptors for RX path.

So, add the ability to re-split CPDMA pool of descriptors between RX and TX
path via ethtool '-G' command wich will allow to configure and fix number
of descriptors used by RX and TX path, which, then, will be split between
RX/TX channels proportionally depending on RX/TX channels number and
weight. ethtool '-G' command will accept only number of RX entries and rest
of descriptors will be arranged for TX automatically.

Command:
  ethtool -G <devname> rx <number of descriptors>

defaults and limitations:
- minimum number of rx descriptors is 10% of total number of descriptors in
  CPDMA pool
- maximum number of rx descriptors is 90% of total number of descriptors in
  CPDMA pool
- by default, descriptors will be split equally between RX/TX path
- any values passed in "tx" parameter will be ignored

Usage:

 # ethtool -g eth0
Pre-set maximums:
RX:             7372
RX Mini:        0
RX Jumbo:       0
TX:             0
Current hardware settings:
RX:             4096
RX Mini:        0
RX Jumbo:       0
TX:             4096

 # ethtool -G eth0 rx 7372
 # ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX:             7372
RX Mini:        0
RX Jumbo:       0
TX:             0
Current hardware settings:
RX:             7372
RX Mini:        0
RX Jumbo:       0
TX:             820

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/davinci_cpdma.c
drivers/net/ethernet/ti/davinci_cpdma.h