From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2CD6C43381 for ; Fri, 22 Feb 2019 19:44:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB077206C0 for ; Fri, 22 Feb 2019 19:44:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EILh0Zp7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB077206C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=davemloft.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: From:Subject:To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wwpuEyLbONJyJMIMNkhikYAVcyHJQ9witmEVV1/laIc=; b=EILh0Zp73ALwlK kiJjUZO70hQbys5CqaoVWf0s3LHlMloZyOL/jFkInxTGj2ZeIt9pPDkI3q5WhQlkFeyL1mCwgC7Am 8MsmpPEuXMFnfIOKxfS2Cn1+w84HsKM5ocyKh/jJdILOs2I6vMPUYEBW8aSCi6629HFE0+597WEdV Xf1iy60Ta0m5nqi29ZYH7fG2BYxTv7eCFkWk63erzVYQLWNIiYyUgQcug+23FEF3XY09ZPkMhFK+7 bJFyzXMV7otS4uD/NMHDDLtxJVEfmcZJxoXB2egifbdvuxaH5YXctUa8u71UWiBtDBhCQXTiLz6wq 7oNf+zFh6XKrb+4dk5WQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxGkb-0007gX-Pz; Fri, 22 Feb 2019 19:44:49 +0000 Received: from shards.monkeyblade.net ([2620:137:e000::1:9]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxGkX-0007g8-Qq for linux-arm-kernel@lists.infradead.org; Fri, 22 Feb 2019 19:44:47 +0000 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id BE2E414A86563; Fri, 22 Feb 2019 11:44:38 -0800 (PST) Date: Fri, 22 Feb 2019 11:44:38 -0800 (PST) Message-Id: <20190222.114438.657594655581302475.davem@davemloft.net> To: vlomovtsev@marvell.com Subject: Re: [PATCH v3 0/8] nic: thunderx: fix communication races between VF & PF From: David Miller In-Reply-To: <20190220110225.9497-1-vlomovtsev@marvell.com> References: <20180327150736.10718-1-Vadim.Lomovtsev@caviumnetworks.com> <20190220110225.9497-1-vlomovtsev@marvell.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 22 Feb 2019 11:44:39 -0800 (PST) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190222_114445_865802_9646927A X-CRM114-Status: GOOD ( 11.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunil.kovvuri@gmail.com, rric@kernel.org, netdev@vger.kernel.org, dnelson@redhat.com, linux-kernel@vger.kernel.org, sgoutham@cavium.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Vadim Lomovtsev Date: Wed, 20 Feb 2019 11:02:42 +0000 > The ThunderX CN88XX NIC Virtual Function driver uses mailbox interface > to communicate to physical function driver. Each of VF has it's own pair > of mailbox registers to read from and write to. The mailbox registers > has no protection from possible races, so it has to be implemented > at software side. > > After long term testing by loop of 'ip link set up/down' > command it was found that there are two possible scenarios when > race condition appears: > 1. VF receives link change message from PF and VF send RX mode > configuration message to PF in the same time from separate thread. > 2. PF receives RX mode configuration from VF and in the same time, > in separate thread PF detects link status change and sends appropriate > message to particular VF. > > Both cases leads to mailbox data to be rewritten, NIC VF messaging control > data to be updated incorrectly and communication sequence gets broken. > > This patch series is to address race condition with VF & PF communication. > > Changes: > v1 -> v2 > - 0000: correct typo in cover letter subject: 'betwen' -> 'between'; > - move link state polling request task from pf to vf > instead of cheking status of mailbox irq; > v2 -> v3 > - 0003: change return type of nicvf_send_cfg_done() function > from int to void; > - 0007: update subject and remove unused variable 'netdev' > from nicvf_link_status_check_task() function; Series applied, thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel