[PATCH v2 1/3] net/macb: add new driver

Stephen Hemminger stephen at networkplumber.org
Mon Dec 2 21:31:03 CET 2024


On Wed,  6 Nov 2024 03:32:11 +0000
liwencheng <liwencheng at phytium.com.cn> wrote:

> add Phytium NIC MACB ethdev PMD driver.
> 
> Signed-off-by: liwencheng <liwencheng at phytium.com.cn>
> ---
>  drivers/net/macb/base/generic_phy.c |  276 +++++
>  drivers/net/macb/base/generic_phy.h |  198 ++++
>  drivers/net/macb/base/macb_common.c |  667 +++++++++++++
>  drivers/net/macb/base/macb_common.h |  253 +++++
>  drivers/net/macb/base/macb_errno.h  |   54 +
>  drivers/net/macb/base/macb_hw.h     | 1136 +++++++++++++++++++++
>  drivers/net/macb/base/macb_type.h   |   23 +
>  drivers/net/macb/base/macb_uio.c    |  351 +++++++
>  drivers/net/macb/base/macb_uio.h    |   50 +
>  drivers/net/macb/base/meson.build   |   26 +
>  drivers/net/macb/macb_ethdev.c      | 1885 +++++++++++++++++++++++++++++++++++
>  drivers/net/macb/macb_ethdev.h      |   91 ++
>  drivers/net/macb/macb_log.h         |   19 +
>  drivers/net/macb/macb_rxtx.c        | 1380 +++++++++++++++++++++++++
>  drivers/net/macb/macb_rxtx.h        |  325 ++++++
>  drivers/net/macb/meson.build        |   18 +
>  drivers/net/meson.build             |    1 +
>  17 files changed, 6753 insertions(+)
>  create mode 100644 drivers/net/macb/base/generic_phy.c
>  create mode 100644 drivers/net/macb/base/generic_phy.h
>  create mode 100644 drivers/net/macb/base/macb_common.c
>  create mode 100644 drivers/net/macb/base/macb_common.h
>  create mode 100644 drivers/net/macb/base/macb_errno.h
>  create mode 100644 drivers/net/macb/base/macb_hw.h
>  create mode 100644 drivers/net/macb/base/macb_type.h
>  create mode 100644 drivers/net/macb/base/macb_uio.c
>  create mode 100644 drivers/net/macb/base/macb_uio.h
>  create mode 100644 drivers/net/macb/base/meson.build
>  create mode 100644 drivers/net/macb/macb_ethdev.c
>  create mode 100644 drivers/net/macb/macb_ethdev.h
>  create mode 100644 drivers/net/macb/macb_log.h
>  create mode 100644 drivers/net/macb/macb_rxtx.c
>  create mode 100644 drivers/net/macb/macb_rxtx.h
>  create mode 100644 drivers/net/macb/meson.build

Please send v3 addressing my previous comments:

For better review, it is preferred that drivers be broken into smaller
chunks when submitting.

  https://doc.dpdk.org/guides/contributing/new_driver.html


1. Missing documentation
   all new drivers need to have documentation in doc/guides/nics
   to describe hardware and features.

2. Missing license tag.
   These files are missing required SPDX license tags:
drivers/net/macb/base/generic_phy.h
drivers/net/macb/base/macb_errno.h
drivers/net/macb/base/macb_hw.h

3. Missing mailmap entry

4. Missing update to MAINTAINERS

5. Build fails with lastest GCC. The problem is you chose too long a name for some of the
   xstats. Recommend choosing same name as other drivers if possible.


   Warnings found:

[1307/3230] Compiling C object drivers/libtmp_rte_net_macb.a.p/net_macb_macb_ethdev.c.o
In file included from ../drivers/net/macb/base/macb_common.h:36,
                 from ../drivers/net/macb/macb_ethdev.h:10,
                 from ../drivers/net/macb/macb_rxtx.h:8,
                 from ../drivers/net/macb/macb_ethdev.c:11:
../drivers/net/macb/base/macb_hw.h:1063:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1063:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1088:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1088:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
[1326/3230] Compiling C object drivers/libtmp_rte_net_macb.a.p/net_macb_macb_rxtx.c.o
In file included from ../drivers/net/macb/base/macb_common.h:36,
                 from ../drivers/net/macb/macb_ethdev.h:10,
                 from ../drivers/net/macb/macb_rxtx.h:8,
                 from ../drivers/net/macb/macb_rxtx.c:24:
../drivers/net/macb/base/macb_hw.h:1063:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1063:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1088:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1088:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
[2338/3230] Compiling C object drivers/net/macb/base/libmacb_base.a.p/generic_phy.c.o
In file included from ../drivers/net/macb/base/macb_common.h:36,
                 from ../drivers/net/macb/base/generic_phy.h:4,
                 from ../drivers/net/macb/base/generic_phy.c:5:
../drivers/net/macb/base/macb_hw.h:1063:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1063:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1088:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1088:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
[2343/3230] Compiling C object drivers/net/macb/base/libmacb_base.a.p/macb_uio.c.o
In file included from ../drivers/net/macb/base/macb_common.h:36,
                 from ../drivers/net/macb/base/macb_uio.h:4,
                 from ../drivers/net/macb/base/macb_uio.c:6:
../drivers/net/macb/base/macb_hw.h:1063:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1063:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1088:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1088:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
[2352/3230] Compiling C object drivers/net/macb/base/libmacb_base.a.p/macb_common.c.o
In file included from ../drivers/net/macb/base/macb_common.h:36,
                 from ../drivers/net/macb/base/macb_uio.h:4,
                 from ../drivers/net/macb/base/macb_common.c:7:
../drivers/net/macb/base/macb_hw.h:1063:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1063:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1063 |         GEM_STAT_TITLE(TX1519CNT, "tx_greater_than_1518_byte_frames"),
      |         ^~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1088:35: warning: initializer-string for array of ‘char’ is too long [-Wunterminated-string-initialization]
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/macb/base/macb_hw.h:1043:24: note: in definition of macro ‘GEM_STAT_TITLE_BITS’
 1043 |         .stat_string = title,                           \
      |                        ^~~~~
../drivers/net/macb/base/macb_hw.h:1088:9: note: in expansion of macro ‘GEM_STAT_TITLE’
 1088 |         GEM_STAT_TITLE(RX1519CNT, "rx_greater_than_1518_byte_frames"),



More information about the dev mailing list