mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
net: thunderx: make CFG_DONE message to run through generic send-ack sequence
[ Upstream commit 0dd563b9a6 ]
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
02f8211b75
commit
17bc53e73d
@@ -1039,7 +1039,7 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf)
|
|||||||
case NIC_MBOX_MSG_CFG_DONE:
|
case NIC_MBOX_MSG_CFG_DONE:
|
||||||
/* Last message of VF config msg sequence */
|
/* Last message of VF config msg sequence */
|
||||||
nic_enable_vf(nic, vf, true);
|
nic_enable_vf(nic, vf, true);
|
||||||
goto unlock;
|
break;
|
||||||
case NIC_MBOX_MSG_SHUTDOWN:
|
case NIC_MBOX_MSG_SHUTDOWN:
|
||||||
/* First msg in VF teardown sequence */
|
/* First msg in VF teardown sequence */
|
||||||
if (vf >= nic->num_vf_en)
|
if (vf >= nic->num_vf_en)
|
||||||
|
|||||||
@@ -172,6 +172,17 @@ static int nicvf_check_pf_ready(struct nicvf *nic)
|
|||||||
return 1;
|
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)
|
static void nicvf_read_bgx_stats(struct nicvf *nic, struct bgx_stats_msg *bgx)
|
||||||
{
|
{
|
||||||
if (bgx->rx)
|
if (bgx->rx)
|
||||||
@@ -1416,7 +1427,6 @@ int nicvf_open(struct net_device *netdev)
|
|||||||
struct nicvf *nic = netdev_priv(netdev);
|
struct nicvf *nic = netdev_priv(netdev);
|
||||||
struct queue_set *qs = nic->qs;
|
struct queue_set *qs = nic->qs;
|
||||||
struct nicvf_cq_poll *cq_poll = NULL;
|
struct nicvf_cq_poll *cq_poll = NULL;
|
||||||
union nic_mbx mbx = {};
|
|
||||||
|
|
||||||
netif_carrier_off(netdev);
|
netif_carrier_off(netdev);
|
||||||
|
|
||||||
@@ -1512,8 +1522,7 @@ int nicvf_open(struct net_device *netdev)
|
|||||||
nicvf_enable_intr(nic, NICVF_INTR_RBDR, qidx);
|
nicvf_enable_intr(nic, NICVF_INTR_RBDR, qidx);
|
||||||
|
|
||||||
/* Send VF config done msg to PF */
|
/* Send VF config done msg to PF */
|
||||||
mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE;
|
nicvf_send_cfg_done(nic);
|
||||||
nicvf_write_to_mbx(nic, &mbx);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|||||||
Reference in New Issue
Block a user