Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp1817055imc; Fri, 22 Feb 2019 11:45:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IYVjJhj/NQzW2nUIitSfNo22oDte74wMGT/MPBqkfijTNAEiVWU3PEeADlmWO7MPBWgWriq X-Received: by 2002:a62:b40b:: with SMTP id h11mr5814561pfn.108.1550864717943; Fri, 22 Feb 2019 11:45:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550864717; cv=none; d=google.com; s=arc-20160816; b=tQRKyw2DmrRlxwoDWKAuN514vE6DCYZ44aAwrmKF7Jb3z5Q8bjSmOzIGIwM0WI93iz e+qsKtjZfd23Y9ImVZIo2l2COd5VOJlBlXvB9MuAFjBZDJoSqTsaF9SFuVlMGCHRCzJ7 Vyb/HaAKWfW1xlZ3ezf4pqZD/gj0TkYXKg2d5Ls3lb6fc9BG1AX+2Dt1zOMIsOPS+HSX AOkyaveZEXkZW9DTa2YTrG3WKxEpqODmKOjLW9Hgu2vfR9Wxj0weiPhFz9fqalD0faFh tn4NaNdv10ysJhtXsTqHeb6BhhbOr5ZX424iyW4agF9c4SjtA2RP1zo0XIHSqc8okMwZ LZhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=y1JCgFSCD63OTAwi+F7/gjCLNHnCujk67TOui9CxHuw=; b=1IzaJ5yvoga3Yj7mg4ffpAGcKdMdGWNaXYh8PoEVgsSc6dklDcrGiUSEFK5MnbwGu9 62kAPscwe2FqPRf87zl4YjOuEELWFf9x2TIld4jo4I44KwQwdL/rkXNpdFz5HObx4fJZ PmK8eo2/nsITFfTGFHyUDHCM6vPMoQGePCpqtGaJD+Q4BHoeUQw9KQEY9yB5YuB+/GGF XTv7imnCaqvQOxgxL6IfB/AUaKJwnF+I9C3J8xMFfNm567hYnCVqvMC9rXOuw/e4cAe0 n7iNDKdlD6cCAKRCf11gT9fCRJm6z+ZQZMA60Pu9n043tSiyZswBbQ9WEni5/7b8fFeM oH+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si2164424pft.132.2019.02.22.11.45.02; Fri, 22 Feb 2019 11:45:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbfBVTok (ORCPT + 99 others); Fri, 22 Feb 2019 14:44:40 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:57082 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfBVToj (ORCPT ); Fri, 22 Feb 2019 14:44:39 -0500 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 Cc: sgoutham@cavium.com, sunil.kovvuri@gmail.com, rric@kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dnelson@redhat.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 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.