* [PATCH net-next] net: ena: Fold header containing PCI id definitions into driver
@ 2026-11-02 11:09 Uwe Kleine-König
2026-11-02 21:49 ` Arthur Kiyanovski
0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2026-11-02 11:09 UTC (permalink / raw)
To: Arthur Kiyanovski, David Arinzon, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Andrew Lunn
Cc: Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap,
Guangshuo Li, Ioana Ciornei, Sang-Heon Jeon, Dawei Feng, netdev,
linux-doc, linux-kernel
The file ena_pci_id_tbl.h is only included once. Fold it into its only
consumer, simplifying a bit en passant.
Note that I took out the trailing comma from the expanded value of
ENA_PCI_ID_TABLE_ENTRY() and thus these commas have to be added when the
macro is used improving readability.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,
I'm currently working on deprecating <linux/mod_devicetable.h> and my
check script stumbled over the header removed here as it used
pci_device_id without including a header to get its definition. Instead
of adding one, simplify the situation a bit.
The change with the trailing comma is maybe subjective, I don't feel
strong here and can drop it if desired.
Best regards
Uwe
.../device_drivers/ethernet/amazon/ena.rst | 1 -
drivers/net/ethernet/amazon/ena/ena_netdev.c | 18 +++++++-
.../net/ethernet/amazon/ena/ena_pci_id_tbl.h | 45 -------------------
3 files changed, 17 insertions(+), 47 deletions(-)
delete mode 100644 drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h
diff --git a/Documentation/networking/device_drivers/ethernet/amazon/ena.rst b/Documentation/networking/device_drivers/ethernet/amazon/ena.rst
index 14784a0a6a8a..72ea5ebf2f71 100644
--- a/Documentation/networking/device_drivers/ethernet/amazon/ena.rst
+++ b/Documentation/networking/device_drivers/ethernet/amazon/ena.rst
@@ -55,7 +55,6 @@ ena_regs_defs.h Definition of ENA PCI memory-mapped (MMIO) registers.
ena_netdev.[ch] Main Linux kernel driver.
ena_ethtool.c ethtool callbacks.
ena_xdp.[ch] XDP files
-ena_pci_id_tbl.h Supported device IDs.
ena_phc.[ch] PTP hardware clock infrastructure (see `PHC`_ for more info)
ena_devlink.[ch] devlink files.
ena_debugfs.[ch] debugfs files.
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 7eb6456ed0d5..c934d1e922e5 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -16,7 +16,6 @@
#include <net/ip.h>
#include "ena_netdev.h"
-#include "ena_pci_id_tbl.h"
#include "ena_xdp.h"
#include "ena_phc.h"
@@ -41,6 +40,23 @@ static struct ena_aenq_handlers aenq_handlers;
static struct workqueue_struct *ena_wq;
+#define PCI_DEV_ID_ENA_LLQ_PF 0x1ec2
+#define PCI_DEV_ID_ENA_LLQ_VF 0xec21
+#define PCI_DEV_ID_ENA_PF 0x0ec2
+#define PCI_DEV_ID_ENA_VF 0xec20
+#define PCI_DEV_ID_ENA_RESRV0 0x0051
+
+#define ENA_PCI_ID_TABLE_ENTRY(devid) \
+ { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, devid) }
+
+static const struct pci_device_id ena_pci_tbl[] = {
+ ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_RESRV0),
+ ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_PF),
+ ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_PF),
+ ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_VF),
+ ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_VF),
+ { }
+};
MODULE_DEVICE_TABLE(pci, ena_pci_tbl);
static int ena_rss_init_default(struct ena_adapter *adapter);
diff --git a/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h b/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h
deleted file mode 100644
index 3ecdf29160ca..000000000000
--- a/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
-/*
- * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
- */
-
-#ifndef ENA_PCI_ID_TBL_H_
-#define ENA_PCI_ID_TBL_H_
-
-#ifndef PCI_VENDOR_ID_AMAZON
-#define PCI_VENDOR_ID_AMAZON 0x1d0f
-#endif
-
-#ifndef PCI_DEV_ID_ENA_PF
-#define PCI_DEV_ID_ENA_PF 0x0ec2
-#endif
-
-#ifndef PCI_DEV_ID_ENA_LLQ_PF
-#define PCI_DEV_ID_ENA_LLQ_PF 0x1ec2
-#endif
-
-#ifndef PCI_DEV_ID_ENA_VF
-#define PCI_DEV_ID_ENA_VF 0xec20
-#endif
-
-#ifndef PCI_DEV_ID_ENA_LLQ_VF
-#define PCI_DEV_ID_ENA_LLQ_VF 0xec21
-#endif
-
-#ifndef PCI_DEV_ID_ENA_RESRV0
-#define PCI_DEV_ID_ENA_RESRV0 0x0051
-#endif
-
-#define ENA_PCI_ID_TABLE_ENTRY(devid) \
- {PCI_DEVICE(PCI_VENDOR_ID_AMAZON, devid)},
-
-static const struct pci_device_id ena_pci_tbl[] = {
- ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_RESRV0)
- ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_PF)
- ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_PF)
- ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_VF)
- ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_VF)
- { }
-};
-
-#endif /* ENA_PCI_ID_TBL_H_ */
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.56.0.rc1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: ena: Fold header containing PCI id definitions into driver
2026-11-02 11:09 [PATCH net-next] net: ena: Fold header containing PCI id definitions into driver Uwe Kleine-König
@ 2026-11-02 21:49 ` Arthur Kiyanovski
2026-11-03 6:41 ` Uwe Kleine-König
0 siblings, 1 reply; 3+ messages in thread
From: Arthur Kiyanovski @ 2026-11-02 21:49 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Arthur Kiyanovski, David Arinzon, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Andrew Lunn, Simon Horman,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Guangshuo Li,
Ioana Ciornei, Sang-Heon Jeon, Dawei Feng, netdev, linux-doc,
linux-kernel
On Mon, 02 Nov 2026 12:09:05 +0100, Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:
> The file ena_pci_id_tbl.h is only included once. Fold it into its only
> consumer, simplifying a bit en passant.
>
> Note that I took out the trailing comma from the expanded value of
> ENA_PCI_ID_TABLE_ENTRY() and thus these commas have to be added when the
> macro is used improving readability.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Hi Uwe,
Thanks for the patch.
I'd prefer to keep ena_pci_id_tbl.h as a separate file - ena_netdev.c is
already by far the largest file in the driver, and I'd rather not grow it
further when there's an alternative.
You're right about the missing definition though, and I think we can fix
that by adding #include <linux/pci.h> to ena_pci_id_tbl.h instead. Would
that satisfy your check script?
The rest of the cleanup can be applied to the header instead:
- drop the #ifndef guards around the PCI_DEV_ID_ENA_* defines, nothing
defines those names anymore
- drop the PCI_VENDOR_ID_AMAZON fallback too, <linux/pci_ids.h> has had
it since 4.18
- keep the trailing comma change, that's how the other drivers do it
(mlx4, e1000, cxgb4, qlcnic, ...)
Would you mind respinning along those lines?
Thanks,
Arthur
--
Arthur Kiyanovski <akiyano@amazon.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: ena: Fold header containing PCI id definitions into driver
2026-11-02 21:49 ` Arthur Kiyanovski
@ 2026-11-03 6:41 ` Uwe Kleine-König
0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2026-11-03 6:41 UTC (permalink / raw)
To: Arthur Kiyanovski
Cc: David Arinzon, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Andrew Lunn, Simon Horman, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Guangshuo Li, Ioana Ciornei,
Sang-Heon Jeon, Dawei Feng, netdev, linux-doc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]
Hello Arthur,
On Mon, Nov 02, 2026 at 09:49:24PM +0000, Arthur Kiyanovski wrote:
> On Mon, 02 Nov 2026 12:09:05 +0100, Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:
> > The file ena_pci_id_tbl.h is only included once. Fold it into its only
> > consumer, simplifying a bit en passant.
> >
> > Note that I took out the trailing comma from the expanded value of
> > ENA_PCI_ID_TABLE_ENTRY() and thus these commas have to be added when the
> > macro is used improving readability.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
>
> I'd prefer to keep ena_pci_id_tbl.h as a separate file - ena_netdev.c is
> already by far the largest file in the driver, and I'd rather not grow it
> further when there's an alternative.
File size isn't a relevant metric for me, but I can live with it that
it's one for you.
> You're right about the missing definition though, and I think we can fix
> that by adding #include <linux/pci.h> to ena_pci_id_tbl.h instead. Would
> that satisfy your check script?
It would, the minimal header to achieve that is <linux/device-id/pci.h>.
I'd stick to that for v2.
> The rest of the cleanup can be applied to the header instead:
>
> - drop the #ifndef guards around the PCI_DEV_ID_ENA_* defines, nothing
> defines those names anymore
> - drop the PCI_VENDOR_ID_AMAZON fallback too, <linux/pci_ids.h> has had
> it since 4.18
> - keep the trailing comma change, that's how the other drivers do it
> (mlx4, e1000, cxgb4, qlcnic, ...)
>
> Would you mind respinning along those lines?
Will respin later today or tomorrow.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-03 6:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 11:09 [PATCH net-next] net: ena: Fold header containing PCI id definitions into driver Uwe Kleine-König
2026-11-02 21:49 ` Arthur Kiyanovski
2026-11-03 6:41 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®