On 2026-05-26 11:54 PM, Josh Hilke wrote: > Include the offical Intel network driver header files in > tools/testing/selftests/vfio/lib/drivers/igb/igb.c and refactor the > driver to directly utilize standard E1000_ prefixed registers and macros > found from those headers. > > Delete tools/testing/selftests/vfio/lib/drivers/igb/registers.h as it > only contains duplicate code found in the offical IGB header files. > > Assisted-by: Gemini:gemini-3.1-pro-preview > Suggested-by: David Matlack <[email protected]> > Signed-off-by: Josh Hilke <[email protected]> > > # Conflicts: > # tools/testing/selftests/vfio/lib/drivers/igb/igb.c
This should not be in the commit message. > --- > .../selftests/vfio/lib/drivers/igb/igb.c | 159 +++++++++--------- > .../vfio/lib/drivers/igb/registers.h | 127 -------------- > tools/testing/selftests/vfio/lib/libvfio.mk | 1 + > 3 files changed, 83 insertions(+), 204 deletions(-) > delete mode 100644 tools/testing/selftests/vfio/lib/drivers/igb/registers.h Please fold this into the first commit to avoid adding registers.h only to then remove it a few patches later. > -#endif /* _IGB_REGISTERS_H_ */ > diff --git a/tools/testing/selftests/vfio/lib/libvfio.mk > b/tools/testing/selftests/vfio/lib/libvfio.mk > index 1f13cca04348..0075749e2f12 100644 > --- a/tools/testing/selftests/vfio/lib/libvfio.mk > +++ b/tools/testing/selftests/vfio/lib/libvfio.mk > @@ -23,6 +23,7 @@ LIBVFIO_O_DIRS := $(shell dirname $(LIBVFIO_O) | uniq) > $(shell mkdir -p $(LIBVFIO_O_DIRS)) > > CFLAGS += -I$(LIBVFIO_SRCDIR)/include > +CFLAGS += -I$(top_srcdir)/drivers/net/ethernet/intel/igb Please create symlinks to the specific header files you need to include rather than exposing this entire directory to the VFIO selftests default include paths. e.g. Take a look how how the DSA driver does it: $ ls -l tools/testing/selftests/vfio/lib/drivers/dsa total 12 -rw-r----- 1 dmatlack primarygroup 11648 Jun 11 21:18 dsa.c lrwxrwxrwx 1 dmatlack primarygroup 49 Oct 6 2025 registers.h -> ../../../../../../../drivers/dma/idxd/registers.h $ head -20 tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c [...] #include "registers.h" [...] > > $(LIBVFIO_O): $(LIBVFIO_OUTPUT)/%.o : $(LIBVFIO_SRCDIR)/%.c > $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ > -- > 2.54.0.794.g4f17f83d09-goog >

