From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C8BC845F31;
	Tue, 24 Dec 2024 21:47:18 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 94C1D4029D;
	Tue, 24 Dec 2024 21:47:18 +0100 (CET)
Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com
 [209.85.214.176])
 by mails.dpdk.org (Postfix) with ESMTP id 2D56940263
 for <dev@dpdk.org>; Tue, 24 Dec 2024 21:47:17 +0100 (CET)
Received: by mail-pl1-f176.google.com with SMTP id
 d9443c01a7336-21649a7bcdcso57675865ad.1
 for <dev@dpdk.org>; Tue, 24 Dec 2024 12:47:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1735073236;
 x=1735678036; darn=dpdk.org; 
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:from:to:cc:subject:date
 :message-id:reply-to;
 bh=iq/t6EPDoYpscARx4vYZ6VuvDBXnjVNUe3a4Tw5hOJk=;
 b=o5WNoKyI7vm83vojr+PdasGuE/XwOSywW0MeaWo/QkyFiyykjyacalLqPdAcU8pdyG
 0Ql+OwPAt9HLbRQXMHk7UL528Fgv1kYHZhg6+X2qkIs0ir+AYXBwiN3sPycetuC3h0zX
 7boVYlMC5eFMjreAWeWXTHIhiCRjznismZDQ91dNM0ytJHRHXAt3zzs3ZBjCNAdnbhv1
 RO/2JdgtNJLjG3xhybzICMKTGjHraAFfWl307/39QAWCTKbpcwkbN1CrLicw8CTWlfHb
 BgU5kr1a03qhEAPKFOic+3AHRxZT9ZFZsLIwcrgF+KklF6miV9KBO6RtVVgRClAikgPJ
 9n4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1735073236; x=1735678036;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=iq/t6EPDoYpscARx4vYZ6VuvDBXnjVNUe3a4Tw5hOJk=;
 b=g05O8bR0swOmSIHTKjiYv+x5ShKA2UZECtNA6OnGnyKG/SJXowAtMewbrqrqeOhHVt
 I9luBOY9zjDqs3SGIfXMTBFAm3DN0kopNoTJ0Bn1jveKJPn+Ajna2BUfv33STG4TTEG2
 tg+AVw013/AF1VSXlmjrEBmijiETve9WhEisD42iZqftkRM5xRQh6KA5F4Vm0t4YAuZS
 wv6pmmeHbZmkLN7rCLr0jsKTscAsJ2hgd4HyXp5z4JCNi7HSuk4mN/1Uj0XhXrlxz9He
 K6ZCdS5bt5DKJI4q9JfZD7KqfbrwUH5+C443YsZr82WVgmZneFReMLBTDNS3ll2ZQObb
 j/Ng==
X-Gm-Message-State: AOJu0YwkhmZTTsY4yqE4tPNnmL0EvS9KFhLgP4uMS5HkSabAarNNcLvY
 +UZcEEvyfAKZWim1GvJ4m9XESRukeXrvP55Ui77dxFuZb6TS5n06HFxqA5PW4FI=
X-Gm-Gg: ASbGncuuu+kNkg+ZY08unGnxOcw8psb3CgHfwBkvkaWEePXuJ5aX5vNv83EycPk+9DW
 8Hur6fWm4kQ/FpwM+s4QFbvWP+BjnlilwS4Piio4ezlZYi+FWklsM1X067ApiaNYBrQatpiO0ZG
 GPjGukQNrfYiHh4yM/UsW5Owb7sHE4vfWqdf1x2VkS4OXNHX4ADyK+mHvUgIXPMgIedyyZeG1lG
 zJLBoJ1F57dYUwUYT8R1maX9Ldzre6jwVdQcOCCs4PwLN2CeL3Rl+lGv+Mel69VCiL4OkrLgXzs
 sjU+sIJYC999
X-Google-Smtp-Source: AGHT+IGYlLMaxpQeacmvXx2nIUuM/l1NlDEswUUppG8gnqAgsHJlrn7kczaj/LofI1ookCs69FVgVQ==
X-Received: by 2002:a17:902:ce83:b0:216:5b8b:9062 with SMTP id
 d9443c01a7336-219e70dd21cmr268053985ad.54.1735073235958; 
 Tue, 24 Dec 2024 12:47:15 -0800 (PST)
