netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Fan Gong <gongfan1@huawei.com>, Zhu Yikai <zhuyikai1@h-partners.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Bjorn Helgaas <helgaas@kernel.org>, luosifu <luosifu@huawei.com>,
	Xin Guo <guoxin09@huawei.com>,
	Shen Chenyang <shenchenyang1@hisilicon.com>,
	Zhou Shuai <zhoushuai28@huawei.com>, Wu Like <wulike1@huawei.com>,
	Shi Jing <shijing34@huawei.com>,
	Meny Yossefi <meny.yossefi@huawei.com>,
	Gur Stavi <gur.stavi@huawei.com>, Lee Trager <lee@trager.us>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Suman Ghosh <sumang@marvell.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH net-next v01 07/12] hinic3: Queue pair resource initialization
Date: Tue, 26 Aug 2025 17:08:55 +0100	[thread overview]
Message-ID: <d8df76b5-fd6d-4779-b133-18ab2c987ae1@linux.dev> (raw)
In-Reply-To: <f1be4fdf9c760c29eb53763836796e8bc003bb1c.1756195078.git.zhuyikai1@h-partners.com>

On 26/08/2025 10:05, Fan Gong wrote:
> Add Tx & Rx queue resources and functions for packet transmission
> and reception.
> 
> Co-developed-by: Xin Guo <guoxin09@huawei.com>
> Signed-off-by: Xin Guo <guoxin09@huawei.com>
> Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
> Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
> Signed-off-by: Fan Gong <gongfan1@huawei.com>
> ---

[...]

