summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/am65-cpsw-nuss.h
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2023-03-27 10:57:58 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-03-28 15:29:22 +0200
commit5c8560c4a19fc3e400715a347ce82bd909e3ac74 (patch)
tree0db4f0581523e85355056dea52165d767ad6a464 /drivers/net/ethernet/ti/am65-cpsw-nuss.h
parentMerge branch 'allocate-multiple-skbuffs-on-tx' (diff)
downloadlinux-5c8560c4a19fc3e400715a347ce82bd909e3ac74.tar.xz
linux-5c8560c4a19fc3e400715a347ce82bd909e3ac74.zip
net: ethernet: ti: am65-cpsw: add .ndo to set dma per-queue rate
Enable rate limiting TX DMA queues for CPSW interface by configuring the rate in absolute Mb/s units per TX queue. Example: ethtool -L eth0 tx 4 echo 100 > /sys/class/net/eth0/queues/tx-0/tx_maxrate echo 200 > /sys/class/net/eth0/queues/tx-1/tx_maxrate echo 50 > /sys/class/net/eth0/queues/tx-2/tx_maxrate echo 30 > /sys/class/net/eth0/queues/tx-3/tx_maxrate # disable echo 0 > /sys/class/net/eth0/queues/tx-0/tx_maxrate Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Link: https://lore.kernel.org/r/20230327085758.3237155-1-s-vadapalli@ti.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/ti/am65-cpsw-nuss.h')
-rw-r--r--drivers/net/ethernet/ti/am65-cpsw-nuss.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.h b/drivers/net/ethernet/ti/am65-cpsw-nuss.h
index cad04662739c..bf40c88fbd9b 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.h
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.h
@@ -79,6 +79,7 @@ struct am65_cpsw_tx_chn {
u32 id;
u32 descs_num;
char tx_chn_name[128];
+ u32 rate_mbps;
};
struct am65_cpsw_rx_chn {
@@ -126,6 +127,7 @@ struct am65_cpsw_common {
int usage_count; /* number of opened ports */
struct cpsw_ale *ale;
int tx_ch_num;
+ u32 tx_ch_rate_msk;
u32 rx_flow_id_base;
struct am65_cpsw_tx_chn tx_chns[AM65_CPSW_MAX_TX_QUEUES];