diff mbox series

[ethtool] ethtool: put driver specific code into drivers dir

Message ID 20240214135505.7721-1-dkirjanov@suse.de (mailing list archive)
State New, archived
Delegated to: Michal Kubecek
Headers show
Series [ethtool] ethtool: put driver specific code into drivers dir | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Denis Kirjanov Feb. 14, 2024, 1:55 p.m. UTC
the patch moves the driver specific code in drivers
directory

Signed-off-by: Denis Kirjanov <dkirjanov@suse.de>
---
 Makefile.am                              | 18 +++++++++++-------
 amd8111e.c => drivers/amd8111e.c         |  0
 at76c50x-usb.c => drivers/at76c50x-usb.c |  0
 bnxt.c => drivers/bnxt.c                 |  0
 cmis.c => drivers/cmis.c                 |  0
 cmis.h => drivers/cmis.h                 |  0
 cpsw.c => drivers/cpsw.c                 |  0
 de2104x.c => drivers/de2104x.c           |  0
 dsa.c => drivers/dsa.c                   |  0
 e100.c => drivers/e100.c                 |  0
 e1000.c => drivers/e1000.c               |  0
 et131x.c => drivers/et131x.c             |  0
 fec.c => drivers/fec.c                   |  0
 fec_8xx.c => drivers/fec_8xx.c           |  0
 fjes.c => drivers/fjes.c                 |  0
 fsl_enetc.c => drivers/fsl_enetc.c       |  0
 hns3.c => drivers/hns3.c                 |  0
 ibm_emac.c => drivers/ibm_emac.c         |  0
 igb.c => drivers/igb.c                   |  0
 igc.c => drivers/igc.c                   |  0
 ixgb.c => drivers/ixgb.c                 |  0
 ixgbe.c => drivers/ixgbe.c               |  0
 ixgbevf.c => drivers/ixgbevf.c           |  0
 lan743x.c => drivers/lan743x.c           |  0
 lan78xx.c => drivers/lan78xx.c           |  0
 marvell.c => drivers/marvell.c           |  0
 natsemi.c => drivers/natsemi.c           |  0
 pcnet32.c => drivers/pcnet32.c           |  0
 qsfp.c => drivers/qsfp.c                 |  0
 qsfp.h => drivers/qsfp.h                 |  0
 realtek.c => drivers/realtek.c           |  0
 sfc.c => drivers/sfc.c                   |  0
 sff-common.c => drivers/sff-common.c     |  0
 sff-common.h => drivers/sff-common.h     |  0
 sfpdiag.c => drivers/sfpdiag.c           |  0
 sfpid.c => drivers/sfpid.c               |  0
 smsc911x.c => drivers/smsc911x.c         |  0
 stmmac.c => drivers/stmmac.c             |  0
 tg3.c => drivers/tg3.c                   |  0
 tse.c => drivers/tse.c                   |  0
 vioc.c => drivers/vioc.c                 |  0
 vmxnet3.c => drivers/vmxnet3.c           |  0
 netlink/module-eeprom.c                  |  6 +++---
 43 files changed, 14 insertions(+), 10 deletions(-)
 rename amd8111e.c => drivers/amd8111e.c (100%)
 rename at76c50x-usb.c => drivers/at76c50x-usb.c (100%)
 rename bnxt.c => drivers/bnxt.c (100%)
 rename cmis.c => drivers/cmis.c (100%)
 rename cmis.h => drivers/cmis.h (100%)
 rename cpsw.c => drivers/cpsw.c (100%)
 rename de2104x.c => drivers/de2104x.c (100%)
 rename dsa.c => drivers/dsa.c (100%)
 rename e100.c => drivers/e100.c (100%)
 rename e1000.c => drivers/e1000.c (100%)
 rename et131x.c => drivers/et131x.c (100%)
 rename fec.c => drivers/fec.c (100%)
 rename fec_8xx.c => drivers/fec_8xx.c (100%)
 rename fjes.c => drivers/fjes.c (100%)
 rename fsl_enetc.c => drivers/fsl_enetc.c (100%)
 rename hns3.c => drivers/hns3.c (100%)
 rename ibm_emac.c => drivers/ibm_emac.c (100%)
 rename igb.c => drivers/igb.c (100%)
 rename igc.c => drivers/igc.c (100%)
 rename ixgb.c => drivers/ixgb.c (100%)
 rename ixgbe.c => drivers/ixgbe.c (100%)
 rename ixgbevf.c => drivers/ixgbevf.c (100%)
 rename lan743x.c => drivers/lan743x.c (100%)
 rename lan78xx.c => drivers/lan78xx.c (100%)
 rename marvell.c => drivers/marvell.c (100%)
 rename natsemi.c => drivers/natsemi.c (100%)
 rename pcnet32.c => drivers/pcnet32.c (100%)
 rename qsfp.c => drivers/qsfp.c (100%)
 rename qsfp.h => drivers/qsfp.h (100%)
 rename realtek.c => drivers/realtek.c (100%)
 rename sfc.c => drivers/sfc.c (100%)
 rename sff-common.c => drivers/sff-common.c (100%)
 rename sff-common.h => drivers/sff-common.h (100%)
 rename sfpdiag.c => drivers/sfpdiag.c (100%)
 rename sfpid.c => drivers/sfpid.c (100%)
 rename smsc911x.c => drivers/smsc911x.c (100%)
 rename stmmac.c => drivers/stmmac.c (100%)
 rename tg3.c => drivers/tg3.c (100%)
 rename tse.c => drivers/tse.c (100%)
 rename vioc.c => drivers/vioc.c (100%)
 rename vmxnet3.c => drivers/vmxnet3.c (100%)

