patch 'buildtools/pmdinfogen: fix warning with python 3.14' has been queued to stable release 22.11.11
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Wed Nov 12 17:52:17 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.11
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/14/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/669959909646c4a06823e0c87fbc246b96b8bec0
Thanks.
Luca Boccassi
---
>From 669959909646c4a06823e0c87fbc246b96b8bec0 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
@@ -4,9 +4,9 @@
# Copyright (c) 2020 Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
import argparse
-import ctypes
import json
import re
+import struct
import sys
import tempfile
@@ -110,24 +110,6 @@ class COFFImage:
return None
-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 = [
("params", "_param_string_export"),
@@ -166,26 +148,24 @@ class Driver:
if not table_symbol:
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
def dump(self, file):
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-11-12 16:20:41.118796795 +0000
+++ 0003-buildtools-pmdinfogen-fix-warning-with-python-3.14.patch 2025-11-12 16:20:40.875715664 +0000
@@ -1 +1 @@
-From 74019b85e70e6152594768d6d07b8360e39ee70a Mon Sep 17 00:00:00 2001
+From 669959909646c4a06823e0c87fbc246b96b8bec0 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