patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: Chaoyong He <chaoyong.he@corigine.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Cc: "oss-drivers@corigine.com" <oss-drivers@corigine.com>,
	Shihong Wang <shihong.wang@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: RE: [PATCH 22.11] net/nfp: fix link status interrupt
Date: Sat, 16 Dec 2023 00:53:58 +0000	[thread overview]
Message-ID: <DM4PR12MB5373C304C21189F02EB37BFDA192A@DM4PR12MB5373.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20231212031048.1816944-1-chaoyong.he@corigine.com>

Hi Chaoyong,

Thanks for the backporting, patch applied.

> -----Original Message-----
> From: Chaoyong He <chaoyong.he@corigine.com>
> Sent: 12/12/2023 11:11
> To: stable@dpdk.org
> Cc: oss-drivers@corigine.com; Chaoyong He <chaoyong.he@corigine.com>;
> Shihong Wang <shihong.wang@corigine.com>; Peng Zhang
> <peng.zhang@corigine.com>
> Subject: [PATCH 22.11] net/nfp: fix link status interrupt
> 
> [ upstream commit 94d0631a8275afa4314ee1d4f08d2fbd02325124 ]
> 
> In rare cases, when DPDK application exit, the interrupt handler was not
> processed the interrupt in time, resulting in the LSC interrupt mask bit not being
> cleared. So when the DPDK application start again, the newly coming LSC
> interrupts cannot be received and processed properly.
> 
> Fix this problem by force clear the LSC interrupt mask on port initialization.
> 
> Fixes: 6c53f87b3497 ("nfp: add link status interrupt")
> 
> Signed-off-by: Shihong Wang <shihong.wang@corigine.com>
> Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> ---
>  drivers/net/nfp/nfp_common.c    | 2 +-
>  drivers/net/nfp/nfp_common.h    | 1 +
>  drivers/net/nfp/nfp_ethdev.c    | 2 ++
>  drivers/net/nfp/nfp_ethdev_vf.c | 2 ++
>  4 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
> index b75fd22e03..0fa74a43e4 100644
> --- a/drivers/net/nfp/nfp_common.c
> +++ b/drivers/net/nfp/nfp_common.c
> @@ -885,7 +885,7 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev)
>   * If MSI-X auto-masking is enabled clear the mask bit, otherwise
>   * clear the ICR for the entry.
>   */
> -static void
> +void
>  nfp_net_irq_unmask(struct rte_eth_dev *dev)  {
>  	struct nfp_net_hw *hw;
> diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
> index 67c8dc33d8..d1a07f5a72 100644
> --- a/drivers/net/nfp/nfp_common.h
> +++ b/drivers/net/nfp/nfp_common.h
> @@ -449,6 +449,7 @@ void nfp_net_stop_tx_queue(struct rte_eth_dev *dev);
> void nfp_net_close_tx_queue(struct rte_eth_dev *dev);  int
> nfp_net_set_vxlan_port(struct nfp_net_hw *hw, size_t idx, uint16_t port);  int
> nfp_net_check_dma_mask(struct nfp_net_hw *hw, char *name);
> +void nfp_net_irq_unmask(struct rte_eth_dev *dev);
> 
>  #define NFP_NET_DEV_PRIVATE_TO_HW(adapter)\
>  	(&((struct nfp_net_adapter *)adapter)->hw) diff --git
> a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index
> 1b0131b1d8..9f940a12b6 100644
> --- a/drivers/net/nfp/nfp_ethdev.c
> +++ b/drivers/net/nfp/nfp_ethdev.c
> @@ -691,6 +691,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
>  			nfp_net_dev_interrupt_handler, (void *)eth_dev);
>  	/* Telling the firmware about the LSC interrupt entry */
>  	nn_cfg_writeb(hw, NFP_NET_CFG_LSC, NFP_NET_IRQ_LSC_IDX);
> +	/* Unmask the LSC interrupt */
> +	nfp_net_irq_unmask(eth_dev);
>  	/* Recording current stats counters values */
>  	nfp_net_stats_reset(eth_dev);
> 
> diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
> index 6a70daca90..435127604a 100644
> --- a/drivers/net/nfp/nfp_ethdev_vf.c
> +++ b/drivers/net/nfp/nfp_ethdev_vf.c
> @@ -452,6 +452,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
>  					   (void *)eth_dev);
>  		/* Telling the firmware about the LSC interrupt entry */
>  		nn_cfg_writeb(hw, NFP_NET_CFG_LSC,
> NFP_NET_IRQ_LSC_IDX);
> +		/* Unmask the LSC interrupt */
> +		nfp_net_irq_unmask(eth_dev);
>  		/* Recording current stats counters values */
>  		nfp_net_stats_reset(eth_dev);
>  	}
> --
> 2.39.1


      reply	other threads:[~2023-12-16  0:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  3:10 Chaoyong He
2023-12-16  0:53 ` Xueming(Steven) Li [this message]

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=DM4PR12MB5373C304C21189F02EB37BFDA192A@DM4PR12MB5373.namprd12.prod.outlook.com \
    --to=xuemingl@nvidia.com \
    --cc=chaoyong.he@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    --cc=shihong.wang@corigine.com \
    --cc=stable@dpdk.org \
    /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).