From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Wen Gu <guwen@linux.alibaba.com>,
Philo Lu <lulie@linux.alibaba.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Lukas Bulwahn <lukas.bulwahn@redhat.com>,
Parthiban Veerasooran <Parthiban.Veerasooran@microchip.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Dust Li <dust.li@linux.alibaba.com>
Subject: Re: [PATCH net-next v1] eea: Add basic driver framework for Alibaba Elastic Ethernet Adaptor
Date: Fri, 25 Jul 2025 11:39:11 +0800 [thread overview]
Message-ID: <1753414751.8289475-2-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <20250724164418.GB1266901@horms.kernel.org>
On Thu, 24 Jul 2025 17:44:18 +0100, Simon Horman <horms@kernel.org> wrote:
> On Thu, Jul 24, 2025 at 07:06:45PM +0800, Xuan Zhuo wrote:
> > Add a driver framework for EEA that will be available in the future.
>
> This is a 40k LoC patch.
> It would be nice to add a bit more information about
> what it includes.
>
> >
> > Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
> > Reviewed-by: Philo Lu <lulie@linux.alibaba.com>
> > Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
> > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > ---
>
> ...
>
> > 19 files changed, 4067 insertions(+)
>
> ...
>
> > diff --git a/drivers/net/ethernet/alibaba/eea/eea_adminq.c b/drivers/net/ethernet/alibaba/eea/eea_adminq.c
>
> > +int eea_adminq_config_host_info(struct eea_net *enet)
> > +{
> > + struct device *dev = enet->edev->dma_dev;
> > + struct eea_aq_host_info_cfg *cfg;
> > + struct eea_aq_host_info_rep *rep;
> > + int rc = -ENOMEM;
> > +
> > + cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
> > + if (!cfg)
> > + return rc;
> > +
> > + rep = kzalloc(sizeof(*rep), GFP_KERNEL);
> > + if (!rep)
> > + goto free_cfg;
> > +
> > + cfg->os_type = EEA_OS_LINUX;
>
> The type of the lvalue above is a little endian integer.
> While the type of the rvalue is a host byte order integer.
> I would address this as follows:
>
> cfg->os_type = cpu_to_le16(EEA_OS_LINUX);
>
> Likewise for other members of cfg set in this function,
> noting that pci_domain is a 32bit entity.
>
> Flagged by Sparse.
>
> There are a number of other (minor) problems flagged by Sparse
> in this patch. Please address them and make sure patches
> are Sparse-clean.
I did the check by make C=1, but I found that my sparse is old ^_^.
I updated the sparse, and cleared all the reports.
...
>
> > diff --git a/drivers/net/ethernet/alibaba/eea/eea_net.c b/drivers/net/ethernet/alibaba/eea/eea_net.c
>
> ...
>
> > +void *ering_cq_get_desc(const struct ering *ering)
> > +{
> > + u8 phase;
> > + u8 *desc;
> > +
> > + desc = ering->cq.desc + (ering->cq.head << ering->cq.desc_size_shift);
> > +
> > + phase = *(u8 *)(desc + ering->cq.desc_size - 1);
> > +
> > + if ((phase & ERING_DESC_F_CQ_PHASE) == ering->cq.phase) {
>
> nit: unnecessary inner-parentheses
I think we should keep it.
Thanks.
next prev parent reply other threads:[~2025-07-25 3:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 11:06 [PATCH net-next v1] eea: Add basic driver framework for Alibaba Elastic Ethernet Adaptor Xuan Zhuo
2025-07-24 16:44 ` Simon Horman
2025-07-25 3:39 ` Xuan Zhuo [this message]
2025-07-24 17:42 ` Andrew Lunn
2025-07-25 3:28 ` Xuan Zhuo
2025-07-25 16:17 ` Andrew Lunn
2025-07-28 15:19 ` Geert Uytterhoeven
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=1753414751.8289475-2-xuanzhuo@linux.alibaba.com \
--to=xuanzhuo@linux.alibaba.com \
--cc=Parthiban.Veerasooran@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=guwen@linux.alibaba.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=lulie@linux.alibaba.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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