lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240131085426.45374-3-louis.peens@corigine.com>
Date: Wed, 31 Jan 2024 10:54:26 +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: Fei Qin <fei.qin@...igine.com>,
	netdev@...r.kernel.org,
	oss-drivers@...igine.com
Subject: [PATCH net-next 2/2] nfp: customize the dim profiles

From: Fei Qin <fei.qin@...igine.com>

The latency with default profiles is not very good when adaptive
interrupt moderation is enabled. This patch customizes the dim
profiles to optimize the latency.

Latency comparison between default and customized profiles for 5
different runs:
                                     Latency (us)
Default profiles     |   158.79 158.05 158.46 157.93 157.42
Customized profiles  |   107.03 106.46 113.01 131.64 107.94

Signed-off-by: Fei Qin <fei.qin@...igine.com>
Signed-off-by: Louis Peens <louis.peens@...igine.com>
---
 .../ethernet/netronome/nfp/nfp_net_common.c   | 27 ++++++++++++++++---
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 3b3210d823e8..cfbcec3045bf 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -1158,16 +1158,28 @@ void nfp_ctrl_close(struct nfp_net *nn)
 	rtnl_unlock();
 }
 
+struct nfp_dim {
+	u16 usec;
+	u16 pkts;
+};
+
 static void nfp_net_rx_dim_work(struct work_struct *work)
 {
+	static const struct nfp_dim rx_profile[] = {
+		{.usec = 0, .pkts = 1},
+		{.usec = 4, .pkts = 32},
+		{.usec = 64, .pkts = 64},
+		{.usec = 128, .pkts = 256},
+		{.usec = 256, .pkts = 256},
+	};
 	struct nfp_net_r_vector *r_vec;
 	unsigned int factor, value;
-	struct dim_cq_moder moder;
+	struct nfp_dim moder;
 	struct nfp_net *nn;
 	struct dim *dim;
 
 	dim = container_of(work, struct dim, work);
-	moder = net_dim_get_rx_moderation(dim->mode, dim->profile_ix);
+	moder = rx_profile[dim->profile_ix];
 	r_vec = container_of(dim, struct nfp_net_r_vector, rx_dim);
 	nn = r_vec->nfp_net;
 
@@ -1190,14 +1202,21 @@ static void nfp_net_rx_dim_work(struct work_struct *work)
 
 static void nfp_net_tx_dim_work(struct work_struct *work)
 {
+	static const struct nfp_dim tx_profile[] = {
+		{.usec = 0, .pkts = 1},
+		{.usec = 4, .pkts = 16},
+		{.usec = 32, .pkts = 64},
+		{.usec = 64, .pkts = 128},
+		{.usec = 128, .pkts = 128},
+	};
 	struct nfp_net_r_vector *r_vec;
 	unsigned int factor, value;
-	struct dim_cq_moder moder;
+	struct nfp_dim moder;
 	struct nfp_net *nn;
 	struct dim *dim;
 
 	dim = container_of(work, struct dim, work);
-	moder = net_dim_get_tx_moderation(dim->mode, dim->profile_ix);
+	moder = tx_profile[dim->profile_ix];
 	r_vec = container_of(dim, struct nfp_net_r_vector, tx_dim);
 	nn = r_vec->nfp_net;
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