[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00d37c64-f584-4846-b65c-76582601c30f@linux.dev>
Date: Sun, 7 Sep 2025 17:55:24 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Fan Gong <gongfan1@...wei.com>, Zhu Yikai <zhuyikai1@...artners.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
linux-doc@...r.kernel.org, Jonathan Corbet <corbet@....net>,
Bjorn Helgaas <helgaas@...nel.org>, luosifu <luosifu@...wei.com>,
Xin Guo <guoxin09@...wei.com>, Shen Chenyang <shenchenyang1@...ilicon.com>,
Zhou Shuai <zhoushuai28@...wei.com>, Wu Like <wulike1@...wei.com>,
Shi Jing <shijing34@...wei.com>, Luo Yang <luoyang82@...artners.com>,
Meny Yossefi <meny.yossefi@...wei.com>, Gur Stavi <gur.stavi@...wei.com>,
Lee Trager <lee@...ger.us>, Michael Ellerman <mpe@...erman.id.au>,
Suman Ghosh <sumang@...vell.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Joe Damato <jdamato@...tly.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH net-next v04 05/14] hinic3: Command Queue flush interfaces
On 05/09/2025 09:28, Fan Gong wrote:
[...]
> +struct comm_cmd_clear_doorbell {
> + struct mgmt_msg_head head;
> + u16 func_id;
> + u16 rsvd1[3];
> +};
> +
> +struct comm_cmd_clear_resource {
> + struct mgmt_msg_head head;
> + u16 func_id;
> + u16 rsvd1[3];
> +};
I don't see any difference in these 2 structures. And the code
implementation doesn't check types. Probably it's better to refactor
things and try to implement it using common thing.
[...]
> +void hinic3_enable_doorbell(struct hinic3_hwif *hwif)
> +{
> + u32 addr, attr4;
> +
> + addr = HINIC3_CSR_FUNC_ATTR4_ADDR;
> + attr4 = hinic3_hwif_read_reg(hwif, addr);
> +
> + attr4 &= ~HINIC3_AF4_DOORBELL_CTRL_MASK;
> + attr4 |= HINIC3_AF4_SET(ENABLE_DOORBELL, DOORBELL_CTRL);
> +
> + hinic3_hwif_write_reg(hwif, addr, attr4);
> +}
> +
> +void hinic3_disable_doorbell(struct hinic3_hwif *hwif)
> +{
> + u32 addr, attr4;
> +
> + addr = HINIC3_CSR_FUNC_ATTR4_ADDR;
> + attr4 = hinic3_hwif_read_reg(hwif, addr);
> +
> + attr4 &= ~HINIC3_AF4_DOORBELL_CTRL_MASK;
> + attr4 |= HINIC3_AF4_SET(DISABLE_DOORBELL, DOORBELL_CTRL);
> +
> + hinic3_hwif_write_reg(hwif, addr, attr4);
> +}
These 2 functions differ only in one bit. It might be better to
implement it once and use extra boolean parameter?
Powered by blists - more mailing lists