netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Sai Krishna <saikrishnag@marvell.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, sgoutham@marvell.com,
	gakula@marvell.com, lcherian@marvell.com, jerinj@marvell.com,
	hkelam@marvell.com, sbhatta@marvell.com,
	kalesh-anakkur.purayil@broadcom.com
Subject: Re: [net-next PATCH v2 6/6] octeontx2-pf: CN20K mbox implementation between PF-VF
Date: Fri, 1 Nov 2024 10:04:04 +0000	[thread overview]
Message-ID: <20241101100404.GB1838431@kernel.org> (raw)
In-Reply-To: <20241022185410.4036100-7-saikrishnag@marvell.com>

On Wed, Oct 23, 2024 at 12:24:10AM +0530, Sai Krishna wrote:
> This patch implements the CN20k MBOX communication between PF and
> it's VFs. CN20K silicon got extra interrupt of MBOX response for trigger
> interrupt. Also few of the CSR offsets got changed in CN20K against
> prior series of silicons.
> 
> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> Signed-off-by: Sai Krishna <saikrishnag@marvell.com>

...

> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> index 148a5c91af55..1a7920327fd5 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> @@ -565,6 +565,23 @@ irqreturn_t otx2_pfvf_mbox_intr_handler(int irq, void *pf_irq)
>  	return IRQ_HANDLED;
>  }
>  
> +static void *cn20k_pfvf_mbox_alloc(struct otx2_nic *pf, int numvfs)
> +{
> +	struct qmem *mbox_addr;
> +	int err;
> +
> +	err = qmem_alloc(&pf->pdev->dev, &mbox_addr, numvfs, MBOX_SIZE);

Hi Sai and Sunil,

MBOX_SIZE is 0x10000 (i.e. 2^16).

But qmem_alloc() will assign this value to the entry_sz field of an
instance of struct qmem, whose type is u16. Thus the value will be
truncated to 0. I didn't dig further, but this doesn't seem desirable.

Flagged by Sparse on x86_64.

Also, not strictly related to this patchset: There Sparse flags
a handful of warnings in .../marvell/octeontx2/nic/otx2_pf.c,
which all seem to relate to __iomem annotations. It would be nice
to investigate and resolve those at some point.

> +	if (err) {
> +		dev_err(pf->dev, "qmem alloc fail\n");
> +		return ERR_PTR(-ENOMEM);
> +	}
> +
> +	otx2_write64(pf, RVU_PF_VF_MBOX_ADDR, (u64)mbox_addr->iova);
> +	pf->pfvf_mbox_addr = mbox_addr;
> +
> +	return mbox_addr->base;
> +}
> +
>  static int otx2_pfvf_mbox_init(struct otx2_nic *pf, int numvfs)
>  {
>  	void __iomem *hwbase;

...

  reply	other threads:[~2024-11-01 10:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 18:54 [net-next PATCH v2 0/6] CN20K silicon with mbox support Sai Krishna
2024-10-22 18:54 ` [net-next PATCH v2 1/6] octeontx2: Set appropriate PF, VF masks and shifts based on silicon Sai Krishna
2024-11-01 10:08   ` Simon Horman
2024-11-11  9:15     ` Sai Krishna Gajula
2024-10-22 18:54 ` [net-next PATCH v2 2/6] octeontx2-af: CN20k basic mbox operations and structures Sai Krishna
2024-10-22 18:54 ` [net-next PATCH v2 3/6] octeontx2-af: CN20k mbox to support AF REQ/ACK functionality Sai Krishna
2024-11-01 10:18   ` Simon Horman
2024-11-11  8:42     ` Sai Krishna Gajula
2024-10-22 18:54 ` [net-next PATCH v2 4/6] octeontx2-pf: CN20K mbox REQ/ACK implementation for NIC PF Sai Krishna
2024-10-29 23:06   ` Jakub Kicinski
2024-11-01  5:50     ` Sai Krishna Gajula
2024-10-22 18:54 ` [net-next PATCH v2 5/6] octeontx2-af: CN20K mbox implementation for AF's VF Sai Krishna
2024-10-22 18:54 ` [net-next PATCH v2 6/6] octeontx2-pf: CN20K mbox implementation between PF-VF Sai Krishna
2024-11-01 10:04   ` Simon Horman [this message]
2024-11-12 17:48     ` Sai Krishna Gajula

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=20241101100404.GB1838431@kernel.org \
    --to=horms@kernel.org \
    --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=kuba@kernel.org \
    --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 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).