netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Veerasenareddy Burru <vburru@marvell.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<aayarekar@marvell.com>, <sedara@marvell.com>,
	<sburla@marvell.com>, <linux-doc@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next v3 2/7] octeon_ep: poll for control messages
Date: Tue, 14 Feb 2023 18:42:54 +0100	[thread overview]
Message-ID: <Y+vIHjaUvkWXw55x@boxer> (raw)
In-Reply-To: <20230214051422.13705-3-vburru@marvell.com>

On Mon, Feb 13, 2023 at 09:14:17PM -0800, Veerasenareddy Burru wrote:
> Poll for control messages until interrupts are enabled.
> All the interrupts are enabled in ndo_open().
> Add ability to listen for notifications from firmware before ndo_open().
> Once interrupts are enabled, this polling is disabled and all the
> messages are processed by bottom half of interrupt handler.
> 
> Signed-off-by: Veerasenareddy Burru <vburru@marvell.com>
> Signed-off-by: Abhijit Ayarekar <aayarekar@marvell.com>

small two nits

> ---
> v2-> v3:
>  * resovled review comment; fixed reverse christmas tree.
> 
> v1 -> v2:
>  * removed device status oct->status, as it is not required with the
>    modified implementation in 0001-xxxx.patch
> 
>  .../marvell/octeon_ep/octep_cn9k_pf.c         | 49 +++++++++----------
>  .../ethernet/marvell/octeon_ep/octep_main.c   | 35 +++++++++++++
>  .../ethernet/marvell/octeon_ep/octep_main.h   | 11 ++++-
>  .../marvell/octeon_ep/octep_regs_cn9k_pf.h    |  4 ++
>  4 files changed, 71 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c b/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c
> index 6ad88d0fe43f..f40ebac15a79 100644
> --- a/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c
> +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c
> @@ -352,27 +352,36 @@ static void octep_setup_mbox_regs_cn93_pf(struct octep_device *oct, int q_no)
>  	mbox->mbox_read_reg = oct->mmio[0].hw_addr + CN93_SDP_R_MBOX_VF_PF_DATA(q_no);
>  }
>  
> -/* Mailbox Interrupt handler */
> -static void cn93_handle_pf_mbox_intr(struct octep_device *oct)
> +/* Process non-ioq interrupts required to keep pf interface running.
> + * OEI_RINT is needed for control mailbox
> + */
> +static int octep_poll_non_ioq_interrupts_cn93_pf(struct octep_device *oct)

return bool?

