From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wei.dai@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 96141728E
 for <dev@dpdk.org>; Fri, 12 Jan 2018 13:10:26 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 12 Jan 2018 04:10:25 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.46,348,1511856000"; 
   d="scan'208";a="9087289"
Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80])
 by fmsmga007.fm.intel.com with ESMTP; 12 Jan 2018 04:10:24 -0800
Received: from pgsmsx112.gar.corp.intel.com ([169.254.3.86]) by
 PGSMSX102.gar.corp.intel.com ([169.254.6.144]) with mapi id 14.03.0319.002;
 Fri, 12 Jan 2018 20:10:23 +0800
From: "Dai, Wei" <wei.dai@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>, Tonghao Zhang
 <xiangxia.m.yue@gmail.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH 4/5] net/ixgbevf: add check for
 rte_intr_enable.
Thread-Index: AQHThi9Gtb0ig0pXM0CoEcylVDPjcKNtwtmAgAJsXNA=
Date: Fri, 12 Jan 2018 12:10:22 +0000
Message-ID: <49759EB36A64CF4892C1AFEC9231E8D66CF21CE1@PGSMSX112.gar.corp.intel.com>
References: <1515161439-4792-1-git-send-email-xiangxia.m.yue@gmail.com>
 <1515161439-4792-4-git-send-email-xiangxia.m.yue@gmail.com>
 <94479800C636CB44BD422CB454846E013208AC68@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <94479800C636CB44BD422CB454846E013208AC68@SHSMSX101.ccr.corp.intel.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzNhMzExNDctYjYzYS00MzY5LTkxZTYtNGM3YmUzNTllNjNiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkpVc0laeWVDd1BDdGwwWnZMVjBOV29kVFJTaU9wbkQwNEFJNVJqWHdxT3c9In0=
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.0.0.116
dlp-reaction: no-action
x-originating-ip: [172.30.20.205]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH 4/5] net/ixgbevf: add check for
 rte_intr_enable.
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://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: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 12 Jan 2018 12:10:27 -0000

Hi, Tonghao
Thanks for your patch.
It looks that same change can be applied to ixgbe_dev_interrupt_action( )
and ixgbe_dev_interrupt_delayed_handler( ).
Anyway, you can test all these changes with example/l3fwd-power.=20
-Wei

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xing, Beilei
> Sent: Thursday, January 11, 2018 3:06 PM
> To: Tonghao Zhang <xiangxia.m.yue@gmail.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 4/5] net/ixgbevf: add check for
> rte_intr_enable.
>=20
>=20
>=20
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tonghao Zhang
> > Sent: Friday, January 5, 2018 10:11 PM
> > To: dev@dpdk.org
> > Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > Subject: [dpdk-dev] [PATCH 4/5] net/ixgbevf: add check for
> rte_intr_enable.
>=20
> The patch is not only for ixgbevf, but also for ixgbe, right?
> so how about changing the title with net/ixgbe started?
>=20
> > When we bind the ixgbevf to vfio and call the
> > rte_eth_dev_rx_intr_enable and rte_eth_dev_rx_intr_disable frequently,
> > the interrupt setting
> > (msi_set_mask_bit) will take more CPU as show below. rte_intr_enable
> > call the ioctl to map the fd to interrupts frequently.
> >
> > perf top:
> > 5.45%  [kernel]   [k] msi_set_mask_bit
> >
> > It is unnecessary to call the rte_intr_enable in
> > ixgbe_dev_rx_queue_intr_enable. because the fds has been mapped to
> > interrupt and not unmapped in ixgbe_dev_rx_queue_intr_disable.
> >
> > This patch add checks for using VFIO.  With the patch,
> > msi_set_mask_bit is not listed in perl any more. Any suggestion will be
> welcome.
> >
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index e929235..79e4097 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -5610,7 +5610,9 @@ static void ixgbevf_set_vfta_all(struct
> > rte_eth_dev *dev, bool on)
> >  	RTE_SET_USED(queue_id);
> >  	IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, intr->mask);
> >
> > -	rte_intr_enable(intr_handle);
> > +	if (intr_handle->type =3D=3D RTE_INTR_HANDLE_UIO ||
> > +	    intr_handle->type =3D=3D RTE_INTR_HANDLE_UIO_INTX)
> > +		rte_intr_enable(intr_handle);
>=20
> For igb_uio, did you check if it's necessary to call rte_intr_enable ever=
y time?
> Since rte interrupt is not disabled during ixgbevf_dev_rx_queue_intr_disa=
ble.
>=20
> >
> >  	return 0;
> >  }
> > @@ -5659,7 +5661,10 @@ static void ixgbevf_set_vfta_all(struct
> > rte_eth_dev *dev, bool on)
> >  		mask &=3D (1 << (queue_id - 32));
> >  		IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask);
> >  	}
> > -	rte_intr_enable(intr_handle);
> > +
> > +	if (intr_handle->type =3D=3D RTE_INTR_HANDLE_UIO ||
> > +	    intr_handle->type =3D=3D RTE_INTR_HANDLE_UIO_INTX)
> > +		rte_intr_enable(intr_handle);
>=20
> The same comment as above.
>=20
> >
> >  	return 0;
> >  }
> > --
> > 1.8.3.1