Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port patches for 1.13.7 version. #757

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 2c184daed5aff4cffcb825c9fb2d7f2f4ac87fb1 Mon Sep 17 00:00:00 2001
From: "Du, Frank" <[email protected]>
Date: Wed, 3 Aug 2022 10:34:14 +0800
Subject: [PATCH 1/4] vf: support kahawai runtime rl queue

Signed-off-by: Du, Frank <[email protected]>
---
src/ice_virtchnl.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/ice_virtchnl.c b/src/ice_virtchnl.c
index 39375d4..7b9d023 100644
--- a/src/ice_virtchnl.c
+++ b/src/ice_virtchnl.c
@@ -3652,6 +3652,11 @@ static int ice_vc_cfg_q_bw(struct ice_vf *vf, u8 *msg)

memcpy(vf->qs_bw, qs_bw, len);

+ /* for kahawai runtime rl */
+ if (vf->qs_bw)
+ if (ice_vf_cfg_qs_bw(vf, qbw->num_queues))
+ v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+
err_bw:
kfree(qs_bw);

@@ -3817,11 +3822,12 @@ skip_non_adq_checks:
if (qpi->txq.ring_len > 0) {
vsi->tx_rings[q_idx]->dma = qpi->txq.dma_ring_addr;
vsi->tx_rings[q_idx]->count = qpi->txq.ring_len;
-
+#if 0 /* for kahawai runtime rl */
/* Disable any existing queue first */
if (ice_vf_vsi_dis_single_txq(vf, vsi, q_idx,
qpi->txq.queue_id))
goto error_param;
+#endif

/* Configure a queue with the requested settings */
if (ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx)) {
@@ -3904,8 +3910,10 @@ skip_non_adq_checks:
}
}

+#if 0 /* for kahawai runtime rl */
if (ice_vf_cfg_qs_bw(vf, qci->num_queue_pairs))
goto error_param;
+#endif

/* send the response to the VF */
return ice_vc_respond_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES,
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 431d23a21a680c26705f2ba5ca5140af10f44672 Mon Sep 17 00:00:00 2001
From: Frank Du <[email protected]>
Date: Tue, 21 Feb 2023 09:37:27 +0800
Subject: [PATCH 2/4] ice: set ICE_SCHED_DFLT_BURST_SIZE to 2048

For st2110 rl burst optimization