Comments

Andrew Lunn Feb. 14, 2024, 6:12 p.m. UTC | #1
On Wed, Feb 14, 2024 at 08:55:05AM -0500, Denis Kirjanov wrote:
> the patch moves the driver specific code in drivers
> directory

It is normal for the commit message to give the answer to the question
"Why?".

Also, what is your definition of a driver? I would not really call the
sfp parts drivers.

    Andrew
Denis Kirjanov Feb. 15, 2024, 1:41 p.m. UTC | #2
On 2/14/24 21:12, Andrew Lunn wrote:
> On Wed, Feb 14, 2024 at 08:55:05AM -0500, Denis Kirjanov wrote:
>> the patch moves the driver specific code in drivers
>> directory
> 
> It is normal for the commit message to give the answer to the question
> "Why?".

"For better code organization the patch moves the driver-specific code into drivers directory"

> 
> Also, what is your definition of a driver? I would not really call the
> sfp parts drivers.

Sure, I'll put them back in the next version

> 
>     Andrew
>
Andrew Lunn Feb. 15, 2024, 2:40 p.m. UTC | #3
On Thu, Feb 15, 2024 at 04:41:47PM +0300, Denis Kirjanov wrote:
> 
> 
> On 2/14/24 21:12, Andrew Lunn wrote:
> > On Wed, Feb 14, 2024 at 08:55:05AM -0500, Denis Kirjanov wrote:
> >> the patch moves the driver specific code in drivers
> >> directory
> > 
> > It is normal for the commit message to give the answer to the question
> > "Why?".
> 
> "For better code organization the patch moves the driver-specific code into drivers directory"

Is that enough justify the code churn? Are you about to add a lot more
driver code?

> > Also, what is your definition of a driver? I would not really call the
> > sfp parts drivers.
> 
> Sure, I'll put them back in the next version

It is i while since i looked at the insides of ethtool. But if i
remember correctly, the 'drivers' are there to pretty print values
returned by ethtool --register-dump. SFP was just an example, i
suspect there are other files which you moved which are not used by
register-dump as drivers. Hence my question, what is your definition
of driver?

   Andrew
Denis Kirjanov Feb. 16, 2024, 1:37 p.m. UTC | #4
On 2/15/24 17:40, Andrew Lunn wrote:
> On Thu, Feb 15, 2024 at 04:41:47PM +0300, Denis Kirjanov wrote:
>>
>>
>> On 2/14/24 21:12, Andrew Lunn wrote:
>>> On Wed, Feb 14, 2024 at 08:55:05AM -0500, Denis Kirjanov wrote:
>>>> the patch moves the driver specific code in drivers
>>>> directory
>>>
>>> It is normal for the commit message to give the answer to the question
>>> "Why?".
>>
>> "For better code organization the patch moves the driver-specific code into drivers directory"
> 
> Is that enough justify the code churn? Are you about to add a lot more
> driver code?

> 
>>> Also, what is your definition of a driver? I would not really call the
>>> sfp parts drivers.
>>
>> Sure, I'll put them back in the next version
> 
> It is i while since i looked at the insides of ethtool. But if i
> remember correctly, the 'drivers' are there to pretty print values
> returned by ethtool --register-dump. SFP was just an example, i
> suspect there are other files which you moved which are not used by
> register-dump as drivers. Hence my question, what is your definition
> of driver?

