From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <shaopeng.he@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 93C32CE7
 for <dev@dpdk.org>; Tue, 22 Dec 2015 13:03:31 +0100 (CET)
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga103.fm.intel.com with ESMTP; 22 Dec 2015 04:03:30 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,464,1444719600"; d="scan'208";a="712754518"
Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206])
 by orsmga003.jf.intel.com with ESMTP; 22 Dec 2015 04:03:31 -0800
Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by
 FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Tue, 22 Dec 2015 04:03:30 -0800
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
 FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Tue, 22 Dec 2015 04:03:29 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.158]) by
 SHSMSX151.ccr.corp.intel.com ([169.254.3.92]) with mapi id 14.03.0248.002;
 Tue, 22 Dec 2015 20:03:28 +0800
From: "He, Shaopeng" <shaopeng.he@intel.com>
To: "Qiu, Michael" <michael.qiu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH v4 3/6] fm10k: remove rx queue interrupts
 when	dev stops
Thread-Index: AQHRPIWoVyDi84lZu0O84l+52wD+op7W5/jw
Date: Tue, 22 Dec 2015 12:03:27 +0000
Message-ID: <FB82FCC69332B84596FE0CEC3C131094B81EDA@shsmsx102.ccr.corp.intel.com>
References: <1446700329-10048-1-git-send-email-shaopeng.he@intel.com>
 <1450693192-14500-1-git-send-email-shaopeng.he@intel.com>
 <1450693192-14500-4-git-send-email-shaopeng.he@intel.com>
 <533710CFB86FA344BFBF2D6802E6028622EFD10E@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <533710CFB86FA344BFBF2D6802E6028622EFD10E@SHSMSX101.ccr.corp.intel.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v4 3/6] fm10k: remove rx queue interrupts
 when	dev stops
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 22 Dec 2015 12:03:32 -0000

> -----Original Message-----
> From: Qiu, Michael
> Sent: Tuesday, December 22, 2015 2:55 PM
> To: He, Shaopeng; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4 3/6] fm10k: remove rx queue interrupts
> when dev stops
>=20
> On 12/21/2015 6:20 PM, Shaopeng He wrote:
> > Previous dev_stop function stops the rx/tx queues. This patch adds
> > logic to disable rx queue interrupt, clean the datapath event and
> queue/vec map.
> >
> > Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
> > Acked-by: Jing Chen <jing.d.chen@intel.com>
> > ---
> >  drivers/net/fm10k/fm10k_ethdev.c | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> >
> > diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> > b/drivers/net/fm10k/fm10k_ethdev.c
> > index a34c5e2..b5b809c 100644
> > --- a/drivers/net/fm10k/fm10k_ethdev.c
> > +++ b/drivers/net/fm10k/fm10k_ethdev.c
> > @@ -1125,6 +1125,8 @@ fm10k_dev_start(struct rte_eth_dev *dev)  static
> > void  fm10k_dev_stop(struct rte_eth_dev *dev)  {
> > +	struct fm10k_hw *hw =3D FM10K_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> > +	struct rte_intr_handle *intr_handle =3D &dev->pci_dev->intr_handle;
> >  	int i;
> >
> >  	PMD_INIT_FUNC_TRACE();
> > @@ -1136,6 +1138,26 @@ fm10k_dev_stop(struct rte_eth_dev *dev)
> >  	if (dev->data->rx_queues)
> >  		for (i =3D 0; i < dev->data->nb_rx_queues; i++)
> >  			fm10k_dev_rx_queue_stop(dev, i);
> > +
> > +	/* Disable datapath event */
> > +	if (rte_intr_dp_is_en(intr_handle)) {
> > +		for (i =3D 0; i < dev->data->nb_rx_queues; i++) {
> > +			FM10K_WRITE_REG(hw, FM10K_RXINT(i),
> > +				3 << FM10K_RXINT_TIMER_SHIFT);
> > +			if (hw->mac.type =3D=3D fm10k_mac_pf)
> > +				FM10K_WRITE_REG(hw,
> FM10K_ITR(Q2V(dev, i)),
> > +					FM10K_ITR_MASK_SET);
> > +			else
> > +				FM10K_WRITE_REG(hw,
> FM10K_VFITR(Q2V(dev, i)),
> > +					FM10K_ITR_MASK_SET);
> > +		}
> > +	}
> > +	/* Clean datapath event and queue/vec mapping */
> > +	rte_intr_efd_disable(intr_handle);
> > +	if (intr_handle->intr_vec !=3D NULL) {
>=20
> This line could be removed, because rte_free already do the check, see
> below:
> void rte_free(void *addr)
> {
>     if (addr =3D=3D NULL) return;
>     if (malloc_elem_free(malloc_elem_from_data(addr)) < 0)
>         rte_panic("Fatal error: Invalid memory\n"); }

Yes, it could be removed. Thanks.

>=20
> > +		rte_free(intr_handle->intr_vec);
> > +		intr_handle->intr_vec =3D NULL;
> > +	}
> >  }
> >
> >  static void