Signed-off-by: Frank Du <[email protected]>
---
src/ice_type.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ice_type.h b/src/ice_type.h
index 3adabd1..76ac0f3 100644
--- a/src/ice_type.h
+++ b/src/ice_type.h
@@ -1054,7 +1054,7 @@ enum ice_rl_type {
#define ICE_SCHED_DFLT_RL_PROF_ID 0
#define ICE_SCHED_NO_SHARED_RL_PROF_ID 0xFFFF
#define ICE_SCHED_INVAL_PROF_ID 0xFFFF
-#define ICE_SCHED_DFLT_BURST_SIZE (15 * 1024) /* in bytes (15k) */
+#define ICE_SCHED_DFLT_BURST_SIZE (2 * 1024) /* in bytes (2k) */

/* Access Macros for Tx Sched RL Profile data */
#define ICE_TXSCHED_GET_RL_PROF_ID(p) le16_to_cpu((p)->info.profile_id)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 2d65e59f778da831b2bbbc1e63d8b1b321590f78 Mon Sep 17 00:00:00 2001
From: Frank Du <[email protected]>
Date: Thu, 16 Nov 2023 14:19:55 +0800
Subject: [PATCH 3/4] version: update to Kahawai_1.13.7_20240220

Signed-off-by: Frank Du <[email protected]>
---
src/ice_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ice_main.c b/src/ice_main.c
index e9cc474..cdada72 100644
--- a/src/ice_main.c
+++ b/src/ice_main.c
@@ -32,7 +32,7 @@
#define DRV_VERSION_MINOR 13
#define DRV_VERSION_BUILD 7

-#define DRV_VERSION "1.13.7"
+#define DRV_VERSION "Kahawai_1.13.7_20240220"
#define DRV_SUMMARY "Intel(R) Ethernet Connection E800 Series Linux Driver"
#ifdef ICE_ADD_PROBES
#define DRV_VERSION_EXTRA "_probes"
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
From f47bdca753aa1b1fcde73e6439dab934a5f7fc0e Mon Sep 17 00:00:00 2001
From: Frank Du <[email protected]>
Date: Mon, 27 Nov 2023 13:32:13 +0800
Subject: [PATCH] xdp: add set rate_kbps support for the tx_maxrate sys

Signed-off-by: Frank Du <[email protected]>
---
src/ice_main.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/src/ice_main.c b/src/ice_main.c
index 36da2ea..704eaec 100644
--- a/src/ice_main.c
+++ b/src/ice_main.c
#define DRV_VERSION_MINOR 13
#define DRV_VERSION_BUILD 7

-#define DRV_VERSION "1.13.7"
+#define DRV_VERSION "Kahawai_XDP_1.13.7_20240220"
#define DRV_SUMMARY "Intel(R) Ethernet Connection E800 Series Linux Driver"
#ifdef ICE_ADD_PROBES
#define DRV_VERSION_EXTRA "_probes"
@@ -8084,6 +8084,58 @@
* applying the new filter changes
*/
ice_service_task_schedule(vsi->back);
+}
+
+static int
+mtl_set_tx_maxrate(struct net_device *netdev, int queue_index, u32 rate_kbps)
+{
+ struct ice_netdev_priv *np = netdev_priv(netdev);
+ struct ice_vsi *vsi = np->vsi;
+ struct ice_tx_ring* ring;
+ u16 q_handle;
+ int status;
+ u8 tc;
+ bool xdp;
+
+ /* Validate rate_kbps requested is within permitted range */
+ if (rate_kbps > ICE_SCHED_MAX_BW) {
+ netdev_err(netdev, "%s, Invalid max rate %d specified for the queue %d\n",
+ __func__, rate_kbps, queue_index);
+ return -EINVAL;
+ }
+
+ if (vsi->xdp_rings && vsi->xdp_rings[queue_index] && vsi->xdp_rings[queue_index]->xsk_pool) {
+ ring = vsi->xdp_rings[queue_index];
+ xdp = true;
+ } else {
+ ring = vsi->tx_rings[queue_index];
+ xdp = false;
+ }
+
+ q_handle = ring->q_handle;
+ tc = ice_dcb_get_tc(vsi, queue_index);
+
+ vsi = ice_locate_vsi_using_queue(vsi, queue_index);
+ if (!vsi) {
+ netdev_err(netdev, "%s, Invalid VSI for given queue %d\n",
+ __func__, queue_index);
+ return -EINVAL;
+ }
+
+ /* Set BW back to default, when user set rate_kbps to 0 */
+ if (!rate_kbps)
+ status = ice_cfg_q_bw_dflt_lmt(vsi->port_info, vsi->idx, tc,
+ q_handle, ICE_MAX_BW);
+ else
+ status = ice_cfg_q_bw_lmt(vsi->port_info, vsi->idx, tc,
+ q_handle, ICE_MAX_BW, rate_kbps);
+ if (status)
+ netdev_err(netdev, "%s, Unable to set Tx max rate %u, error %d\n",
+ __func__, rate_kbps, status);
+ else
+ netdev_info(netdev, "%s, rate_kbps %u succ, xdp ring %s\n", __func__,
+ rate_kbps, xdp ? "yes" : "no");
+ return status;
}

#ifdef HAVE_NDO_SET_TX_MAXRATE
@@ -8101,6 +8153,14 @@
u16 q_handle;
int status;
u8 tc;
+
+ if (maxrate & 0x80000000) {
+ /* wa with bps unit */
+ maxrate &= ~0x80000000;
+ netdev_info(netdev, "%s, max rate_kbps %d specified for the queue %d\n",
+ __func__, maxrate, queue_index);
+ return mtl_set_tx_maxrate(netdev, queue_index, maxrate);
+ }

/* Validate maxrate requested is within permitted range */
if (maxrate && (maxrate > (ICE_SCHED_MAX_BW / 1000))) {
Loading