Right, the code is used for dumping registers. 
Actually ethtool already calls it driver_list:

#ifdef ETHTOOL_ENABLE_PRETTY_DUMP
static const struct {
        const char *name;
        int (*func)(struct ethtool_drvinfo *info, struct ethtool_regs *regs);

} driver_list[]
....


> 
>    Andrew
diff mbox series

Patch

diff --git a/Makefile.am b/Makefile.am
index b9e06ad..8859168 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,13 +17,17 @@  ethtool_SOURCES = ethtool.c uapi/linux/const.h uapi/linux/ethtool.h internal.h \
 		  list.h
 if ETHTOOL_ENABLE_PRETTY_DUMP
 ethtool_SOURCES += \
-		  amd8111e.c de2104x.c dsa.c e100.c e1000.c et131x.c igb.c	\
-		  fec.c fec_8xx.c fsl_enetc.c ibm_emac.c ixgb.c ixgbe.c \
-		  natsemi.c pcnet32.c realtek.c tg3.c marvell.c vioc.c \
-		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
-		  sff-common.c sff-common.h sfpid.c sfpdiag.c	\
-		  ixgbevf.c tse.c vmxnet3.c qsfp.c qsfp.h fjes.c lan78xx.c \
-		  igc.c cmis.c cmis.h bnxt.c cpsw.c lan743x.c hns3.c
+		  drivers/amd8111e.c drivers/de2104x.c drivers/dsa.c drivers/e100.c \
+		  drivers/e1000.c drivers/et131x.c drivers/igb.c drivers/fec.c \
+		  drivers/fec_8xx.c drivers/fsl_enetc.c drivers/ibm_emac.c drivers/ixgb.c \
+		  drivers/ixgbe.c drivers/natsemi.c drivers/pcnet32.c drivers/realtek.c \
+		  drivers/tg3.c drivers/marvell.c drivers/vioc.c drivers/smsc911x.c \
+		  drivers/at76c50x-usb.c drivers/sfc.c drivers/stmmac.c	\
+		  drivers/sff-common.c drivers/sff-common.h drivers/sfpid.c drivers/sfpdiag.c \
+		  drivers/ixgbevf.c drivers/tse.c drivers/vmxnet3.c drivers/qsfp.c \
+		  drivers/qsfp.h drivers/fjes.c drivers/lan78xx.c drivers/igc.c \
+		  drivers/cmis.c drivers/cmis.h drivers/bnxt.c drivers/cpsw.c \
+		  drivers/lan743x.c drivers/hns3.c
 endif
 
 if ENABLE_BASH_COMPLETION
