From: Stephen Hemminger <stephen@networkplumber.org>
To: Junlong Wang <wang.junlong1@zte.com.cn>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH v1 2/6] net/zxdh: fix issues related to MAC configuration
Date: Mon, 7 Jul 2025 09:02:24 -0700 [thread overview]
Message-ID: <20250707090224.1ee10cf3@hermes.local> (raw)
In-Reply-To: <20250707055621.357606-2-wang.junlong1@zte.com.cn>
On Mon, 7 Jul 2025 13:56:17 +0800
Junlong Wang <wang.junlong1@zte.com.cn> wrote:
> Fix error handling when MAC configuration fails.
> This is issue was discovered during internal testing.
>
> Fixes: 1c8f68b64cfc ("net/zxdh: optimize MAC operations")
> Cc: stable@dpdk.org
>
> Signed-off-by: Junlong Wang <wang.junlong1@zte.com.cn>
> ---
> drivers/net/zxdh/zxdh_ethdev.c | 15 +++++++++++
> drivers/net/zxdh/zxdh_ethdev_ops.c | 34 +++++++++++++++++++-----
> drivers/net/zxdh/zxdh_msg.c | 10 +++----
> drivers/net/zxdh/zxdh_tables.c | 42 ++++++++++++++++--------------
> 4 files changed, 69 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/net/zxdh/zxdh_ethdev.c b/drivers/net/zxdh/zxdh_ethdev.c
> index 80053678cb..8996d86b90 100644
> --- a/drivers/net/zxdh/zxdh_ethdev.c
> +++ b/drivers/net/zxdh/zxdh_ethdev.c
> @@ -1265,6 +1265,7 @@ static int
> zxdh_mac_config(struct rte_eth_dev *eth_dev)
> {
> struct zxdh_hw *hw = eth_dev->data->dev_private;
> + struct zxdh_msg_info msg_info = {0};
> int ret = 0;
>
> if (hw->is_pf) {
> @@ -1274,7 +1275,21 @@ zxdh_mac_config(struct rte_eth_dev *eth_dev)
> PMD_DRV_LOG(ERR, "Failed to add mac: port 0x%x", hw->vport.vport);
> return ret;
> }
> + hw->uc_num++;
> + } else {
> + struct zxdh_mac_filter *mac_filter = &msg_info.data.mac_filter_msg;
> + mac_filter->filter_flag = 0xff;
> + memcpy(&mac_filter->mac, ð_dev->data->mac_addrs[0],
> + sizeof(eth_dev->data->mac_addrs[0]));
Since mac_filter->mac and eth_dev->data->mac_addrs are both of same type (rte_ether_addr),
using structure assignment operation instead of memcpy is preferred. Assignment assures
that types are the same.
mac_filter->mac = eth_dev->data->mac_addrs;
next prev parent reply other threads:[~2025-07-07 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 5:56 [PATCH v1 1/6] net/zxdh: fix meson.build issues in compilation Junlong Wang
2025-07-07 5:56 ` [PATCH v1 2/6] net/zxdh: fix issues related to MAC configuration Junlong Wang
2025-07-07 16:02 ` Stephen Hemminger [this message]
2025-07-07 5:56 ` [PATCH v1 3/6] net/zxdh: fix some VLAN related issues Junlong Wang
2025-07-07 5:56 ` [PATCH v1 4/6] net/zxdh: fix RSS " Junlong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250707090224.1ee10cf3@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=wang.junlong1@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).