patch 'buildtools/pmdinfogen: fix warning with python 3.14' has been queued to stable release 24.11.4
Kevin Traynor
ktraynor at redhat.com
Fri Nov 21 12:19:49 CET 2025
Hi,
FYI, your patch has been queued to stable release 24.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/26/25. 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://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/d36af38df7a7e8dd7dfa381097e2bc8cfbf68d16
Thanks.
Kevin
---
>From d36af38df7a7e8dd7dfa381097e2bc8cfbf68d16 Mon Sep 17 00:00:00 2001
From: Robin Jarry <rjarry at redhat.com>
Date: Wed, 29 Oct 2025 17:46:17 +0100
Subject: [PATCH] buildtools/pmdinfogen: fix warning with python 3.14
[ upstream commit 74019b85e70e6152594768d6d07b8360e39ee70a ]
Fix the following warning seen on Fedora 43 with Python 3.14:
buildtools/pmdinfogen.py:118: DeprecationWarning: Due to '_pack_', the
'rte_pci_id' Structure will use memory layout compatible with MSVC
(Windows). If this is intended, set _layout_ to 'ms'. The implicit
default is dep recated and slated to become an error in Python 3.19.
Use the struct module which is simpler and assumes everything is packed
by default.
There is no change in the output of dpdk-pmdinfo.py before and after
this patch.
Bugzilla ID: 1818
Link: https://docs.python.org/3/library/struct.html
Signed-off-by: Robin Jarry <rjarry at redhat.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
---
buildtools/pmdinfogen.py | 42 +++++++++++-----------------------------
1 file changed, 11 insertions(+), 31 deletions(-)
diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py
index dfb89500c0..09e34f1524 100755
--- a/buildtools/pmdinfogen.py
+++ b/buildtools/pmdinfogen.py
@@ -5,7 +5,7 @@
import argparse
-import ctypes
import json
import re
+import struct
import sys
import tempfile
@@ -111,22 +111,4 @@ class COFFImage:
-def define_rte_pci_id(is_big_endian):
- base_type = ctypes.LittleEndianStructure
- if is_big_endian:
- base_type = ctypes.BigEndianStructure
-
- class rte_pci_id(base_type):
- _pack_ = True
- _fields_ = [
- ("class_id", ctypes.c_uint32),
- ("vendor_id", ctypes.c_uint16),
- ("device_id", ctypes.c_uint16),
- ("subsystem_vendor_id", ctypes.c_uint16),
- ("subsystem_device_id", ctypes.c_uint16),
- ]
-
- return rte_pci_id
-
-
class Driver:
OPTIONS = [
@@ -167,24 +149,22 @@ class Driver:
raise Exception("PCI table declared but not defined: %d" % table_name)
- rte_pci_id = define_rte_pci_id(image.is_big_endian)
+ if image.is_big_endian:
+ fmt = ">"
+ else:
+ fmt = "<"
+ fmt += "LHHHH"
result = []
while True:
- size = ctypes.sizeof(rte_pci_id)
+ size = struct.calcsize(fmt)
offset = size * len(result)
data = table_symbol.get_value(offset, size)
if not data:
break
- pci_id = rte_pci_id.from_buffer_copy(data)
- if not pci_id.device_id:
+ _, vendor, device, ss_vendor, ss_device = struct.unpack_from(fmt, data)
+ if not device:
break
- result.append(
- [
- pci_id.vendor_id,
- pci_id.device_id,
- pci_id.subsystem_vendor_id,
- pci_id.subsystem_device_id,
- ]
- )
+ result.append((vendor, device, ss_vendor, ss_device))
+
return result
--
2.51.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-11-21 11:05:09.815673739 +0000
+++ 0005-buildtools-pmdinfogen-fix-warning-with-python-3.14.patch 2025-11-21 11:05:09.360200730 +0000
@@ -1 +1 @@
-From 74019b85e70e6152594768d6d07b8360e39ee70a Mon Sep 17 00:00:00 2001
+From d36af38df7a7e8dd7dfa381097e2bc8cfbf68d16 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 74019b85e70e6152594768d6d07b8360e39ee70a ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index 63e0a8b364..4401106f0b 100755
+index dfb89500c0..09e34f1524 100755
More information about the stable
mailing list