🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Uwe Kleine-König Mon, 02 Nov 2026 11:09
[PATCH net-next] net: ena: Fold header containing PCI id definitions into driver
#9590
Author: Uwe Kleine-König
Date: Mon, 02 Nov 2026 11:09
132 lines
16365 bytes
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
Re: [PATCH net-next] net: ena: Fold header containing PCI id definitions into driver
#10091
Author: Uwe Kleine-König
Date: Tue, 03 Nov 2026 06:41
70 lines
14050 bytes
--fmbssy6xzbjtangh
Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: [PATCH net-next] net: ena: Fold header containing PCI id
 definitions into driver
MIME-Version: 1.0

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=F6nig <u.kleine-koenig@b=
aylibre.com> wrote:
> > The file ena_pci_id_tbl.h is only included once. Fold it into its only
> > consumer, simplifying a bit en passant.
> >=20
> > 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.
> >=20
> > Signed-off-by: Uwe Kleine-K=F6nig <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:
>=20
>  - 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, ...)
>=20
> Would you mind respinning along those lines?

Will respin later today or tomorrow.

Best regards
Uwe

--fmbssy6xzbjtangh
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmrpgicACgkQj4D7WH0S
/k4h4wf7BnWnpyFdy5t4kYuzGwH0D4hl5r6jwwVpNlRESO2NGcbD42sXBuT1L79v
GSMzWDB7jllHfMen947CoYaPAb5N5svMpDw9TjY1MO8hiTnzwzBCvIjaSvI6+nfS
SOTcbPkPoBLrdHlwk45oaFZ1CqCYYmud16tIkvA2G/Rrp+S9wQ6I1h0wZkWZ5ncC
37KbLYNcuhRRYQli/XCeIrQ6nKTF7f59q01bJdrMQWXrcHrNmMzYLxkxKFg3FREu
jBYBvuX44fxKZHDGcH09Uy134k3yQ+I+JoXGh2v8ylG42xzQ27jGjq/UEXz0iISz
uuuhFvyoIGTp5OBOsDhGMkb5UntSGQ==
=I/JX
-----END PGP SIGNATURE-----

--fmbssy6xzbjtangh--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads