linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Lomovtsev <vlomovtsev@marvell.com>
To: "sgoutham@cavium.com" <sgoutham@cavium.com>,
	"sunil.kovvuri@gmail.com" <sunil.kovvuri@gmail.com>,
	"rric@kernel.org" <rric@kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "dnelson@redhat.com" <dnelson@redhat.com>,
	Vadim Lomovtsev <vlomovtsev@marvell.com>
Subject: [PATCH v3 3/8] net: thunderx: make CFG_DONE message to run through generic send-ack sequence
Date: Wed, 20 Feb 2019 11:02:43 +0000	[thread overview]
Message-ID: <20190220110225.9497-4-vlomovtsev@marvell.com> (raw)
In-Reply-To: <20190220110225.9497-1-vlomovtsev@marvell.com>

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 <vlomovtsev@marvell.com>
---
 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 abf24e7dff2d..19b58fc3ca41 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -169,6 +169,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 = {};
 
 	/* wait till all queued set_rx_mode tasks completes if any */
 	drain_workqueue(nic->nicvf_rx_mode_wq);
@@ -1515,8 +1525,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.17.2

  parent reply	other threads:[~2019-02-20 11:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 15:07 [PATCH 0/7] net: thunderx: implement DMAC filtering support Vadim Lomovtsev
2018-03-27 15:07 ` [PATCH 1/7] net: thunderx: move filter register related macro into proper place Vadim Lomovtsev
2018-03-27 15:07 ` [PATCH 2/7] net: thunderx: add MAC address filter tracking for LMAC Vadim Lomovtsev
2018-03-27 15:07 ` [PATCH 3/7] net: thunderx: add multicast filter management support Vadim Lomovtsev
2018-03-28 12:29   ` kbuild test robot
2018-03-27 15:07 ` [PATCH 4/7] net: thunderx: add new messages for handle ndo_set_rx_mode callback Vadim Lomovtsev
2018-03-27 15:07 ` [PATCH 5/7] net: thunderx: add XCAST messages handlers for PF Vadim Lomovtsev
2018-03-27 15:07 ` [PATCH 6/7] net: thunderx: add workqueue control structures for handle ndo_set_rx_mode request Vadim Lomovtsev
2018-03-27 15:07 ` [PATCH 7/7] net: thunderx: add ndo_set_rx_mode callback implementation for VF Vadim Lomovtsev
2018-03-27 17:28 ` [PATCH 0/7] net: thunderx: implement DMAC filtering support David Miller
2018-03-28  8:47   ` Vadim Lomovtsev
2018-03-30 11:59 ` [PATCH v2 " Vadim Lomovtsev
2018-03-30 11:59   ` [PATCH v2 1/7] net: thunderx: move filter register related macro into proper place Vadim Lomovtsev
2018-03-30 11:59   ` [PATCH v2 2/7] net: thunderx: add MAC address filter tracking for LMAC Vadim Lomovtsev
2018-03-30 11:59   ` [PATCH v2 3/7] net: thunderx: add multicast filter management support Vadim Lomovtsev
2018-03-30 11:59   ` [PATCH v2 4/7] net: thunderx: add new messages for handle ndo_set_rx_mode callback Vadim Lomovtsev
2018-03-30 11:59   ` [PATCH v2 5/7] net: thunderx: add XCAST messages handlers for PF Vadim Lomovtsev
2018-03-30 11:59   ` [PATCH v2 6/7] net: thunderx: add workqueue control structures for handle ndo_set_rx_mode request Vadim Lomovtsev
2018-03-30 11:59   ` [PATCH v2 7/7] net: thunderx: add ndo_set_rx_mode callback implementation for VF Vadim Lomovtsev
2018-04-01  2:07   ` [PATCH v2 0/7] net: thunderx: implement DMAC filtering support David Miller
2018-04-02 10:40     ` Vadim Lomovtsev
2019-02-20 11:02 ` [PATCH v3 0/8] nic: thunderx: fix communication races between VF & PF Vadim Lomovtsev
2019-02-20 11:02   ` [PATCH v3 1/8] net: thunderx: correct typo in macro name Vadim Lomovtsev
2019-02-20 11:02   ` [PATCH v3 2/8] net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs to private for each of them Vadim Lomovtsev
2019-02-20 11:02   ` Vadim Lomovtsev [this message]
2019-02-20 11:02   ` [PATCH v3 5/8] net: thunderx: rework xcast message structure to make it fit into 64 bit Vadim Lomovtsev
2019-02-20 11:02   ` [PATCH v3 6/8] net: thunderx: add mutex to protect mailbox from concurrent calls for same VF Vadim Lomovtsev
2019-02-20 11:02   ` [PATCH v3 4/8] net: thunderx: add nicvf_send_msg_to_pf result check for set_rx_mode_task Vadim Lomovtsev
2019-02-20 11:02   ` [PATCH v3 7/8] net: thunderx: move link state polling function to VF Vadim Lomovtsev
2019-02-20 11:02   ` [PATCH v3 8/8] net: thunderx: remove link change polling code and info from nicpf Vadim Lomovtsev
2019-02-20 11:19   ` [PATCH v3 0/8] nic: thunderx: fix communication races between VF & PF Vadim Lomovtsev
2019-02-22 19:44   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190220110225.9497-4-vlomovtsev@marvell.com \
    --to=vlomovtsev@marvell.com \
    --cc=davem@davemloft.net \
    --cc=dnelson@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rric@kernel.org \
    --cc=sgoutham@cavium.com \
    --cc=sunil.kovvuri@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).