linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] octeontx2-af: Fix undetected unmap PF error check
@ 2020-12-16 12:36 Colin King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin King @ 2020-12-16 12:36 UTC (permalink / raw)
  To: Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
	David S . Miller, Jakub Kicinski, George Cherian, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the check for an unmap PF error is always going to be false
because intr_val is a 32 bit int and is being bit-mask checked against
1ULL << 32.  Fix this by making intr_val a u64 to match the type at it
is copied from, namely npa_event_context->npa_af_rvu_ge.

Addresses-Coverity: ("Operands don't affect result")
Fixes: f1168d1e207c ("octeontx2-af: Add devlink health reporters for NPA")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
index 3f9d0ab6d5ae..bc0e4113370e 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
@@ -275,7 +275,8 @@ static int rvu_npa_report_show(struct devlink_fmsg *fmsg, void *ctx,
 			       enum npa_af_rvu_health health_reporter)
 {
 	struct rvu_npa_event_ctx *npa_event_context;
-	unsigned int intr_val, alloc_dis, free_dis;
+	unsigned int alloc_dis, free_dis;
+	u64 intr_val;
 	int err;
 
 	npa_event_context = ctx;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] octeontx2-af: Fix undetected unmap PF error check
  2020-12-17  5:24 George Cherian
@ 2020-12-17 19:02 ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-12-17 19:02 UTC (permalink / raw)
  To: George Cherian
  Cc: Colin King, Sunil Kovvuri Goutham, Linu Cherian,
	Geethasowjanya Akula, Jerin Jacob Kollanukkaran,
	David S . Miller, netdev, kernel-janitors, linux-kernel

On Thu, 17 Dec 2020 05:24:34 +0000 George Cherian wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > Currently the check for an unmap PF error is always going to be false because
> > intr_val is a 32 bit int and is being bit-mask checked against 1ULL << 32.  Fix
> > this by making intr_val a u64 to match the type at it is copied from, namely
> > npa_event_context->npa_af_rvu_ge.
> > 
> > Addresses-Coverity: ("Operands don't affect result")
> > Fixes: f1168d1e207c ("octeontx2-af: Add devlink health reporters for NPA")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>  
> Acked-by: George Cherian <george.cherian@marvell.com>

For some reason patchwork did not register your ack automatically. 
I wonder what happened. I added it manually.

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH][next] octeontx2-af: Fix undetected unmap PF error check
@ 2020-12-17  5:24 George Cherian
  2020-12-17 19:02 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: George Cherian @ 2020-12-17  5:24 UTC (permalink / raw)
  To: Colin King, Sunil Kovvuri Goutham, Linu Cherian,
	Geethasowjanya Akula, Jerin Jacob Kollanukkaran,
	David S . Miller, Jakub Kicinski, netdev
  Cc: kernel-janitors, linux-kernel



> -----Original Message-----
> From: Colin King <colin.king@canonical.com>
> Sent: Wednesday, December 16, 2020 6:06 PM
> To: Sunil Kovvuri Goutham <sgoutham@marvell.com>; Linu Cherian
> <lcherian@marvell.com>; Geethasowjanya Akula <gakula@marvell.com>;
> Jerin Jacob Kollanukkaran <jerinj@marvell.com>; David S . Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; George
> Cherian <gcherian@marvell.com>; netdev@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH][next] octeontx2-af: Fix undetected unmap PF error
> check
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for an unmap PF error is always going to be false because
> intr_val is a 32 bit int and is being bit-mask checked against 1ULL << 32.  Fix
> this by making intr_val a u64 to match the type at it is copied from, namely
> npa_event_context->npa_af_rvu_ge.
> 
> Addresses-Coverity: ("Operands don't affect result")
> Fixes: f1168d1e207c ("octeontx2-af: Add devlink health reporters for NPA")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: George Cherian <george.cherian@marvell.com>

> ---
>  drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
> b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
> index 3f9d0ab6d5ae..bc0e4113370e 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
> @@ -275,7 +275,8 @@ static int rvu_npa_report_show(struct devlink_fmsg
> *fmsg, void *ctx,
>  			       enum npa_af_rvu_health health_reporter)  {
>  	struct rvu_npa_event_ctx *npa_event_context;
> -	unsigned int intr_val, alloc_dis, free_dis;
> +	unsigned int alloc_dis, free_dis;
> +	u64 intr_val;
>  	int err;
> 
>  	npa_event_context = ctx;
> --
> 2.29.2

Regards,
-George

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-17 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 12:36 [PATCH][next] octeontx2-af: Fix undetected unmap PF error check Colin King
2020-12-17  5:24 George Cherian
2020-12-17 19:02 ` Jakub Kicinski

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).