[PATCH v5 00/15] net/zxdh: updated net zxdh driver
Stephen Hemminger
stephen at networkplumber.org
Tue Dec 24 21:47:13 CET 2024
On Mon, 23 Dec 2024 19:02:34 +0800
Junlong Wang <wang.junlong1 at zte.com.cn> wrote:
> V5:
> - Simplify the notify_data part in the zxdh_notify_queue function.
> - Replace rte_zmalloc with rte_calloc in the rss_reta_update function.
> - Remove unnecessary check in mtu_set function.
>
> V4:
> - resolved ci compile issues.
>
> V3:
> - use rte_zmalloc and rte_calloc to avoid memset.
> - remove unnecessary initialization, which first usage will set.
> - adjust some function which is always return 0, changed to void
> and skip the ASSERTION later.
> - resolved some WARNING:MACRO_ARG_UNUSED issues.
> - resolved some other issues.
>
> V2:
> - resolve code style and github-robot build issue.
>
> V1:
> - updated net zxdh driver
> provided insert/delete/get table code funcs.
> provided link/mac/vlan/promiscuous/rss/mtu ops.
>
> Junlong Wang (15):
> net/zxdh: zxdh np init implementation
> net/zxdh: zxdh np uninit implementation
> net/zxdh: port tables init implementations
> net/zxdh: port tables unint implementations
> net/zxdh: rx/tx queue setup and intr enable
> net/zxdh: dev start/stop ops implementations
> net/zxdh: provided dev simple tx implementations
> net/zxdh: provided dev simple rx implementations
> net/zxdh: link info update, set link up/down
> net/zxdh: mac set/add/remove ops implementations
> net/zxdh: promisc/allmulti ops implementations
> net/zxdh: vlan filter/ offload ops implementations
> net/zxdh: rss hash config/update, reta update/get
> net/zxdh: basic stats ops implementations
> net/zxdh: mtu update ops implementations
>
> doc/guides/nics/features/zxdh.ini | 18 +
> doc/guides/nics/zxdh.rst | 17 +
> drivers/net/zxdh/meson.build | 4 +
> drivers/net/zxdh/zxdh_common.c | 24 +
> drivers/net/zxdh/zxdh_common.h | 1 +
> drivers/net/zxdh/zxdh_ethdev.c | 595 +++++++-
> drivers/net/zxdh/zxdh_ethdev.h | 40 +
> drivers/net/zxdh/zxdh_ethdev_ops.c | 1573 +++++++++++++++++++++
> drivers/net/zxdh/zxdh_ethdev_ops.h | 80 ++
> drivers/net/zxdh/zxdh_msg.c | 169 +++
> drivers/net/zxdh/zxdh_msg.h | 232 ++++
> drivers/net/zxdh/zxdh_np.c | 2060 ++++++++++++++++++++++++++++
> drivers/net/zxdh/zxdh_np.h | 579 ++++++++
> drivers/net/zxdh/zxdh_pci.c | 23 +-
> drivers/net/zxdh/zxdh_pci.h | 9 +-
> drivers/net/zxdh/zxdh_queue.c | 242 +++-
> drivers/net/zxdh/zxdh_queue.h | 144 +-
> drivers/net/zxdh/zxdh_rxtx.c | 804 +++++++++++
> drivers/net/zxdh/zxdh_rxtx.h | 20 +-
> drivers/net/zxdh/zxdh_tables.c | 794 +++++++++++
> drivers/net/zxdh/zxdh_tables.h | 231 ++++
> 21 files changed, 7613 insertions(+), 46 deletions(-)
> create mode 100644 drivers/net/zxdh/zxdh_ethdev_ops.c
> create mode 100644 drivers/net/zxdh/zxdh_ethdev_ops.h
> create mode 100644 drivers/net/zxdh/zxdh_np.c
> create mode 100644 drivers/net/zxdh/zxdh_np.h
> create mode 100644 drivers/net/zxdh/zxdh_rxtx.c
> create mode 100644 drivers/net/zxdh/zxdh_tables.c
> create mode 100644 drivers/net/zxdh/zxdh_tables.h
>
I did a build with -Waddress-of-packed member enabled and it reports some
possible issues with the driver.
The virtqueue structure is marked as packed but the virtnet_rx structure
embedded is listed as cache aligned. One solution would be to be more selective
in using __rte_packed, and only apply where needed because of mixed members or
requirements of the hardware.
Full warnings;
[1442/2983] Compiling C object drivers/libtmp_rte_net_zxdh.a.p/net_zxdh_zxdh_queue.c.o
../drivers/net/zxdh/zxdh_queue.c: In function ‘zxdh_dev_rx_queue_setup’:
../drivers/net/zxdh/zxdh_queue.c:190:40: warning: taking address of packed member of ‘struct zxdh_virtqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
190 | struct zxdh_virtnet_rx *rxvq = &vq->rxq;
| ^~~~~~~~
../drivers/net/zxdh/zxdh_queue.c: In function ‘zxdh_dev_tx_queue_setup’:
../drivers/net/zxdh/zxdh_queue.c:234:16: warning: taking address of packed member of ‘struct zxdh_virtqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
234 | txvq = &vq->txq;
| ^~~~~~~~
../drivers/net/zxdh/zxdh_queue.c: In function ‘zxdh_dev_rx_queue_setup_finish’:
../drivers/net/zxdh/zxdh_queue.c:314:40: warning: taking address of packed member of ‘struct zxdh_virtqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
314 | struct zxdh_virtnet_rx *rxvq = &vq->rxq;
| ^~~~~~~~
[1449/2983] Compiling C object drivers/libtmp_rte_net_zxdh.a.p/net_zxdh_zxdh_ethdev_ops.c.o
../drivers/net/zxdh/zxdh_ethdev_ops.c: In function ‘zxdh_dev_rss_reta_update’:
../drivers/net/zxdh/zxdh_ethdev_ops.c:921:59: warning: taking address of packed member of ‘union <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
921 | ret = zxdh_rss_table_set(hw->vport.vport, &msg.data.rss_reta);
| ^~~~~~~~~~~~~~~~~~
../drivers/net/zxdh/zxdh_ethdev_ops.c: In function ‘zxdh_dev_rss_reta_query’:
../drivers/net/zxdh/zxdh_ethdev_ops.c:979:59: warning: taking address of packed member of ‘union <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
979 | ret = zxdh_rss_table_get(hw->vport.vport, &reply_msg.reply_body.rss_reta);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/zxdh/zxdh_ethdev_ops.c:993:44: warning: taking address of packed member of ‘union <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
993 | struct zxdh_rss_reta *reta_table = &reply_msg.reply_body.rss_reta;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/zxdh/zxdh_ethdev_ops.c: In function ‘zxdh_rss_configure’:
../drivers/net/zxdh/zxdh_ethdev_ops.c:1247:59: warning: taking address of packed member of ‘union <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
1247 | ret = zxdh_rss_table_set(hw->vport.vport, &msg.data.rss_reta);
| ^~~~~~~~~~~~~~~~~~
More information about the dev
mailing list