Skip to content

Commit 5354439

Browse files
Vadim Lomovtsevdavem330
authored andcommitted
net: thunderx: rework xcast message structure to make it fit into 64 bit
To communicate to PF each of ThunderX NIC VF uses mailbox which is pair of 64 bit registers available to both VFn and PF. This commit is to change the xcast message structure in order to fit it into 64 bit. Signed-off-by: Vadim Lomovtsev <vlomovtsev@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7db730d commit 5354439

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

drivers/net/ethernet/cavium/thunder/nic.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,8 @@ struct set_ptp {
577577

578578
struct xcast {
579579
u8 msg;
580-
union {
581-
u8 mode;
582-
u64 mac;
583-
} data;
580+
u8 mode;
581+
u64 mac:48;
584582
};
585583

586584
/* 128 bit shared memory between PF and each VF */

drivers/net/ethernet/cavium/thunder/nic_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf)
10941094
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
10951095
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
10961096
bgx_set_dmac_cam_filter(nic->node, bgx, lmac,
1097-
mbx.xcast.data.mac,
1097+
mbx.xcast.mac,
10981098
vf < NIC_VF_PER_MBX_REG ? vf :
10991099
vf - NIC_VF_PER_MBX_REG);
11001100
break;
@@ -1106,7 +1106,7 @@ static void nic_handle_mbx_intr(struct nicpf *nic, int vf)
11061106
}
11071107
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
11081108
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
1109-
bgx_set_xcast_mode(nic->node, bgx, lmac, mbx.xcast.data.mode);
1109+
bgx_set_xcast_mode(nic->node, bgx, lmac, mbx.xcast.mode);
11101110
break;
11111111
default:
11121112
dev_err(&nic->pdev->dev,

drivers/net/ethernet/cavium/thunder/nicvf_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ static void __nicvf_set_rx_mode_task(u8 mode, struct xcast_addr_list *mc_addrs,
19611961
* its' own LMAC to the filter to accept packets for it.
19621962
*/
19631963
mbx.xcast.msg = NIC_MBOX_MSG_ADD_MCAST;
1964-
mbx.xcast.data.mac = 0;
1964+
mbx.xcast.mac = 0;
19651965
if (nicvf_send_msg_to_pf(nic, &mbx) < 0)
19661966
goto free_mc;
19671967
}
@@ -1971,15 +1971,15 @@ static void __nicvf_set_rx_mode_task(u8 mode, struct xcast_addr_list *mc_addrs,
19711971
/* now go through kernel list of MACs and add them one by one */
19721972
for (idx = 0; idx < mc_addrs->count; idx++) {
19731973
mbx.xcast.msg = NIC_MBOX_MSG_ADD_MCAST;
1974-
mbx.xcast.data.mac = mc_addrs->mc[idx];
1974+
mbx.xcast.mac = mc_addrs->mc[idx];
19751975
if (nicvf_send_msg_to_pf(nic, &mbx) < 0)
19761976
goto free_mc;
19771977
}
19781978
}
19791979

19801980
/* and finally set rx mode for PF accordingly */
19811981
mbx.xcast.msg = NIC_MBOX_MSG_SET_XCAST;
1982-
mbx.xcast.data.mode = mode;
1982+
mbx.xcast.mode = mode;
19831983

19841984
nicvf_send_msg_to_pf(nic, &mbx);
19851985
free_mc:

0 commit comments

Comments
 (0)