>  {
> -	u64 mbox_int_val = 0ULL, val = 0ULL, qno = 0ULL;
> +	int handled = 0;
> +	u64 reg0;
>  
> -	mbox_int_val = readq(oct->mbox[0]->mbox_int_reg);
> -	for (qno = 0; qno < OCTEP_MAX_VF; qno++) {
> -		val = readq(oct->mbox[qno]->mbox_read_reg);
> -		dev_dbg(&oct->pdev->dev,
> -			"PF MBOX READ: val:%llx from VF:%llx\n", val, qno);
> +	/* Check for OEI INTR */
> +	reg0 = octep_read_csr64(oct, CN93_SDP_EPF_OEI_RINT);
> +	if (reg0) {
> +		dev_info(&oct->pdev->dev,
> +			 "Received OEI_RINT intr: 0x%llx\n",
> +			 reg0);
> +		octep_write_csr64(oct, CN93_SDP_EPF_OEI_RINT, reg0);
> +		if (reg0 & CN93_SDP_EPF_OEI_RINT_DATA_BIT_MBOX)
> +			queue_work(octep_wq, &oct->ctrl_mbox_task);
> +
> +		handled = 1;
>  	}
>  
> -	writeq(mbox_int_val, oct->mbox[0]->mbox_int_reg);
> +	return handled;
>  }
>  
>  /* Interrupts handler for all non-queue generic interrupts. */
>  static irqreturn_t octep_non_ioq_intr_handler_cn93_pf(void *dev)
>  {
>  	struct octep_device *oct = (struct octep_device *)dev;
> -	struct pci_dev *pdev = oct->pdev;
>  	u64 reg_val = 0;
> +	struct pci_dev *pdev = oct->pdev;

why this move of var and rct breakage?

>  	int i = 0;
>  
>  	/* Check for IRERR INTR */
> @@ -434,24 +443,9 @@ static irqreturn_t octep_non_ioq_intr_handler_cn93_pf(void *dev)
>  		goto irq_handled;
>  	}
>  
> -	/* Check for MBOX INTR */
> -	reg_val = octep_read_csr64(oct, CN93_SDP_EPF_MBOX_RINT(0));
> -	if (reg_val) {
> -		dev_info(&pdev->dev,
> -			 "Received MBOX_RINT intr: 0x%llx\n", reg_val);
> -		cn93_handle_pf_mbox_intr(oct);
> +	/* Check for MBOX INTR and OEI INTR */
> +	if (octep_poll_non_ioq_interrupts_cn93_pf(oct))
>  		goto irq_handled;
> -	}
> -
> -	/* Check for OEI INTR */
> -	reg_val = octep_read_csr64(oct, CN93_SDP_EPF_OEI_RINT);
> -	if (reg_val) {
> -		dev_info(&pdev->dev,
> -			 "Received OEI_EINT intr: 0x%llx\n", reg_val);
> -		octep_write_csr64(oct, CN93_SDP_EPF_OEI_RINT, reg_val);
> -		queue_work(octep_wq, &oct->ctrl_mbox_task);
> -		goto irq_handled;
> -	}
>  
>  	/* Check for DMA INTR */
>  	reg_val = octep_read_csr64(oct, CN93_SDP_EPF_DMA_RINT);
> @@ -712,6 +706,7 @@ void octep_device_setup_cn93_pf(struct octep_device *oct)
>  
>  	oct->hw_ops.enable_interrupts = octep_enable_interrupts_cn93_pf;
>  	oct->hw_ops.disable_interrupts = octep_disable_interrupts_cn93_pf;
> +	oct->hw_ops.poll_non_ioq_interrupts = octep_poll_non_ioq_interrupts_cn93_pf;
>  
>  	oct->hw_ops.update_iq_read_idx = octep_update_iq_read_index_cn93_pf;

  reply	other threads:[~2023-02-14 17:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  5:14 [PATCH net-next v3 0/7] octeon_ep: deferred probe and mailbox Veerasenareddy Burru
2023-02-14  5:14 ` [PATCH net-next v3 1/7] octeon_ep: defer probe if firmware not ready Veerasenareddy Burru
2023-02-14 17:32   ` Maciej Fijalkowski
2023-02-15 11:43     ` Leon Romanovsky
2023-02-17  8:21     ` [EXT] " Veerasenareddy Burru
2023-02-14  5:14 ` [PATCH net-next v3 2/7] octeon_ep: poll for control messages Veerasenareddy Burru
2023-02-14 17:42   ` Maciej Fijalkowski [this message]
2023-02-17  8:25     ` [EXT] " Veerasenareddy Burru
2023-02-14  5:14 ` [PATCH net-next v3 3/7] octeon_ep: control mailbox for multiple PFs Veerasenareddy Burru
2023-02-14 17:49   ` Maciej Fijalkowski
2023-02-17 17:15     ` [EXT] " Veerasenareddy Burru
2023-02-14  5:14 ` [PATCH net-next v3 4/7] octeon_ep: enhance control mailbox for VF support Veerasenareddy Burru
2023-02-15 15:55   ` Maciej Fijalkowski
2023-03-22  7:24     ` [EXT] " Veerasenareddy Burru
2023-02-14  5:14 ` [PATCH net-next v3 5/7] octeon_ep: support asynchronous notifications Veerasenareddy Burru
2023-02-15 16:36   ` Maciej Fijalkowski
2023-03-22  7:26     ` [EXT] " Veerasenareddy Burru
2023-02-14  5:14 ` [PATCH net-next v3 6/7] octeon_ep: control mbox support for VF stats and link info Veerasenareddy Burru
2023-02-14  5:14 ` [PATCH net-next v3 7/7] octeon_ep: add heartbeat monitor Veerasenareddy Burru

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=Y+vIHjaUvkWXw55x@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=aayarekar@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sburla@marvell.com \
    --cc=sedara@marvell.com \
    --cc=vburru@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).