diff --git a/amd8111e.c b/drivers/amd8111e.c
similarity index 100%
rename from amd8111e.c
rename to drivers/amd8111e.c
diff --git a/at76c50x-usb.c b/drivers/at76c50x-usb.c
similarity index 100%
rename from at76c50x-usb.c
rename to drivers/at76c50x-usb.c
diff --git a/bnxt.c b/drivers/bnxt.c
similarity index 100%
rename from bnxt.c
rename to drivers/bnxt.c
diff --git a/cmis.c b/drivers/cmis.c
similarity index 100%
rename from cmis.c
rename to drivers/cmis.c
diff --git a/cmis.h b/drivers/cmis.h
similarity index 100%
rename from cmis.h
rename to drivers/cmis.h
diff --git a/cpsw.c b/drivers/cpsw.c
similarity index 100%
rename from cpsw.c
rename to drivers/cpsw.c
diff --git a/de2104x.c b/drivers/de2104x.c
similarity index 100%
rename from de2104x.c
rename to drivers/de2104x.c
diff --git a/dsa.c b/drivers/dsa.c
similarity index 100%
rename from dsa.c
rename to drivers/dsa.c
diff --git a/e100.c b/drivers/e100.c
similarity index 100%
rename from e100.c
rename to drivers/e100.c
diff --git a/e1000.c b/drivers/e1000.c
similarity index 100%
rename from e1000.c
rename to drivers/e1000.c
diff --git a/et131x.c b/drivers/et131x.c
similarity index 100%
rename from et131x.c
rename to drivers/et131x.c
diff --git a/fec.c b/drivers/fec.c
similarity index 100%
rename from fec.c
rename to drivers/fec.c
diff --git a/fec_8xx.c b/drivers/fec_8xx.c
similarity index 100%
rename from fec_8xx.c
rename to drivers/fec_8xx.c
diff --git a/fjes.c b/drivers/fjes.c
similarity index 100%
rename from fjes.c
rename to drivers/fjes.c
diff --git a/fsl_enetc.c b/drivers/fsl_enetc.c
similarity index 100%
rename from fsl_enetc.c
rename to drivers/fsl_enetc.c
diff --git a/hns3.c b/drivers/hns3.c
similarity index 100%
rename from hns3.c
rename to drivers/hns3.c
diff --git a/ibm_emac.c b/drivers/ibm_emac.c
similarity index 100%
rename from ibm_emac.c
rename to drivers/ibm_emac.c
diff --git a/igb.c b/drivers/igb.c
similarity index 100%
rename from igb.c
rename to drivers/igb.c
diff --git a/igc.c b/drivers/igc.c
similarity index 100%
rename from igc.c
rename to drivers/igc.c
diff --git a/ixgb.c b/drivers/ixgb.c
similarity index 100%
rename from ixgb.c
rename to drivers/ixgb.c
diff --git a/ixgbe.c b/drivers/ixgbe.c
similarity index 100%
rename from ixgbe.c
rename to drivers/ixgbe.c
diff --git a/ixgbevf.c b/drivers/ixgbevf.c
similarity index 100%
rename from ixgbevf.c
rename to drivers/ixgbevf.c
diff --git a/lan743x.c b/drivers/lan743x.c
similarity index 100%
rename from lan743x.c
rename to drivers/lan743x.c
diff --git a/lan78xx.c b/drivers/lan78xx.c
similarity index 100%
rename from lan78xx.c
rename to drivers/lan78xx.c
diff --git a/marvell.c b/drivers/marvell.c
similarity index 100%
rename from marvell.c
rename to drivers/marvell.c
diff --git a/natsemi.c b/drivers/natsemi.c
similarity index 100%
rename from natsemi.c
rename to drivers/natsemi.c
diff --git a/pcnet32.c b/drivers/pcnet32.c
similarity index 100%
rename from pcnet32.c
rename to drivers/pcnet32.c
diff --git a/qsfp.c b/drivers/qsfp.c
similarity index 100%
rename from qsfp.c
rename to drivers/qsfp.c
diff --git a/qsfp.h b/drivers/qsfp.h
similarity index 100%
rename from qsfp.h
rename to drivers/qsfp.h
diff --git a/realtek.c b/drivers/realtek.c
similarity index 100%
rename from realtek.c
rename to drivers/realtek.c
diff --git a/sfc.c b/drivers/sfc.c
similarity index 100%
rename from sfc.c
rename to drivers/sfc.c
diff --git a/sff-common.c b/drivers/sff-common.c
similarity index 100%
rename from sff-common.c
rename to drivers/sff-common.c
diff --git a/sff-common.h b/drivers/sff-common.h
similarity index 100%
rename from sff-common.h
rename to drivers/sff-common.h
diff --git a/sfpdiag.c b/drivers/sfpdiag.c
similarity index 100%
rename from sfpdiag.c
rename to drivers/sfpdiag.c
diff --git a/sfpid.c b/drivers/sfpid.c
similarity index 100%
rename from sfpid.c
rename to drivers/sfpid.c
diff --git a/smsc911x.c b/drivers/smsc911x.c
similarity index 100%
rename from smsc911x.c
rename to drivers/smsc911x.c
diff --git a/stmmac.c b/drivers/stmmac.c
similarity index 100%
rename from stmmac.c
rename to drivers/stmmac.c
diff --git a/tg3.c b/drivers/tg3.c
similarity index 100%
rename from tg3.c
rename to drivers/tg3.c
diff --git a/tse.c b/drivers/tse.c
similarity index 100%
rename from tse.c
rename to drivers/tse.c
diff --git a/vioc.c b/drivers/vioc.c
similarity index 100%
rename from vioc.c
rename to drivers/vioc.c
diff --git a/vmxnet3.c b/drivers/vmxnet3.c
similarity index 100%
rename from vmxnet3.c
rename to drivers/vmxnet3.c
diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c
index fe02c5a..05104b0 100644
--- a/netlink/module-eeprom.c
+++ b/netlink/module-eeprom.c
@@ -9,9 +9,9 @@ 
 #include <stdio.h>
 #include <stddef.h>
 
-#include "../sff-common.h"
-#include "../qsfp.h"
-#include "../cmis.h"
+#include "../drivers/sff-common.h"
+#include "../drivers/qsfp.h"
+#include "../drivers/cmis.h"
 #include "../internal.h"
 #include "../common.h"
 #include "../list.h"