Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3242727imc; Wed, 13 Mar 2019 12:31:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxK54w+/TjHOZQGKSRUfGeCC9X5YXNfoYiKo0jSEElRxAtDAj1F/muN7XJC/FTvp1D8q7zz X-Received: by 2002:a65:6105:: with SMTP id z5mr6683432pgu.434.1552505496551; Wed, 13 Mar 2019 12:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552505496; cv=none; d=google.com; s=arc-20160816; b=VhlMbMz89E88q1Hv7yWhhe4vYyykOd5xNN5iRd8UNPwko7uS2eicoSAyRX1Sj7U2ZQ OhjIswTC/wbCLoAnF7rdxrMzdsjrsdp/YpvXWJaWehIu4HV+3U3G0TGkMYdNLateAUm9 vy3L/XY30wA60Wh6fNcqtHdeb3i3Vu6XSCBQzqC0uLWcDX7O4U1YbXnbgkDnZK6yUmDS kyfHxHDrjFJ3mYOcfCPg1jZQBQhnLmUl3ctT1Jqiq25dB2ccsJn4391i+tzwkVnaTcK7 U6ENp4nYKfvYT9TqrfkWL+o2IIh2Ec7jxzU7D1+oTdYS+eEjLWQ0bbmZXjo5pXtVdlyy Knhg== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=NeyiifOyyO8agEbzzqZUrG34BP2UKbuEFBB7cEh8hdA=; b=uAYOFzLUJ3A7dViX2MSn9KEEvX3K5JIeishPT+DvgscWXn+n1c6mdGyGNOBFtsDASe MvPy+aUVXcn3wzJ9crpzEVPzI9gh+nwuRdvnK2NrRbCjUBKgWyU6I+RNNyyKqOjiH3nq ncWzATgCjfhKq+10a50iUf8D0pY8L010xBbTW+Er59a9nMe+bB7ZFLOy7QGDesRbY7ZL O4WhDQzTm8g8pvjF+0aspmvUw3OhPWEd+l+kqmwQ1QAmobloFwzKxUyYP93PLdsii5Pg IuMz5z+FGgdX4ePeL1eOoX0LTTetxq8r+oJvr8DCPxek2sWJuET8nXRDyR66sYgRzwLm s8FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1XcWOdQo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f24si10399096pgb.588.2019.03.13.12.31.19; Wed, 13 Mar 2019 12:31:36 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=1XcWOdQo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbfCMTa2 (ORCPT + 99 others); Wed, 13 Mar 2019 15:30:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:43072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbfCMTMa (ORCPT ); Wed, 13 Mar 2019 15:12:30 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C64120693; Wed, 13 Mar 2019 19:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552504349; bh=SALPzZm/TZcnXKplq4NQc7tLR9fCIbHzwonLaO/vXoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1XcWOdQop1eiskcc0h1/MkAqJTk2v2caxmRcFLkwemIV2QpM4Cit4gvpqm3ngKhv6 DcoQs0GRJmnOzWD/EEQd4d/XpFYnX2fNX1cVg58CasvDRk/DlQPTMsaVJB0i3hdE+o oVQoSUSjqfxbYCtWG/rLMCQ7YnmZJAKqTRX9qX9E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vadim Lomovtsev , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 52/60] net: thunderx: make CFG_DONE message to run through generic send-ack sequence Date: Wed, 13 Mar 2019 15:10:13 -0400 Message-Id: <20190313191021.158171-52-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190313191021.158171-1-sashal@kernel.org> References: <20190313191021.158171-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vadim Lomovtsev [ Upstream commit 0dd563b9a62c4cbabf5d4fd6596440c2491e72b1 ] At the end of NIC VF initialization VF sends CFG_DONE message to PF without using nicvf_msg_send_to_pf routine. This potentially could re-write data in mailbox. This commit is to implement common way of sending CFG_DONE message by the same way with other configuration messages by using nicvf_send_msg_to_pf() routine. Signed-off-by: Vadim Lomovtsev Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cavium/thunder/nic_main.c | 2 +- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c index 6c8dcb65ff03..90497a27df18 100644 --- a/drivers/net/ethernet/cavium/thunder/nic_main.c +++ b/drivers/net/ethernet/cavium/thunder/nic_main.c @@ -1039,7 +1039,7 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf) case NIC_MBOX_MSG_CFG_DONE: /* Last message of VF config msg sequence */ nic_enable_vf(nic, vf, true); - goto unlock; + break; case NIC_MBOX_MSG_SHUTDOWN: /* First msg in VF teardown sequence */ if (vf >= nic->num_vf_en) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 88f8a8fa93cd..4eb24e10ba4d 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -172,6 +172,17 @@ static int nicvf_check_pf_ready(struct nicvf *nic) return 1; } +static void nicvf_send_cfg_done(struct nicvf *nic) +{ + union nic_mbx mbx = {}; + + mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE; + if (nicvf_send_msg_to_pf(nic, &mbx)) { + netdev_err(nic->netdev, + "PF didn't respond to CFG DONE msg\n"); + } +} + static void nicvf_read_bgx_stats(struct nicvf *nic, struct bgx_stats_msg *bgx) { if (bgx->rx) @@ -1416,7 +1427,6 @@ int nicvf_open(struct net_device *netdev) struct nicvf *nic = netdev_priv(netdev); struct queue_set *qs = nic->qs; struct nicvf_cq_poll *cq_poll = NULL; - union nic_mbx mbx = {}; netif_carrier_off(netdev); @@ -1512,8 +1522,7 @@ int nicvf_open(struct net_device *netdev) nicvf_enable_intr(nic, NICVF_INTR_RBDR, qidx); /* Send VF config done msg to PF */ - mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE; - nicvf_write_to_mbx(nic, &mbx); + nicvf_send_cfg_done(nic); return 0; cleanup: -- 2.19.1