From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <xiao.w.wang@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 806191B040
 for <dev@dpdk.org>; Mon,  8 Jan 2018 16:12:02 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 08 Jan 2018 07:12:01 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.46,330,1511856000"; d="scan'208";a="193134644"
Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203])
 by fmsmga005.fm.intel.com with ESMTP; 08 Jan 2018 07:12:01 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
 FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Mon, 8 Jan 2018 07:12:00 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by
 shsmsx102.ccr.corp.intel.com ([169.254.2.189]) with mapi id 14.03.0319.002;
 Mon, 8 Jan 2018 23:11:58 +0800
From: "Wang, Xiao W" <xiao.w.wang@intel.com>
To: Yuanhan Liu <yliu@fridaylinux.org>
CC: "Bie, Tiwei" <tiwei.bie@intel.com>, "dev@dpdk.org" <dev@dpdk.org>,
 "stephen@networkplumber.org" <stephen@networkplumber.org>
Thread-Topic: [PATCH v6 2/3] net/virtio: add packet injection method
Thread-Index: AQHTh2fH1krhAZUhnkW98xT0UcktDaNpbUEAgACebSA=
Date: Mon, 8 Jan 2018 15:11:58 +0000
Message-ID: <B7F2E978279D1D49A3034B7786DACF406F809DA4@SHSMSX101.ccr.corp.intel.com>
References: <20180107120513.142196-1-xiao.w.wang@intel.com>
 <20180107120513.142196-3-xiao.w.wang@intel.com>
 <20180108130334.GN8818@yliu-mob>
In-Reply-To: <20180108130334.GN8818@yliu-mob>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ctpclassification: CTP_NT
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTZjMWVkMGEtMjYzOC00MzVjLWEwNDItNTgzNTFlZmZlYjI5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ2TkNlQmM0VHBFWk8xWTVHanBQY0tKQXkwWTRWc1RVdDRXOTdMcG5tU2N1MlJIakFRbWF1TzlqR1phbTZVbFcrIn0=
dlp-product: dlpe-windows
dlp-version: 11.0.0.116
dlp-reaction: no-action
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 v6 2/3] net/virtio: add packet injection
	method
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: Mon, 08 Jan 2018 15:12:02 -0000



> -----Original Message-----
> From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> Sent: Monday, January 8, 2018 9:04 PM
> To: Wang, Xiao W <xiao.w.wang@intel.com>
> Cc: Bie, Tiwei <tiwei.bie@intel.com>; dev@dpdk.org;
> stephen@networkplumber.org
> Subject: Re: [PATCH v6 2/3] net/virtio: add packet injection method
>=20
> On Sun, Jan 07, 2018 at 04:05:12AM -0800, Xiao Wang wrote:
> > +	/*
> > +	 * App management thread and virtio interrupt handler thread
> > +	 * both can change the 'started' flag, this lock is meant to
> > +	 * avoid such a contention.
> > +	 */
> > +	rte_spinlock_t state_lock;
>=20
> Why not turning the "started" to atomic type, so that you don't need
> the lock?
>=20
> 	--yliu

To avoid impacting datapath performance, this patch doesn't change "started=
" to atomic=20
type.

During the interrupt handler routine, there are a series of instructions be=
tween lock acquire and release. An atomic value is not suitable for this sc=
enario.

BRs,
Xiao