diff options
author | Radoslaw Biernacki <rad@semihalf.com> | 2016-08-12 07:21:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-13 14:59:32 -0400 |
commit | ecae29cb15c1a9502bb24f44ff9b84075c0b1dcd (patch) | |
tree | 70b7278d3a54c82bdb4db148e84db996c436691b /drivers/net/ethernet/cavium/thunder/nic_main.c | |
parent | a8671acca87267ad8b583b6e5cf9f6bcb09ff77a (diff) |
net: thunderx: Improvement for MBX interface debug messages
Adding debug messages in case of NACK for a mailbox message, also
did small cleanups.
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder/nic_main.c')
-rw-r--r-- | drivers/net/ethernet/cavium/thunder/nic_main.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c index b982e5ff7bbe..c706b2e31598 100644 --- a/drivers/net/ethernet/cavium/thunder/nic_main.c +++ b/drivers/net/ethernet/cavium/thunder/nic_main.c | |||
@@ -831,7 +831,7 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf) | |||
831 | mbx_addr += sizeof(u64); | 831 | mbx_addr += sizeof(u64); |
832 | } | 832 | } |
833 | 833 | ||
834 | dev_dbg(&nic->pdev->dev, "%s: Mailbox msg %d from VF%d\n", | 834 | dev_dbg(&nic->pdev->dev, "%s: Mailbox msg 0x%02x from VF%d\n", |
835 | __func__, mbx.msg.msg, vf); | 835 | __func__, mbx.msg.msg, vf); |
836 | switch (mbx.msg.msg) { | 836 | switch (mbx.msg.msg) { |
837 | case NIC_MBOX_MSG_READY: | 837 | case NIC_MBOX_MSG_READY: |
@@ -841,8 +841,7 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf) | |||
841 | nic->duplex[vf] = 0; | 841 | nic->duplex[vf] = 0; |
842 | nic->speed[vf] = 0; | 842 | nic->speed[vf] = 0; |
843 | } | 843 | } |
844 | ret = 1; | 844 | goto unlock; |
845 | break; | ||
846 | case NIC_MBOX_MSG_QS_CFG: | 845 | case NIC_MBOX_MSG_QS_CFG: |
847 | reg_addr = NIC_PF_QSET_0_127_CFG | | 846 | reg_addr = NIC_PF_QSET_0_127_CFG | |
848 | (mbx.qs.num << NIC_QS_ID_SHIFT); | 847 | (mbx.qs.num << NIC_QS_ID_SHIFT); |
@@ -891,8 +890,10 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf) | |||
891 | nic_tx_channel_cfg(nic, mbx.qs.num, &mbx.sq); | 890 | nic_tx_channel_cfg(nic, mbx.qs.num, &mbx.sq); |
892 | break; | 891 | break; |
893 | case NIC_MBOX_MSG_SET_MAC: | 892 | case NIC_MBOX_MSG_SET_MAC: |
894 | if (vf >= nic->num_vf_en) | 893 | if (vf >= nic->num_vf_en) { |
894 | ret = -1; /* NACK */ | ||
895 | break; | 895 | break; |
896 | } | ||
896 | lmac = mbx.mac.vf_id; | 897 | lmac = mbx.mac.vf_id; |
897 | bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]); | 898 | bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]); |
898 | lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]); | 899 | lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]); |
@@ -947,10 +948,13 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf) | |||
947 | break; | 948 | break; |
948 | } | 949 | } |
949 | 950 | ||
950 | if (!ret) | 951 | if (!ret) { |
951 | nic_mbx_send_ack(nic, vf); | 952 | nic_mbx_send_ack(nic, vf); |
952 | else if (mbx.msg.msg != NIC_MBOX_MSG_READY) | 953 | } else if (mbx.msg.msg != NIC_MBOX_MSG_READY) { |
954 | dev_err(&nic->pdev->dev, "NACK for MBOX 0x%02x from VF %d\n", | ||
955 | mbx.msg.msg, vf); | ||
953 | nic_mbx_send_nack(nic, vf); | 956 | nic_mbx_send_nack(nic, vf); |
957 | } | ||
954 | unlock: | 958 | unlock: |
955 | nic->mbx_lock[vf] = false; | 959 | nic->mbx_lock[vf] = false; |
956 | } | 960 | } |