DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Wenbo Cao <caowenbo@mucse.com>
Cc: dev@dpdk.org
Subject: Re: [[PATCH v1] 4/8] net/rnp: add mbx basic api feature
Date: Tue, 1 Aug 2023 08:25:55 -0700	[thread overview]
Message-ID: <20230801082555.36dd9f80@hermes.local> (raw)
In-Reply-To: <20230801072207.836932-1-caowenbo@mucse.com>

On Tue,  1 Aug 2023 07:22:07 +0000
Wenbo Cao <caowenbo@mucse.com> wrote:

> +struct rnp_mbx_api {
> +	void (*init_mbx)(struct rnp_hw *hw);
> +	int32_t (*read)(struct rnp_hw *hw,
> +			uint32_t *msg,
> +			uint16_t size,
> +			enum MBX_ID);
> +	int32_t (*write)(struct rnp_hw *hw,
> +			uint32_t *msg,
> +			uint16_t size,
> +			enum MBX_ID);
> +	int32_t (*read_posted)(struct rte_eth_dev *dev,
> +			uint32_t *msg,
> +			uint16_t size,
> +			enum MBX_ID);
> +	int32_t (*write_posted)(struct rte_eth_dev *dev,
> +			uint32_t *msg,
> +			uint16_t size,
> +			enum MBX_ID);
> +	int32_t (*check_for_msg)(struct rnp_hw *hw, enum MBX_ID);
> +	int32_t (*check_for_ack)(struct rnp_hw *hw, enum MBX_ID);
> +	int32_t (*check_for_rst)(struct rnp_hw *hw, enum MBX_ID);
> +	int32_t (*configure)(struct rnp_hw *hw, int nr_vec, bool enable);
> +};

Since this data structure only has virtual function pointers;
many types of bugs can be avoided if it can be made const.
If it const, then compiler can put the initialized table in r/o text section.


  reply	other threads:[~2023-08-01 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01  7:22 Wenbo Cao
2023-08-01 15:25 ` Stephen Hemminger [this message]
2023-08-02  1:41   ` 11
2023-08-02  2:27     ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2023-08-01  6:43 [[PATCH v1] 0/8] *** SUBJECT HERE *** Wenbo Cao
2023-08-01  6:43 ` [[PATCH v1] 4/8] net/rnp: add mbx basic api feature Wenbo Cao

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=20230801082555.36dd9f80@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=caowenbo@mucse.com \
    --cc=dev@dpdk.org \
    /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).