>   struct hinic3_nic_db {
> -	u32 db_info;
> -	u32 pi_hi;
> +	__le32 db_info;
> +	__le32 pi_hi;
>   };
>   
>   static inline void hinic3_write_db(struct hinic3_io_queue *queue, int cos,
> @@ -84,15 +84,25 @@ static inline void hinic3_write_db(struct hinic3_io_queue *queue, int cos,
>   {
>   	struct hinic3_nic_db db;
>   
> -	db.db_info = DB_INFO_SET(DB_SRC_TYPE, TYPE) |
> -		     DB_INFO_SET(cflag, CFLAG) |
> -		     DB_INFO_SET(cos, COS) |
> -		     DB_INFO_SET(queue->q_id, QID);
> -	db.pi_hi = DB_PI_HIGH(pi);
> +	db.db_info =
> +		cpu_to_le32(DB_INFO_SET(DB_SRC_TYPE, TYPE) |
> +			    DB_INFO_SET(cflag, CFLAG) |
> +			    DB_INFO_SET(cos, COS) |
> +			    DB_INFO_SET(queue->q_id, QID));
> +	db.pi_hi = cpu_to_le32(DB_PI_HIGH(pi));
>   
>   	writeq(*((u64 *)&db), DB_ADDR(queue, pi));
>   }

[...]

> @@ -66,8 +97,8 @@ static void rq_wqe_buf_set(struct hinic3_io_queue *rq, uint32_t wqe_idx,
>   	struct hinic3_rq_wqe *rq_wqe;
>   
>   	rq_wqe = get_q_element(&rq->wq.qpages, wqe_idx, NULL);
> -	rq_wqe->buf_hi_addr = upper_32_bits(dma_addr);
> -	rq_wqe->buf_lo_addr = lower_32_bits(dma_addr);
> +	rq_wqe->buf_hi_addr = cpu_to_le32(upper_32_bits(dma_addr));
> +	rq_wqe->buf_lo_addr = cpu_to_le32(lower_32_bits(dma_addr));
>   }
[...]

> @@ -27,21 +27,21 @@
>   
>   /* RX Completion information that is provided by HW for a specific RX WQE */
>   struct hinic3_rq_cqe {
> -	u32 status;
> -	u32 vlan_len;
> -	u32 offload_type;
> -	u32 rsvd3;
> -	u32 rsvd4;
> -	u32 rsvd5;
> -	u32 rsvd6;
> -	u32 pkt_info;
> +	__le32 status;
> +	__le32 vlan_len;
> +	__le32 offload_type;
> +	__le32 rsvd3;
> +	__le32 rsvd4;
> +	__le32 rsvd5;
> +	__le32 rsvd6;
> +	__le32 pkt_info;
>   };
>   
>   struct hinic3_rq_wqe {
> -	u32 buf_hi_addr;
> -	u32 buf_lo_addr;
> -	u32 cqe_hi_addr;
> -	u32 cqe_lo_addr;
> +	__le32 buf_hi_addr;
> +	__le32 buf_lo_addr;
> +	__le32 cqe_hi_addr;
> +	__le32 cqe_lo_addr;
>   };

This patch has a lot of endianess-improvements changes which are
not stated in the commit message. It's better to move them to a separate
patch to avoid mixing things.

  reply	other threads:[~2025-08-26 16:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  9:05 [PATCH net-next v01 00/12] net: hinic3: Add a driver for Huawei 3rd gen NIC - sw and hw initialization Fan Gong
2025-08-26  9:05 ` [PATCH net-next v01 01/12] hinic3: HW initialization Fan Gong
2025-08-26 11:37   ` Vadim Fedorenko
2025-08-26 19:52   ` ALOK TIWARI
2025-08-26  9:05 ` [PATCH net-next v01 02/12] hinic3: HW management interfaces Fan Gong
2025-08-26  9:05 ` [PATCH net-next v01 03/12] hinic3: HW common function initialization Fan Gong
2025-08-26  9:05 ` [PATCH net-next v01 04/12] hinic3: HW capability initialization Fan Gong
2025-08-26 14:17   ` Vadim Fedorenko
2025-08-26  9:05 ` [PATCH net-next v01 05/12] hinic3: Command Queue flush interfaces Fan Gong
2025-08-26  9:05 ` [PATCH net-next v01 06/12] hinic3: Nic_io initialization Fan Gong
2025-08-26 15:49   ` Vadim Fedorenko
2025-08-26  9:05 ` [PATCH net-next v01 07/12] hinic3: Queue pair resource initialization Fan Gong
2025-08-26 16:08   ` Vadim Fedorenko [this message]
2025-08-26 20:05   ` ALOK TIWARI
2025-08-26  9:05 ` [PATCH net-next v01 08/12] hinic3: Queue pair context initialization Fan Gong
2025-08-26 16:42   ` Vadim Fedorenko
2025-08-26  9:05 ` [PATCH net-next v01 09/12] hinic3: Tx & Rx configuration Fan Gong
2025-08-26  9:05 ` [PATCH net-next v01 10/12] hinic3: Add Rss function Fan Gong
2025-08-26 17:06   ` Vadim Fedorenko
2025-08-26 17:49     ` Jakub Kicinski
2025-08-26 17:54   ` Eric Dumazet
2025-08-27  9:50     ` Fan Gong
2025-08-26  9:05 ` [PATCH net-next v01 11/12] hinic3: Add port management Fan Gong
2025-08-26  9:05 ` [PATCH net-next v01 12/12] hinic3: Fix missing napi->dev in netif_queue_set_napi Fan Gong

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=d8df76b5-fd6d-4779-b133-18ab2c987ae1@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gongfan1@huawei.com \
    --cc=guoxin09@huawei.com \
    --cc=gur.stavi@huawei.com \
    --cc=helgaas@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lee@trager.us \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luosifu@huawei.com \
    --cc=meny.yossefi@huawei.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=shenchenyang1@hisilicon.com \
    --cc=shijing34@huawei.com \
    --cc=sumang@marvell.com \
    --cc=wulike1@huawei.com \
    --cc=zhoushuai28@huawei.com \
    --cc=zhuyikai1@h-partners.com \
    /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).