lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 061/183] net: thunderx: make CFG_DONE message to run through generic send-ack sequence
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    [ 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 <vlomovtsev@marvell.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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 d89ec4724efd..819f38a3225d 100644
    --- a/drivers/net/ethernet/cavium/thunder/nic_main.c
    +++ b/drivers/net/ethernet/cavium/thunder/nic_main.c
    @@ -1030,7 +1030,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 f13256af8031..59b62b49ad48 100644
    --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
    +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
    @@ -166,6 +166,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)
    @@ -1329,7 +1340,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);

    @@ -1419,8 +1429,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


    \
     
     \ /
      Last update: 2019-03-22 13:56    [W:5.741 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site