Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119AbdLLG3U (ORCPT ); Tue, 12 Dec 2017 01:29:20 -0500 Received: from mail-cys01nam02on0045.outbound.protection.outlook.com ([104.47.37.45]:34863 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750749AbdLLG3Q (ORCPT ); Tue, 12 Dec 2017 01:29:16 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=George.Cherian@cavium.com; Subject: Re: [PATCH] ptr_ring: add barriers To: David Miller , mst@redhat.com Cc: linux-kernel@vger.kernel.org, george.cherian@cavium.com, jasowang@redhat.com, edumazet@google.com, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org References: <1512501990-30029-1-git-send-email-mst@redhat.com> <20171211.105308.1899676147655539775.davem@davemloft.net> From: George Cherian Message-ID: <93ed1559-74d4-d72f-0969-12bfaf370cc1@caviumnetworks.com> Date: Tue, 12 Dec 2017 11:58:52 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171211.105308.1899676147655539775.davem@davemloft.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR0101CA0066.INDPRD01.PROD.OUTLOOK.COM (10.174.220.156) To BLUPR0701MB1699.namprd07.prod.outlook.com (10.163.85.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12d7e249-ca06-40a2-a243-08d54129a982 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:BLUPR0701MB1699; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1699;3:0524isjZQjGHF74f+VsuIT0ynT3Q4LsaJ+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UPHh6UrWGxgH0+zfP3Dn3gtdkIHYCOAP+FSgUpCeNgxHIt0CY08Ch9Bzm4ob20BsC9SC9f6aFfLOgChJwA4/vGLNF8txo11b+NH+HjQ8TaAKxuUlp7jhXqL0O5bw6zvExpgcRY0YswkLw51FXyLd2T53mrn+PDThcL601HV3d9gsjXsWkq9TTeznq/pK0sQ77muPjU8RvL4H27wKEg4mMWLbtPfW0s0AZUav528s7ZBS8m9cwyLV+rTgvGPXtRmB0rdab1AuaVadOxbMPB8NnJKc1KmXeW8Agos9xDL4/EN4XIUY+jvOUtUIKjN3DzLJiFrm9Ozxz7FuAFerBqvW/VlpZhPixn45X4ZTXyZKeOX0Ozyu/9nlmR5uk67y3+BCZJmFuMosMQk6DGfwwExcSMUSJOe7IrYHBoY4bYvUGYPDLcMEoGmaj80=;4:do448TKTfL+wP5NlBJ179StqoUaKDxKnHlht6tUtIEAHAetOtOmjsXcE3xCmbmLEQHZ+6BABljPU7H5XNfwYu4Mg0uXmodSHBg2mhytDnfjCGafnl70OHNbCDOCcv87xt9Fph54bo56O9IIXjctrAVmTqG8pq8+zAvpYHA3fDRGWvUxVwSvc7aOVRC45dzVzvmVMfoOjzj62+iTznzGc7sX8Vhye63T3ZOnettFxT0hAIprEkKvQLP3mVAf1Bm3L/NgE33PU23Tfni269T1dNA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231023)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BLUPR0701MB1699;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BLUPR0701MB1699; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(346002)(366004)(376002)(189003)(199004)(24454002)(65956001)(66066001)(2950100002)(81166006)(81156014)(31686004)(25786009)(68736007)(2906002)(6246003)(5660300001)(72206003)(478600001)(305945005)(42882006)(65806001)(4326008)(8936002)(7736002)(53936002)(65826007)(6666003)(31696002)(53546010)(64126003)(316002)(230700001)(229853002)(106356001)(67846002)(50466002)(47776003)(36756003)(52146003)(16576012)(97736004)(83506002)(58126008)(6116002)(3846002)(16526018)(2486003)(5009440100003)(90366009)(52116002)(105586002)(59450400001)(23676004)(77096006)(8676002)(6486002)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1699;H:[10.167.103.249];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjA3MDFNQjE2OTk7MjM6amE5d0JpU1pvM1pZdlo1Q0xTaGtLbTYr?= =?utf-8?B?dVNqN3F4bDJxK3VGSnZTb3Y1VlFjc1dJYnUwOVZ2UUJBOGFuZHk5eGpLZTJE?= =?utf-8?B?QklFb2lSV1hsRFZSVnZpRGdBbjRlSTZUR0t6b25lNEd2dkxjeVdqWjB1bEpq?= =?utf-8?B?ZnllOHFTWnIrejBMSmo3UFBRRU9UbkdEK0pNdmI4KytXRWlYY21TTnpxdm0x?= =?utf-8?B?TlQ2cEs0MVl3NWhxdjN5emgxNDk1ck5mTmVTRFEzaWtuU0FKaG11TVhaQ01Y?= =?utf-8?B?Rkx3WG5TbkhJK0thcUpQSkR0WWlrdGxNZWhxTDBYTm9WUXVBWUtMMFN6dUdu?= =?utf-8?B?RWVjZlpxMlRTdFFDa2VnRHljc3VqNHk5a0MyRWdBRFN4cUsyRTBFUFRqV0Vi?= =?utf-8?B?VUN3aDZZZWVTaWhzbWEwOVJIeERlQTZ1THBPZkQwRy9TeHpibkV5cmVwM2VK?= =?utf-8?B?Ymp0V0tTWEZ1aU5ua29CS1lHWXdoc29BdlFDcFZpazBDRGE1aXNPdkpIdFBW?= =?utf-8?B?aCtkOW56OG5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att6DZszU2zJ/w6RhSVfYKT4KFQ=;24:dOl6HBdPJ6LrTeaStKMFowIJuaLY8aXLSh/aKG8Tgkw5TXntnL0nt6JmXU/hBR0YDlgOWdUY8MC5RLsJs324ip5Ql86H360Eg6xjsZagRW8=;7:9uisiMVmo9UQzvFY0+DoMaJxMzgR0V1EPG/XzjzLFPWmjEDn1iCAK7lssV/+zXO+HZpibqSg8fY7dFuqCNYMGxDPOHcH9uLeqOHlYtiShRGUdk8JVQtTpAEgH7rHnuELPERoO6/zkskqmqmcth9LLyvO32vDNQreSg7voiJBpLvwfXCHx4MbjWPwJrhGAPWGpCUfi342qTX10dvy2GO21NBJ6CWwGIFcnepEZM9Hwlq/GtHuFJ+LMBsHuXKNXS02 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 06:29:11.2730 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12d7e249-ca06-40a2-a243-08d54129a982 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1699 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1247 Lines: 36 Hi David, On 12/11/2017 09:23 PM, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Tue, 5 Dec 2017 21:29:37 +0200 > >> Users of ptr_ring expect that it's safe to give the >> data structure a pointer and have it be available >> to consumers, but that actually requires an smb_wmb >> or a stronger barrier. >> >> In absence of such barriers and on architectures that reorder writes, >> consumer might read an un=initialized value from an skb pointer stored >> in the skb array. This was observed causing crashes. >> >> To fix, add memory barriers. The barrier we use is a wmb, the >> assumption being that producers do not need to read the value so we do >> not need to order these reads. >> >> Reported-by: George Cherian >> Suggested-by: Jason Wang >> Signed-off-by: Michael S. Tsirkin > > I'm asked for asking for testing feedback and did not get it in a > reasonable amount of time. > The tests have completed more than 48 hours without any failures. I won't interrupt the same and run for longer time. In case of any issue I will report the same. > So I'm applying this as-is, and queueing it up for -stable. > > Thank you. Regards, -George >