From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5980F8DAF for ; Tue, 22 Dec 2015 07:54:55 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 21 Dec 2015 22:54:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,463,1444719600"; d="scan'208";a="867049580" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 21 Dec 2015 22:54:54 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Dec 2015 22:54:54 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Dec 2015 22:54:53 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.190]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.28]) with mapi id 14.03.0248.002; Tue, 22 Dec 2015 14:54:52 +0800 From: "Qiu, Michael" To: "He, Shaopeng" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 3/6] fm10k: remove rx queue interrupts when dev stops Thread-Index: AQHRO9lGhKkDcc4aX0u8b7H26gePXg== Date: Tue, 22 Dec 2015 06:54:51 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622EFD10E@SHSMSX101.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> Accept-Language: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 06:54:55 -0000 On 12/21/2015 6:20 PM, Shaopeng He wrote:=0A= > Previous dev_stop function stops the rx/tx queues. This patch adds logic= =0A= > to disable rx queue interrupt, clean the datapath event and queue/vec map= .=0A= >=0A= > Signed-off-by: Shaopeng He =0A= > Acked-by: Jing Chen =0A= > ---=0A= > drivers/net/fm10k/fm10k_ethdev.c | 22 ++++++++++++++++++++++=0A= > 1 file changed, 22 insertions(+)=0A= >=0A= > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_e= thdev.c=0A= > index a34c5e2..b5b809c 100644=0A= > --- a/drivers/net/fm10k/fm10k_ethdev.c=0A= > +++ b/drivers/net/fm10k/fm10k_ethdev.c=0A= > @@ -1125,6 +1125,8 @@ fm10k_dev_start(struct rte_eth_dev *dev)=0A= > static void=0A= > fm10k_dev_stop(struct rte_eth_dev *dev)=0A= > {=0A= > + struct fm10k_hw *hw =3D FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private)= ;=0A= > + struct rte_intr_handle *intr_handle =3D &dev->pci_dev->intr_handle;=0A= > int i;=0A= > =0A= > PMD_INIT_FUNC_TRACE();=0A= > @@ -1136,6 +1138,26 @@ fm10k_dev_stop(struct rte_eth_dev *dev)=0A= > if (dev->data->rx_queues)=0A= > for (i =3D 0; i < dev->data->nb_rx_queues; i++)=0A= > fm10k_dev_rx_queue_stop(dev, i);=0A= > +=0A= > + /* Disable datapath event */=0A= > + if (rte_intr_dp_is_en(intr_handle)) {=0A= > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) {=0A= > + FM10K_WRITE_REG(hw, FM10K_RXINT(i),=0A= > + 3 << FM10K_RXINT_TIMER_SHIFT);=0A= > + if (hw->mac.type =3D=3D fm10k_mac_pf)=0A= > + FM10K_WRITE_REG(hw, FM10K_ITR(Q2V(dev, i)),=0A= > + FM10K_ITR_MASK_SET);=0A= > + else=0A= > + FM10K_WRITE_REG(hw, FM10K_VFITR(Q2V(dev, i)),=0A= > + FM10K_ITR_MASK_SET);=0A= > + }=0A= > + }=0A= > + /* Clean datapath event and queue/vec mapping */=0A= > + rte_intr_efd_disable(intr_handle);=0A= > + if (intr_handle->intr_vec !=3D NULL) {=0A= =0A= This line could be removed, because rte_free already do the check, see=0A= below:=0A= void rte_free(void *addr)=0A= {=0A= if (addr =3D=3D NULL) return;=0A= if (malloc_elem_free(malloc_elem_from_data(addr)) < 0)=0A= rte_panic("Fatal error: Invalid memory\n");=0A= }=0A= =0A= > + rte_free(intr_handle->intr_vec);=0A= > + intr_handle->intr_vec =3D NULL;=0A= > + }=0A= > }=0A= > =0A= > static void=0A= =0A=