2023-05-13 10:32:54

by Hariprasad Kelam

[permalink] [raw]
Subject: [net-next Patch v10 0/8] octeontx2-pf: HTB offload support

octeontx2 silicon and CN10K transmit interface consists of five
transmit levels starting from MDQ, TL4 to TL1. Once packets are
submitted to MDQ, hardware picks all active MDQs using strict
priority, and MDQs having the same priority level are chosen using
round robin. Each packet will traverse MDQ, TL4 to TL1 levels.
Each level contains an array of queues to support scheduling and
shaping.

As HTB supports classful queuing mechanism by supporting rate and
ceil and allow the user to control the absolute bandwidth to
particular classes of traffic the same can be achieved by
configuring shapers and schedulers on different transmit levels.

This series of patches adds support for HTB offload,

Patch1: Allow strict priority parameter in HTB offload mode.

Patch2: Rename existing total tx queues for better readability

Patch3: defines APIs such that the driver can dynamically initialize/
deinitialize the send queues.

Patch4: Refactors transmit alloc/free calls as preparation for QOS
offload code.

Patch5: moves rate limiting logic to common header which will be used
by qos offload code.

Patch6: Adds actual HTB offload support.

Patch7: exposes qos send queue stats over ethtool.

Patch8: Add documentation about htb offload flow in driver

Hariprasad Kelam (5):
octeontx2-pf: Rename tot_tx_queues to non_qos_queues
octeontx2-pf: Refactor schedular queue alloc/free calls
octeontx2-pf: Prepare for QOS offload
octeontx2-pf: ethtool expose qos stats
docs: octeontx2: Add Documentation for QOS

Naveen Mamindlapalli (2):
sch_htb: Allow HTB priority parameter in offload mode
octeontx2-pf: Add support for HTB offload

Subbaraya Sundeep (1):
octeontx2-pf: qos send queues management
-----
v1 -> v2 :
ensure other drivers won't affect by allowing 'prio'
a parameter in htb offload mode.

v2 -> v3 :
1. discard patch supporting devlink to configure TL1 round
robin priority
2. replace NL_SET_ERR_MSG with NL_SET_ERR_MSG_MOD
3. use max3 instead of using max couple of times and use a better
naming convention in send queue management code.

v3 -> v4:
1. fix sparse warnings.
2. release mutex lock in error conditions.

v4 -> v5:
1. fix pahole reported issues
2. add documentation for htb offload flow.

v5 -> v6:
1. fix synchronization issues w.r.t hlist accessing
from ndo_select_queue with rcu lock.
2. initialize qos related resources in device init.

v6 -> v7:
1. fix erros reported by sparse and clang

v7 -> v8:
1. cover letter header is malformed in last version.
correct the cover letter
v8 -> v9:
1. fix issues reported by smatch

v9 -> v10:
1. split the htb offload patch
2. define helper APIs for txschq config
3. update commit description and documentation.


.../ethernet/marvell/octeontx2.rst | 45 +
.../ethernet/marvell/octeontx2/af/common.h | 2 +-
.../marvell/octeontx2/af/rvu_debugfs.c | 5 +
.../ethernet/marvell/octeontx2/af/rvu_nix.c | 45 +
.../ethernet/marvell/octeontx2/nic/Makefile | 2 +-
.../marvell/octeontx2/nic/otx2_common.c | 121 +-
.../marvell/octeontx2/nic/otx2_common.h | 82 +-
.../marvell/octeontx2/nic/otx2_ethtool.c | 29 +-
.../ethernet/marvell/octeontx2/nic/otx2_pf.c | 114 +-
.../ethernet/marvell/octeontx2/nic/otx2_reg.h | 13 +
.../ethernet/marvell/octeontx2/nic/otx2_tc.c | 29 +-
.../marvell/octeontx2/nic/otx2_txrx.c | 24 +-
.../marvell/octeontx2/nic/otx2_txrx.h | 3 +-
.../ethernet/marvell/octeontx2/nic/otx2_vf.c | 14 +-
.../net/ethernet/marvell/octeontx2/nic/qos.c | 1363 +++++++++++++++++
.../net/ethernet/marvell/octeontx2/nic/qos.h | 69 +
.../ethernet/marvell/octeontx2/nic/qos_sq.c | 296 ++++
.../net/ethernet/mellanox/mlx5/core/en/qos.c | 7 +-
include/net/pkt_cls.h | 1 +
net/sched/sch_htb.c | 7 +-
20 files changed, 2144 insertions(+), 127 deletions(-)
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/qos.c
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/qos.h
create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c

--
2.17.1


2023-05-13 12:41:05

by Hariprasad Kelam

[permalink] [raw]
Subject: [net-next Patch v10 7/8] octeontx2-pf: ethtool expose qos stats

This patch extends ethtool stats support for QoS send queues as well.
upon the number of transmit channels change request, Ensures the real
number of transmit queues are equal to active QoS send queues plus
configured transmit queues.

ethtool -S eth0
txq_qos0: bytes: 3021391800
txq_qos0: frames: 1998275
txq_qos1: bytes: 4619766312
txq_qos1: frames: 3055401
...
...