Received: from fedora (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-219dc9f5dc5sm93603865ad.210.2024.12.24.12.47.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 Dec 2024 12:47:15 -0800 (PST)
Date: Tue, 24 Dec 2024 12:47:13 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Junlong Wang <wang.junlong1@zte.com.cn>
Cc: dev@dpdk.org
Subject: Re: [PATCH v5 00/15] net/zxdh: updated net zxdh driver
Message-ID: <20241224124713.1d407219@fedora>
In-Reply-To: <20241223110249.1483277-1-wang.junlong1@zte.com.cn>
References: <20241210055333.782901-2-wang.junlong1@zte.com.cn>
 <20241223110249.1483277-1-wang.junlong1@zte.com.cn>
X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Mon, 23 Dec 2024 19:02:34 +0800
Junlong Wang <wang.junlong1@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.
>=20
> V4:
>   - resolved ci compile issues.
>=20
> 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=20
>     and skip the ASSERTION later.
>   - resolved some WARNING:MACRO_ARG_UNUSED issues.
>   - resolved some other issues.
>=20
> V2:
>   - resolve code style and github-robot build issue.
>=20
> V1:
>   - updated net zxdh driver
>     provided insert/delete/get table code funcs.
>     provided link/mac/vlan/promiscuous/rss/mtu ops.
>=20
> 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
>=20
>  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
>=20

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 selec=
tive
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_zxd=
h_queue.c.o
../drivers/net/zxdh/zxdh_queue.c: In function =E2=80=98zxdh_dev_rx_queue_se=
tup=E2=80=99:
../drivers/net/zxdh/zxdh_queue.c:190:40: warning: taking address of packed =
member of =E2=80=98struct zxdh_virtqueue=E2=80=99 may result in an unaligne=
d pointer value [-Waddress-of-packed-member]
  190 |         struct zxdh_virtnet_rx *rxvq =3D &vq->rxq;
      |                                        ^~~~~~~~
../drivers/net/zxdh/zxdh_queue.c: In function =E2=80=98zxdh_dev_tx_queue_se=
tup=E2=80=99:
../drivers/net/zxdh/zxdh_queue.c:234:16: warning: taking address of packed =
member of =E2=80=98struct zxdh_virtqueue=E2=80=99 may result in an unaligne=
d pointer value [-Waddress-of-packed-member]
  234 |         txvq =3D &vq->txq;
      |                ^~~~~~~~
../drivers/net/zxdh/zxdh_queue.c: In function =E2=80=98zxdh_dev_rx_queue_se=
tup_finish=E2=80=99:
../drivers/net/zxdh/zxdh_queue.c:314:40: warning: taking address of packed =
member of =E2=80=98struct zxdh_virtqueue=E2=80=99 may result in an unaligne=
d pointer value [-Waddress-of-packed-member]
  314 |         struct zxdh_virtnet_rx *rxvq =3D &vq->rxq;
      |                                        ^~~~~~~~
[1449/2983] Compiling C object drivers/libtmp_rte_net_zxdh.a.p/net_zxdh_zxd=
h_ethdev_ops.c.o
../drivers/net/zxdh/zxdh_ethdev_ops.c: In function =E2=80=98zxdh_dev_rss_re=
ta_update=E2=80=99:
../drivers/net/zxdh/zxdh_ethdev_ops.c:921:59: warning: taking address of pa=
cked member of =E2=80=98union <anonymous>=E2=80=99 may result in an unalign=
ed pointer value [-Waddress-of-packed-member]
  921 |                 ret =3D zxdh_rss_table_set(hw->vport.vport, &msg.da=
ta.rss_reta);
      |                                                           ^~~~~~~~~=
~~~~~~~~~
../drivers/net/zxdh/zxdh_ethdev_ops.c: In function =E2=80=98zxdh_dev_rss_re=
ta_query=E2=80=99:
../drivers/net/zxdh/zxdh_ethdev_ops.c:979:59: warning: taking address of pa=
cked member of =E2=80=98union <anonymous>=E2=80=99 may result in an unalign=
ed pointer value [-Waddress-of-packed-member]
  979 |                 ret =3D 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 pa=
cked member of =E2=80=98union <anonymous>=E2=80=99 may result in an unalign=
ed pointer value [-Waddress-of-packed-member]
  993 |         struct zxdh_rss_reta *reta_table =3D &reply_msg.reply_body.=
rss_reta;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~
../drivers/net/zxdh/zxdh_ethdev_ops.c: In function =E2=80=98zxdh_rss_config=
ure=E2=80=99:
../drivers/net/zxdh/zxdh_ethdev_ops.c:1247:59: warning: taking address of p=
acked member of =E2=80=98union <anonymous>=E2=80=99 may result in an unalig=
ned pointer value [-Waddress-of-packed-member]
 1247 |                 ret =3D zxdh_rss_table_set(hw->vport.vport, &msg.da=
ta.rss_reta);
      |                                                           ^~~~~~~~~=
~~~~~~~~~