dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Junlong Wang <wang.junlong1@zte.com.cn>
Cc: dev@dpdk.org
Subject: Re: [PATCH v1 3/5] net/zxdh: add support set link speed get autoneg stats
Date: Wed, 31 Dec 2025 11:27:50 -0800	[thread overview]
Message-ID: <20251231112750.6afefaba@phoenix.local> (raw)
In-Reply-To: <20251220061521.289722-4-wang.junlong1@zte.com.cn>

On Sat, 20 Dec 2025 14:15:19 +0800
Junlong Wang <wang.junlong1@zte.com.cn> wrote:

> +static int
> +vf_recv_bar_msg(void *payload, uint16_t len __rte_unused, void *reps_buffer,
> +	uint16_t *reps_len, void *eth_dev __rte_unused)
> +{
> +	struct zxdh_msg_info *msg_payload = (struct zxdh_msg_info *)payload;
> +	uint16_t pcieid = msg_payload->msg_to_vf.pcieid;
> +	uint16_t opcode = msg_payload->msg_to_vf.opcode;
> +	struct rte_eth_dev *dev = (struct rte_eth_dev *)eth_dev;

eth_dev is used, remove the __rte_unused attribute.

> +	struct zxdh_ifc_msg_reply_body_bits *reply_body;
> +	reply_body = (struct zxdh_ifc_msg_reply_body_bits *)
> +		ZXDH_ADDR_OF(msg_reply_body, reps_buffer, flag);
> +	int32_t ret = 0;
> +
> +	if (dev == NULL) {
> +		PMD_DRV_LOG(ERR, "param invalid, dev is NULL");
> +		ret = -2;
> +		return ret;
> +	}

Since there is a len in the message, why not validate that len == sizeof(*msg_payload)
to avoid dereferencing outside of message.


> +
> +	switch (opcode) {
> +	case ZXDH_SET_VF_LINK_STATE:
> +		PMD_DRV_LOG(DEBUG, "PF(pcieid:%d ) set VF's link state", pcieid);
> +		vf_recv_link_state_msg(dev, &msg_payload->data, reps_buffer, reps_len);
> +		reply_body->flag[0] = ZXDH_REPS_SUCC;
> +		break;
> +	default:
> +		ZXDH_SET(msg_reply_body, reps_buffer, flag, ZXDH_REPS_INVALID);
> +		PMD_DRV_LOG(ERR, "[VF GET MSG FROM PF]--unknown msg opcode:%d", opcode);
> +		ret = -1;
> +		break;
> +	}
> +	return ret;
> +}
> +

  parent reply	other threads:[~2025-12-31 19:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-20  6:15 [PATCH v1 0/5] net/zxdh: add support some new features Junlong Wang
2025-12-20  6:15 ` [PATCH v1 1/5] net/zxdh: add support for modifying queue depth Junlong Wang
2025-12-31 19:15   ` Stephen Hemminger
2025-12-20  6:15 ` [PATCH v1 2/5] net/zxdh: optimize alloc queue resources Junlong Wang
2025-12-20  6:15 ` [PATCH v1 3/5] net/zxdh: add support set link speed get autoneg stats Junlong Wang
2025-12-21 16:57   ` Stephen Hemminger
2025-12-31 19:23   ` Stephen Hemminger
2025-12-31 19:24   ` Stephen Hemminger
2025-12-31 19:27   ` Stephen Hemminger [this message]
2025-12-20  6:15 ` [PATCH v1 4/5] net/zxdh: add support primary/secondary process Junlong Wang
2025-12-21 17:00   ` Stephen Hemminger
2025-12-23 10:55   ` Junlong Wang
2025-12-23 17:54   ` Stephen Hemminger
2025-12-20  6:15 ` [PATCH v1 5/5] net/zxdh: add support GENEVE TSO and Rx outer UDP chksum Junlong Wang
2026-01-05  7:16 ` [PATCH v2 0/5] net/zxdh: add support some new features Junlong Wang
2026-01-05  7:16   ` [PATCH v2 1/5] net/zxdh: add support for modifying queue depth Junlong Wang
2026-01-05  7:16   ` [PATCH v2 2/5] net/zxdh: optimize alloc queue resources Junlong Wang
2026-01-05  7:16   ` [PATCH v2 3/5] net/zxdh: add support set link speed get autoneg stats Junlong Wang
2026-01-05  7:16   ` [PATCH v2 4/5] net/zxdh: add support primary/secondary process Junlong Wang
2026-01-05  7:16   ` [PATCH v2 5/5] net/zxdh: add support GENEVE TSO and Rx outer chksum 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=20251231112750.6afefaba@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@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).