From: Paolo Abeni <pabeni@redhat.com>
To: Satish Kharat <satishkh@cisco.com>,
Christian Benvenuti <benve@cisco.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Nelson Escobar <neescoba@cisco.com>,
John Daley <johndale@cisco.com>
Subject: Re: [PATCH 7/8] enic : cleanup of enic wq request completion path
Date: Tue, 4 Mar 2025 11:47:41 +0100 [thread overview]
Message-ID: <b16a716e-69e3-406f-a0f6-1d62cfa39c42@redhat.com> (raw)
In-Reply-To: <20250227-enic_cleanup_and_ext_cq-v1-7-c314f95812bb@cisco.com>
On 2/28/25 1:30 AM, Satish Kharat wrote:
> diff --git a/drivers/net/ethernet/cisco/enic/enic_wq.c b/drivers/net/ethernet/cisco/enic/enic_wq.c
> index 88fdc462839a8360000eb8526be64118ea35c0e2..37e8f6eeae3fabd3391b8fcacc5f3420ad091b17 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_wq.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_wq.c
> @@ -6,8 +6,12 @@
> #include "enic.h"
> #include "enic_wq.h"
>
> -static void cq_desc_dec(const struct cq_desc *desc_arg, u8 *type, u8 *color,
> - u16 *q_number, u16 *completed_index)
> +#define ENET_CQ_DESC_COMP_NDX_BITS 14
> +#define ENET_CQ_DESC_COMP_NDX_MASK GENMASK(ENET_CQ_DESC_COMP_NDX_BITS - 1, 0)
> +
> +static inline void enic_wq_cq_desc_dec(const struct cq_desc *desc_arg, bool ext_wq,
> + u8 *type, u8 *color, u16 *q_number,
> + u16 *completed_index)
Please avoid 'inline' function in c files.
> @@ -111,7 +81,41 @@ int enic_wq_service(struct vnic_dev *vdev, struct cq_desc *cq_desc, u8 type,
> }
>
> spin_unlock(&enic->wq[q_number].lock);
> -
> - return 0;
> }
>
> +unsigned int enic_wq_cq_service(struct enic *enic, unsigned int cq_index, unsigned int work_to_do)
> +{
> + u16 q_number, completed_index;
> + u8 type, color;
> + unsigned int work_done = 0;
> + struct vnic_cq *cq = &enic->cq[cq_index];
> + struct cq_desc *cq_desc = (struct cq_desc *)((u8 *)cq->ring.descs +
> + cq->ring.desc_size * cq->to_clean);
I think the code would be more readable creating an helper to access the
`cq->to_clean` descriptor.
> +
> + bool ext_wq = cq->ring.size > ENIC_MAX_WQ_DESCS;
Please respect the revers christmas tree order for variable definition,
and avoid empty lines in the variable definition area.
The above also applies to other patches.
Please include the target tree name (net-next in this case) in the subj
prefix in the next iteration.
Thanks,
Paolo
next prev parent reply other threads:[~2025-03-04 10:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 0:30 [PATCH 0/8] enic:enable 32, 64 byte cqes and get max rx/tx ring size from hw Satish Kharat via B4 Relay
2025-02-28 0:30 ` [PATCH 1/8] enic: Move function from header file to c file Satish Kharat via B4 Relay
2025-02-28 0:30 ` [PATCH 2/8] enic: enic rq code reorg Satish Kharat via B4 Relay
2025-02-28 0:30 ` [PATCH 3/8] enic: enic rq extended cq defines Satish Kharat via B4 Relay
2025-02-28 0:30 ` [PATCH 4/8] enic: enable rq extended cq support Satish Kharat via B4 Relay
2025-02-28 0:30 ` [PATCH 5/8] enic : remove unused function cq_enet_wq_desc_dec Satish Kharat via B4 Relay
2025-02-28 0:30 ` [PATCH 6/8] enic : added enic_wq.c and enic_wq.h Satish Kharat via B4 Relay
2025-02-28 0:30 ` [PATCH 7/8] enic : cleanup of enic wq request completion path Satish Kharat via B4 Relay
2025-03-04 10:47 ` Paolo Abeni [this message]
2025-02-28 0:30 ` [PATCH 8/8] enic : get max rq & wq entries supported by hw, 16K queues Satish Kharat via B4 Relay
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=b16a716e-69e3-406f-a0f6-1d62cfa39c42@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johndale@cisco.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neescoba@cisco.com \
--cc=netdev@vger.kernel.org \
--cc=satishkh@cisco.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
all inboxes | Powered by JetHome®