[PATCH] net/iavf: fix abnormal disable HW interrupt

Zhang, Qi Z qi.z.zhang at intel.com
Mon Jun 12 14:40:20 CEST 2023



> -----Original Message-----
> From: Ye, MingjinX <mingjinx.ye at intel.com>
> Sent: Friday, June 9, 2023 11:20 AM
> To: Zhang, Qi Z <qi.z.zhang at intel.com>; dev at dpdk.org
> Cc: Yang, Qiming <qiming.yang at intel.com>; Zhou, YidingX
> <yidingx.zhou at intel.com>; stable at dpdk.org; Wu, Jingjing
> <jingjing.wu at intel.com>; Xing, Beilei <beilei.xing at intel.com>
> Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zhang at intel.com>
> > Sent: 2023年6月9日 9:48
> > To: Ye, MingjinX <mingjinx.ye at intel.com>; dev at dpdk.org
> > Cc: Yang, Qiming <qiming.yang at intel.com>; Zhou, YidingX
> > <yidingx.zhou at intel.com>; Ye, MingjinX <mingjinx.ye at intel.com>;
> > stable at dpdk.org; Wu, Jingjing <jingjing.wu at intel.com>; Xing, Beilei
> > <beilei.xing at intel.com>
> > Subject: RE: [PATCH] net/iavf: fix abnormal disable HW interrupt
> >
> >
> >
> > > -----Original Message-----
> > > From: Mingjin Ye <mingjinx.ye at intel.com>
> > > Sent: Thursday, June 8, 2023 2:23 PM
> > > To: dev at dpdk.org
> > > Cc: Yang, Qiming <qiming.yang at intel.com>; Zhou, YidingX
> > > <yidingx.zhou at intel.com>; Ye, MingjinX <mingjinx.ye at intel.com>;
> > > stable at dpdk.org; Wu, Jingjing <jingjing.wu at intel.com>; Xing, Beilei
> > > <beilei.xing at intel.com>
> > > Subject: [PATCH] net/iavf: fix abnormal disable HW interrupt
> > >
> > > For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the
> > admin
> > > queue has the issue of access overruns after disabling interrupt.
> > > That results in FW disabling HW interrupt for protection purposes.
> > >
> > > The updates/changes in this patch:
> > > 1. Remove the polling admin queue processing and use the generic
> > > interrupt processing instead.
> > > 2. Release redundant queue resource before stopping processing
> > > interrupt events.
> > >
> > > Fixes: 22b123a36d07 ("net/avf: initialize PMD")
> > > Fixes: ef807926e148 ("net/iavf: support requesting additional queues
> > > from
> > > PF")
> > > Fixes: 84108425054a ("net/iavf: support asynchronous virtual channel
> > > message")
> > > Cc: stable at dpdk.org
> > >
> > > Signed-off-by: Mingjin Ye <mingjinx.ye at intel.com>
> > > ---
> > >  drivers/net/iavf/iavf_ethdev.c | 25 +++++++++---------
> > > drivers/net/iavf/iavf_vchnl.c  | 48
> > > +++++++---------------------------
> > >  2 files changed, 23 insertions(+), 50 deletions(-)
> > >
> > > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > > b/drivers/net/iavf/iavf_ethdev.c index e6cf897293..ba5c88a1ec 100644
> > > --- a/drivers/net/iavf/iavf_ethdev.c
> > > +++ b/drivers/net/iavf/iavf_ethdev.c
> > > @@ -2756,6 +2756,19 @@ iavf_dev_close(struct rte_eth_dev *dev)
> > >  	}
> > >
> > >  	ret = iavf_dev_stop(dev);
> > > +
> > > +	/*
> > > +	 * Release redundant queue resource when close the dev
> > > +	 * so that other vfs can re-use the queues.
> > > +	 */
> > > +	if (vf->lv_enabled) {
> > > +		ret = iavf_request_queues(dev,
> > > IAVF_MAX_NUM_QUEUES_DFLT);
> > > +		if (ret)
> > > +			PMD_DRV_LOG(ERR, "Reset the num of queues
> > > failed");
> > > +
> > > +		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
> > > +	}
> > > +
> > >  	adapter->closed = true;
> > >
> > >  	/* free iAVF security device context all related resources */ @@ -
> > > 2772,18 +2785,6 @@ iavf_dev_close(struct rte_eth_dev *dev)
> > >  	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
> > >  		iavf_config_promisc(adapter, false, false);
> > >
> > > -	/*
> > > -	 * Release redundant queue resource when close the dev
> > > -	 * so that other vfs can re-use the queues.
> > > -	 */
> > > -	if (vf->lv_enabled) {
> > > -		ret = iavf_request_queues(dev,
> > > IAVF_MAX_NUM_QUEUES_DFLT);
> > > -		if (ret)
> > > -			PMD_DRV_LOG(ERR, "Reset the num of queues
> > > failed");
> > > -
> > > -		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
> > > -	}
> > > -
> > >  	iavf_shutdown_adminq(hw);
> > >  	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)
> > {
> > >  		/* disable uio intr before callback unregister */ diff --git
> > > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
> > > index
> > > 8cc5377bcf..579c0d0d70 100644
> > > --- a/drivers/net/iavf/iavf_vchnl.c
> > > +++ b/drivers/net/iavf/iavf_vchnl.c
> > > @@ -323,6 +323,7 @@ iavf_execute_vf_cmd(struct iavf_adapter
> > > *adapter, struct iavf_cmd_info *args,
> > >
> > >  	switch (args->ops) {
> > >  	case VIRTCHNL_OP_RESET_VF:
> > > +	case VIRTCHNL_OP_REQUEST_QUEUES:
> > >  		/*no need to wait for response */
> > >  		_clear_cmd(vf);
> > >  		break;
> >
> > Have you tested the "large VF" case ( > 16 queue) with this patch.

You didn't answer my question.

> > I assume event VIRTCHNL_EVENT_RESET_IMPENDING need to be handled
> here
> > then to trigger a device reset.
> > But I didn't see related part in your patch.
> 
> The processing related to the "big VF" is moved before "adapter->closed =
> true;"
>  to make sure it can be handled correctly by the interrupt function.
> 

I'm not asking what happened during dev_close but the init scenario in the large VF case, 

dev_configure-> iavf_queues_req_reset-> iavf_request_queues

this happens at the situation that is no interrupt is enabled and it need to handle event VIRTCHNL_EVENT_RESET_IMPENDING




More information about the stable mailing list