patch 'net/af_packet: align Rx/Tx structs to cache line' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Fri Jul 12 12:44:06 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=01c5355b2b130803b4299c783f5157339e88dd24
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 01c5355b2b130803b4299c783f5157339e88dd24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= <mattias.ronnblom at ericsson.com>
Date: Fri, 26 Apr 2024 11:05:02 +0200
Subject: [PATCH] net/af_packet: align Rx/Tx structs to cache line
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit c7a2ce0c1b1bb526304f8875f68cab78f5a5d42c ]
Cache align Rx and Tx queue struct to avoid false sharing.
The RX struct happens to be 64 bytes on x86_64 already, so cache
alignment has no effect there, but it does on 32-bit ISAs.
The TX struct is 56 bytes on x86_64.
Both structs keep counters, and in the RX case they are updated even
for empty polls.
Fixes: 364e08f2bbc0 ("af_packet: add PMD for AF_PACKET-based virtual devices")
Signed-off-by: Mattias Rönnblom <mattias.ronnblom at ericsson.com>
Reviewed-by: Morten Brørup <mb at smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
drivers/net/af_packet/rte_eth_af_packet.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 397a32db58..6b7b16f348 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -6,6 +6,7 @@
* All rights reserved.
*/
+#include <rte_common.h>
#include <rte_string_fns.h>
#include <rte_mbuf.h>
#include <ethdev_driver.h>
@@ -39,7 +40,7 @@
#define DFLT_FRAME_SIZE (1 << 11)
#define DFLT_FRAME_COUNT (1 << 9)
-struct pkt_rx_queue {
+struct __rte_cache_aligned pkt_rx_queue {
int sockfd;
struct iovec *rd;
@@ -55,7 +56,7 @@ struct pkt_rx_queue {
volatile unsigned long rx_bytes;
};
-struct pkt_tx_queue {
+struct __rte_cache_aligned pkt_tx_queue {
int sockfd;
unsigned int frame_data_size;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-07-12 18:40:15.213393394 +0800
+++ 0020-net-af_packet-align-Rx-Tx-structs-to-cache-line.patch 2024-07-12 18:40:13.966594244 +0800
@@ -1 +1 @@
-From c7a2ce0c1b1bb526304f8875f68cab78f5a5d42c Mon Sep 17 00:00:00 2001
+From 01c5355b2b130803b4299c783f5157339e88dd24 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c7a2ce0c1b1bb526304f8875f68cab78f5a5d42c ]
@@ -20 +22,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list