From: Jakub Kicinski <kuba@kernel.org>
To: Subbaraya Sundeep Bhatta <sbhatta@marvell.com>
Cc: Sai Krishna Gajula <saikrishnag@marvell.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Sunil Kovvuri Goutham <sgoutham@marvell.com>,
Geethasowjanya Akula <gakula@marvell.com>,
Linu Cherian <lcherian@marvell.com>,
Jerin Jacob <jerinj@marvell.com>,
Hariprasad Kelam <hkelam@marvell.com>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"kalesh-anakkur.purayil@broadcom.com"
<kalesh-anakkur.purayil@broadcom.com>
Subject: Re: [EXTERNAL] Re: [net-next PATCH v5 1/6] octeontx2: Set appropriate PF, VF masks and shifts based on silicon
Date: Mon, 9 Dec 2024 13:25:25 -0800 [thread overview]
Message-ID: <20241209132525.600ba231@kernel.org> (raw)
In-Reply-To: <CO1PR18MB4666941A2B96DF6FC59E7119A13C2@CO1PR18MB4666.namprd18.prod.outlook.com>
On Mon, 9 Dec 2024 09:09:35 +0000 Subbaraya Sundeep Bhatta wrote:
> >On Wed, 4 Dec 2024 19:38:16 +0530 Sai Krishna wrote:
> >> -#define RVU_PFVF_PF_SHIFT 10
> >> -#define RVU_PFVF_PF_MASK 0x3F
> >> -#define RVU_PFVF_FUNC_SHIFT 0
> >> -#define RVU_PFVF_FUNC_MASK 0x3FF
> >> +#define RVU_PFVF_PF_SHIFT rvu_pcifunc_pf_shift
> >> +#define RVU_PFVF_PF_MASK rvu_pcifunc_pf_mask
> >> +#define RVU_PFVF_FUNC_SHIFT rvu_pcifunc_func_shift
> >> +#define RVU_PFVF_FUNC_MASK rvu_pcifunc_func_mask
> >
> >Why do you maintain these defines? Looks like an unnecessary
> >indirection.
> >
> >Given these are simple mask and shift values they probably have trivial
> >users. Start by adding helpers which perform the conversions using
> >those, then you can more easily update constants.
>
> There are too many places these masks are used hence added this
> indirection.
> # grep RVU_PFVF_ drivers/* -inr | wc -l
> 135
Yes, I have checked before making the suggestion.
Add a helper first, you can use cocci to do the conversions.
next prev parent reply other threads:[~2024-12-09 21:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 14:08 [net-next PATCH v5 0/6] CN20K silicon with mbox support Sai Krishna
2024-12-04 14:08 ` [net-next PATCH v5 1/6] octeontx2: Set appropriate PF, VF masks and shifts based on silicon Sai Krishna
2024-12-08 2:38 ` Jakub Kicinski
[not found] ` <CO1PR18MB466694B5C67641606838782BA13C2@CO1PR18MB4666.namprd18.prod.outlook.com>
2024-12-09 9:09 ` [EXTERNAL] " Subbaraya Sundeep Bhatta
2024-12-09 21:25 ` Jakub Kicinski [this message]
[not found] ` <CO1PR18MB46664C4F8AA71F0FF2A98A68A13D2@CO1PR18MB4666.namprd18.prod.outlook.com>
[not found] ` <CO1PR18MB46669A23447A3A954AB5C219A13D2@CO1PR18MB4666.namprd18.prod.outlook.com>
2024-12-10 13:55 ` Subbaraya Sundeep Bhatta
2024-12-04 14:08 ` [net-next PATCH v5 2/6] octeontx2-af: CN20k basic mbox operations and structures Sai Krishna
2024-12-08 2:41 ` Jakub Kicinski
2024-12-09 9:26 ` Sai Krishna Gajula
2024-12-04 14:08 ` [net-next PATCH v5 3/6] octeontx2-af: CN20k mbox to support AF REQ/ACK functionality Sai Krishna
2024-12-04 14:08 ` [net-next PATCH v5 4/6] octeontx2-pf: CN20K mbox REQ/ACK implementation for NIC PF Sai Krishna
2024-12-04 14:08 ` [net-next PATCH v5 5/6] octeontx2-af: CN20K mbox implementation for AF's VF Sai Krishna
2024-12-04 14:08 ` [net-next PATCH v5 6/6] octeontx2-pf: CN20K mbox implementation between PF-VF Sai Krishna
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=20241209132525.600ba231@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saikrishnag@marvell.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.