Signed-off-by: Hariprasad Kelam <[email protected]>
Signed-off-by: Sunil Kovvuri Goutham <[email protected]>
---
.../marvell/octeontx2/nic/otx2_ethtool.c | 29 +++++++++++++------
1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
index 0f8d1a69139f..c47d91da32dc 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
@@ -92,10 +92,16 @@ static void otx2_get_qset_strings(struct otx2_nic *pfvf, u8 **data, int qset)
*data += ETH_GSTRING_LEN;
}
}
- for (qidx = 0; qidx < pfvf->hw.tx_queues; qidx++) {
+
+ for (qidx = 0; qidx < otx2_get_total_tx_queues(pfvf); qidx++) {
for (stats = 0; stats < otx2_n_queue_stats; stats++) {
- sprintf(*data, "txq%d: %s", qidx + start_qidx,
- otx2_queue_stats[stats].name);
+ if (qidx >= pfvf->hw.non_qos_queues)
+ sprintf(*data, "txq_qos%d: %s",
+ qidx + start_qidx - pfvf->hw.non_qos_queues,
+ otx2_queue_stats[stats].name);
+ else
+ sprintf(*data, "txq%d: %s", qidx + start_qidx,
+ otx2_queue_stats[stats].name);
*data += ETH_GSTRING_LEN;
}
}
@@ -159,7 +165,7 @@ static void otx2_get_qset_stats(struct otx2_nic *pfvf,
[otx2_queue_stats[stat].index];
}

- for (qidx = 0; qidx < pfvf->hw.tx_queues; qidx++) {
+ for (qidx = 0; qidx < otx2_get_total_tx_queues(pfvf); qidx++) {
if (!otx2_update_sq_stats(pfvf, qidx)) {
for (stat = 0; stat < otx2_n_queue_stats; stat++)
*((*data)++) = 0;
@@ -254,7 +260,7 @@ static int otx2_get_sset_count(struct net_device *netdev, int sset)
return -EINVAL;

qstats_count = otx2_n_queue_stats *
- (pfvf->hw.rx_queues + pfvf->hw.tx_queues);
+ (pfvf->hw.rx_queues + otx2_get_total_tx_queues(pfvf));
if (!test_bit(CN10K_RPM, &pfvf->hw.cap_flag))
mac_stats = CGX_RX_STATS_COUNT + CGX_TX_STATS_COUNT;
otx2_update_lmac_fec_stats(pfvf);
@@ -282,7 +288,7 @@ static int otx2_set_channels(struct net_device *dev,
{
struct otx2_nic *pfvf = netdev_priv(dev);
bool if_up = netif_running(dev);
- int err = 0;
+ int err, qos_txqs;

if (!channel->rx_count || !channel->tx_count)
return -EINVAL;
@@ -296,14 +302,19 @@ static int otx2_set_channels(struct net_device *dev,
if (if_up)
dev->netdev_ops->ndo_stop(dev);

- err = otx2_set_real_num_queues(dev, channel->tx_count,
+ qos_txqs = bitmap_weight(pfvf->qos.qos_sq_bmap,
+ OTX2_QOS_MAX_LEAF_NODES);
+
+ err = otx2_set_real_num_queues(dev, channel->tx_count + qos_txqs,
channel->rx_count);
if (err)
return err;

pfvf->hw.rx_queues = channel->rx_count;
pfvf->hw.tx_queues = channel->tx_count;
- pfvf->qset.cq_cnt = pfvf->hw.tx_queues + pfvf->hw.rx_queues;
+ if (pfvf->xdp_prog)
+ pfvf->hw.xdp_queues = channel->rx_count;
+ pfvf->hw.non_qos_queues = pfvf->hw.tx_queues + pfvf->hw.xdp_queues;

if (if_up)
err = dev->netdev_ops->ndo_open(dev);
@@ -1405,7 +1416,7 @@ static int otx2vf_get_sset_count(struct net_device *netdev, int sset)
return -EINVAL;

qstats_count = otx2_n_queue_stats *
- (vf->hw.rx_queues + vf->hw.tx_queues);
+ (vf->hw.rx_queues + otx2_get_total_tx_queues(vf));

return otx2_n_dev_stats + otx2_n_drv_stats + qstats_count + 1;
}
--
2.17.1


2023-05-15 08:43:38

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [net-next Patch v10 0/8] octeontx2-pf: HTB offload support

Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <[email protected]>:

On Sat, 13 May 2023 14:21:35 +0530 you wrote:
> octeontx2 silicon and CN10K transmit interface consists of five
> transmit levels starting from MDQ, TL4 to TL1. Once packets are
> submitted to MDQ, hardware picks all active MDQs using strict
> priority, and MDQs having the same priority level are chosen using
> round robin. Each packet will traverse MDQ, TL4 to TL1 levels.
> Each level contains an array of queues to support scheduling and
> shaping.
>
> [...]

Here is the summary with links:
- [net-next,v10,1/8] sch_htb: Allow HTB priority parameter in offload mode
https://git.kernel.org/netdev/net-next/c/12e7789ad5b4
- [net-next,v10,2/8] octeontx2-pf: Rename tot_tx_queues to non_qos_queues
https://git.kernel.org/netdev/net-next/c/508c58f76ca5
- [net-next,v10,3/8] octeontx2-pf: qos send queues management
https://git.kernel.org/netdev/net-next/c/ab6dddd2a669
- [net-next,v10,4/8] octeontx2-pf: Refactor schedular queue alloc/free calls
https://git.kernel.org/netdev/net-next/c/6b4b2ded9c42
- [net-next,v10,5/8] octeontx2-pf: Prepare for QOS offload
https://git.kernel.org/netdev/net-next/c/cb748a7ebad7
- [net-next,v10,6/8] octeontx2-pf: Add support for HTB offload
https://git.kernel.org/netdev/net-next/c/5e6808b4c68d
- [net-next,v10,7/8] octeontx2-pf: ethtool expose qos stats
https://git.kernel.org/netdev/net-next/c/6cebb6a4b114
- [net-next,v10,8/8] docs: octeontx2: Add Documentation for QOS
https://git.kernel.org/netdev/net-next/c/efe103065ccb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html