[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240403145700.26881-4-louis.peens@corigine.com>
Date: Wed, 3 Apr 2024 16:56:59 +0200
From: Louis Peens <louis.peens@...igine.com>
To: David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Jiri Pirko <jiri@...nulli.us>,
Fei Qin <fei.qin@...igine.com>,
netdev@...r.kernel.org,
oss-drivers@...igine.com
Subject: [PATCH net-next v3 3/4] dim: introduce a specific dim profile for better latency
From: Fei Qin <fei.qin@...igine.com>
The current profile is not well-adaptive to NFP NICs in
terms of latency, so introduce a specific profile for better
latency.
Signed-off-by: Fei Qin <fei.qin@...igine.com>
Signed-off-by: Louis Peens <louis.peens@...igine.com>
---
include/linux/dim.h | 2 ++
lib/dim/net_dim.c | 18 ++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/include/linux/dim.h b/include/linux/dim.h
index f343bc9aa2ec..edd6d7bceb28 100644
--- a/include/linux/dim.h
+++ b/include/linux/dim.h
@@ -119,11 +119,13 @@ struct dim {
*
* @DIM_CQ_PERIOD_MODE_START_FROM_EQE: Start counting from EQE
* @DIM_CQ_PERIOD_MODE_START_FROM_CQE: Start counting from CQE (implies timer reset)
+ * @DIM_CQ_PERIOD_MODE_SPECIFIC_0: Specific mode to improve latency
* @DIM_CQ_PERIOD_NUM_MODES: Number of modes
*/
enum dim_cq_period_mode {
DIM_CQ_PERIOD_MODE_START_FROM_EQE = 0x0,
DIM_CQ_PERIOD_MODE_START_FROM_CQE = 0x1,
+ DIM_CQ_PERIOD_MODE_SPECIFIC_0 = 0x2,
DIM_CQ_PERIOD_NUM_MODES
};
diff --git a/lib/dim/net_dim.c b/lib/dim/net_dim.c
index 4e32f7aaac86..2b5dccb6242c 100644
--- a/lib/dim/net_dim.c
+++ b/lib/dim/net_dim.c
@@ -33,6 +33,14 @@
{.usec = 64, .pkts = 64,} \
}
+#define NET_DIM_RX_SPECIFIC_0_PROFILES { \
+ {.usec = 0, .pkts = 1,}, \
+ {.usec = 4, .pkts = 32,}, \
+ {.usec = 64, .pkts = 64,}, \
+ {.usec = 128, .pkts = 256,}, \
+ {.usec = 256, .pkts = 256,} \
+}
+
#define NET_DIM_TX_EQE_PROFILES { \
{.usec = 1, .pkts = NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE,}, \
{.usec = 8, .pkts = NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE,}, \
@@ -49,16 +57,26 @@
{.usec = 64, .pkts = 32,} \
}
+#define NET_DIM_TX_SPECIFIC_0_PROFILES { \
+ {.usec = 0, .pkts = 1,}, \
+ {.usec = 4, .pkts = 16,}, \
+ {.usec = 32, .pkts = 64,}, \
+ {.usec = 64, .pkts = 128,}, \
+ {.usec = 128, .pkts = 128,} \
+}
+
static const struct dim_cq_moder
rx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
NET_DIM_RX_EQE_PROFILES,
NET_DIM_RX_CQE_PROFILES,
+ NET_DIM_RX_SPECIFIC_0_PROFILES,
};
static const struct dim_cq_moder
tx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
NET_DIM_TX_EQE_PROFILES,
NET_DIM_TX_CQE_PROFILES,
+ NET_DIM_TX_SPECIFIC_0_PROFILES,
};
struct dim_cq_moder
--
2.34.1
Powered by blists - more mailing lists