From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80070.outbound.protection.outlook.com [40.107.8.70]) by dpdk.org (Postfix) with ESMTP id 18CE93250 for ; Tue, 28 Aug 2018 21:30:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rT04N8ZRtmI6e5aJ6EE+4nmlzn1JSrKRjNmdj4t4P88=; b=FnyrrIUgfcPdL+KIhwR8FdpMIGMKxi0mbpXAOK1Bsq7TyO7w1G1OMb2N8JR3CAWKx/WHmnvLGXf0UOFCR2cC+ZepY/TUrnah+8zTPB3H0RKOfxjMTOv47muim8NKyJZf4rDMBb0ZLh8OGDOdmwEH9+YL5Hd0H+UKit5TNYTL/wI= Received: from VI1PR08MB3167.eurprd08.prod.outlook.com (52.133.15.142) by VI1PR08MB0381.eurprd08.prod.outlook.com (10.162.12.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Tue, 28 Aug 2018 19:30:54 +0000 Received: from VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::184d:ac38:254f:3a45]) by VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::184d:ac38:254f:3a45%2]) with mapi id 15.20.1080.015; Tue, 28 Aug 2018 19:30:54 +0000 From: Gavin Hu To: "Kokkilagadda, Kiran" , Ferruh Yigit , "Jacob, Jerin" CC: "dev@dpdk.org" , Honnappa Nagarahalli , nd , Ola Liljedahl , Steve Capper Thread-Topic: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization Thread-Index: AQHUNUdKDAxxlajx7EqxtswFT/Xr1aTTtAyAgAAZYECAAUATgIAAj0wg Date: Tue, 28 Aug 2018 19:30:54 +0000 Message-ID: References: <1533810233-7706-1-git-send-email-kkokkilagadda@caviumnetworks.com> <1534413317-644-1-git-send-email-kkokkilagadda@caviumnetworks.com> <649064d2-430c-d761-44ce-453e1a14031a@intel.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR08MB0381; 6:FrP55zm0Wj+sglhITPkYtmbcw7oab1dBF8wL6SSLhpi4hxN3BY4xiUK/YkwDgBkajMO1ofZhUm+mYktWKlgPK9fXcM/YmF79+78UxMvbciUK7opnjnL5+dRBKWDPEFs67PW2y1MsuEcXZym3IXLBN8p5EJDW957pkzygpWcbmEYE3KKJMHUCxqfuQTEI5DMjO9uwgMTBYGl/ZvXOztjvrzw5RqBAgS4FdM3xxH13HpZS5CDyAhbNQRjMm5cvqto4EuM4dNGsc5LQ6Oex697Tj7nzAnpcfGM6JgygIGXBBDnlVnitHrz/vYC3y4Zwwg+ZH5N12N71LWvQzXsbC5+INjWOXYtpw3UJyBhWkLD05u5egVo7FOtnJ2Wx1heKaEjz6jlVKCFfYvBaXQ74AASODoi+8qkspyggB7PvjVxp85sgeSwUtgaqLb7SiM9j4x3Xsk3LEPq9sT5I0qBYKndrnA==; 5:t6B6DdpPu866DIwtjGyvhpdZhtd/PInLbSLi26klmR6RO0+iiTvmWw6VxMYIxaNcv6+ec+nWbndG7vCMLfAPT9XA3j/2+iu3fRs4CPJVYtA9MIkYQVN2b1vu+8y7DTbydLgiGkMNB8DAJPE6GPOLVfIma0QJRX0CMLhxuhSOhXc=; 7:D2+YipN3iJF6QPzK3GzANBGEUHPm+TL//70wTs+VGSdGInS3KT9lGC+SqAfP/a9ZNoDq9ALfd1yFVyBA7ocqs4WHylHPC11DZAW1uh+9M2VrBP7jcaOE4I/TyL1iPrO0bVOOwsjA9vTtLyoHCfYvykEW1TAs2AkTj/tfnqGpSXBcUrgFn+b2JNMkCY3RkqxA19cnWj0b4wdO1ZvfFrD8xFT7DrKOwpRqHq7ZtF5h1kXdXFbJ91xv//jUDHdA7Huq x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: 49fbd033-3862-485d-f336-08d60d1cc592 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB0381; x-ms-traffictypediagnostic: VI1PR08MB0381: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(21748063052155)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(10201501046)(93006095)(93001095)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699016); SRVR:VI1PR08MB0381; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB0381; x-forefront-prvs: 077884B8B5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(396003)(39860400002)(366004)(13464003)(40434004)(189003)(199004)(5024004)(256004)(74316002)(54906003)(66066001)(2906002)(8676002)(76176011)(7696005)(110136005)(4326008)(99286004)(316002)(25786009)(93886005)(14444005)(7736002)(6246003)(81166006)(81156014)(9686003)(6306002)(14454004)(54896002)(8936002)(5250100002)(106356001)(97736004)(105586002)(2900100001)(55016002)(236005)(478600001)(72206003)(486006)(6116002)(790700001)(86362001)(186003)(53936002)(68736007)(446003)(55236004)(6436002)(3846002)(476003)(33656002)(229853002)(6506007)(5660300001)(26005)(53546011)(102836004)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB0381; H:VI1PR08MB3167.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: hafd2cUV1MVtLDhe21fK5GgDQJimS2JnVeIw7GsTcJAx15NAkg5ZILBjBLud81gjPsXd9W0ioTmjamQKKDItcn0+ouH6jQH2F2spblJnFydQ6uOoK1FvVHat0hCdqslrFFb6S3y2WhZSmZSly8FOSGt2GyQ/YuGmgoE1P5aAmP/Ux/RHTQyIFl5D9xk25du3WrYDD52IujlItAJn1QuBNGl+3aUCLwNj508DL8qiX0Kzb39ZoneZWI5tfUhO8cl9rCSiL4JC9KPwfb3AskWub8CMXeGJZcJk57eKSg2XgH5zRWD9hxxUceOplmiPceowQULnnpWgX5cJWcg9HHWGxiLu2JHMeLx+axXstYHPLmU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49fbd033-3862-485d-f336-08d60d1cc592 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Aug 2018 19:30:54.3085 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0381 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2018 19:30:57 -0000 Assuming reader and writer may execute on different CPU's, this become stan= dard multithreaded programming. We are concerned about that update the reader pointer too early(weak orderi= ng may reorder it before reading from the slots), that means the slots are = released and may immediately overwritten by the writer then you get "too ne= w" data and get lost of the old data. From: Kokkilagadda, Kiran Sent: Tuesday, August 28, 2018 6:44 PM To: Gavin Hu ; Ferruh Yigit ; Jac= ob, Jerin Cc: dev@dpdk.org; Honnappa Nagarahalli Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchroniz= ation In this instance there won't be any problem, as until the value of fifo->wr= ite changes, this loop won't get executed. As of now we didn't see any issu= e with it and for performance reasons, we don't want to keep read barrier. ________________________________ From: Gavin Hu > Sent: Monday, August 27, 2018 9:10 PM To: Ferruh Yigit; Kokkilagadda, Kiran; Jacob, Jerin Cc: dev@dpdk.org; Honnappa Nagarahalli Subject: RE: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchroniz= ation External Email This fix is not complete, kni_fifo_get requires a read fence also, otherwis= e it probably gets stale data on a weak ordering platform. > -----Original Message----- > From: dev > On Behalf O= f Ferruh Yigit > Sent: Monday, August 27, 2018 10:08 PM > To: Kiran Kumar >; > jerin.jacob@caviumnetworks.com > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer > synchronization > > On 8/16/2018 10:55 AM, Kiran Kumar wrote: > > With existing code in kni_fifo_put, rx_q values are not being updated > > before updating fifo_write. While reading rx_q in kni_net_rx_normal, > > This is causing the sync issue on other core. So adding a write > > barrier to make sure the values being synced before updating fifo_write= . > > > > Fixes: 3fc5ca2f6352 ("kni: initial import") > > > > Signed-off-by: Kiran Kumar > > > Acked-by: Jerin Jacob > > > Acked-by: Ferruh Yigit > IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.