net/i40e:fix VSI stats error
PATCH 1/1 net/i40e:fix VSI stats error
In VF, the number of ibytes read from register have been stripped out CRC already, but in stats, it subtracts CRC bytes again. So it lead to RX bytes is smaller than TX bytes.
--- drivers/net/i40e/i40e_ethdev.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/i40e/i40e_ethdev.c +0 -4
@@ -2440,10 +2440,6 @@ i40e_update_vsi_stats(struct i40e_vsi *vsi)i40e_stat_update_48 (hw,I40E_GLV_BPRCH (idx),I40E_GLV_BPRCL (idx), vsi->offset_loaded, &oes->rx_broadcast, &nes->rx_broadcast); -/* exclude CRC bytes */ - nes->rx_bytes -= (nes->rx_unicast + nes->rx_multicast + - nes->rx_broadcast) *ETHER_CRC_LEN ; -i40e_stat_update_32 (hw,I40E_GLV_RDPC (idx), vsi->offset_loaded, &oes->rx_discards, &nes->rx_discards);/* GLV_REPC not supported */
Signature · 1 line
2.11.0
Quoted 34 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yanglong Wu
Sent: Thursday 1 February 2018 02:11
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>; Wu, Yanglong <[email protected]>
Subject: [dpdk-dev] [PATCH] net/i40e:fix VSI stats errorIn VF, the number of ibytes read from register have been stripped out CRC already, but in stats, it subtracts CRC bytes again. So it lead to RX bytes is smaller than TX bytes.
Fixes 98abce23(fix VF statistics)Signed-off-by Yanglong Wu <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 4 ---- 1 file changed, 4 deletions(-)drivers/net/i40e/i40e_ethdev.c +0
-4@@ -2440,10 +2440,6 @@ i40e_update_vsi_stats(struct i40e_vsi *vsi)i40e_stat_update_48 (hw,I40E_GLV_BPRCH (idx),I40E_GLV_BPRCL (idx), vsi->offset_loaded, &oes->rx_broadcast, &nes->rx_broadcast); -/* exclude CRC bytes */ - nes->rx_bytes -= (nes->rx_unicast + nes->rx_multicast + - nes->rx_broadcast) *ETHER_CRC_LEN ; -i40e_stat_update_32 (hw,I40E_GLV_RDPC (idx), vsi->offset_loaded, &oes->rx_discards, &nes->rx_discards);
Quoted 3 lines
/*
GLV_REPCnot supported */
--
2.11.0
Quoted 20 lines
-----Original Message-----
From: Rybalchenko, Kirill
Sent: Wednesday, March 14, 2018 8:00 PM
To: Wu, Yanglong <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>; Wu, Yanglong <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] net/i40e:fix VSI stats errorQuoted 9 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yanglong Wu
Sent: Thursday 1 February 2018 02:11
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>; Wu, Yanglong <[email protected]>
Subject: [dpdk-dev] [PATCH] net/i40e:fix VSI stats errorIn VF, the number of ibytes read from register have been stripped out
This is not correct, statistic read from register I40E_GLV_GORCH|L does include CRC. It should be excluded.
Regards
Qi
Quoted 2 lines
Quoted 2 lines
CRC already, but in stats, it subtracts CRC bytes again. So it lead to RX bytes is smaller than TX bytes.
Do you mean, CRC is double stripped by software, or you assume
Quoted 28 lines
Quoted 23 lines
Fixes 98abce23(fix VF statistics)Signed-off-by Yanglong Wu <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 4 ---- 1 file changed, 4 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_ethdev.cindexc4df65df0..84e82889a100644drivers/net/i40e/i40e_ethdev.c +0
-5@@ -2440,10 +2440,6 @@ i40e_update_vsi_stats(struct i40e_vsi *vsi)i40e_stat_update_48 (hw,I40E_GLV_BPRCH (idx),I40E_GLV_BPRCL (idx), vsi->offset_loaded, &oes->rx_broadcast, &nes->rx_broadcast); -/* exclude CRC bytes */ - nes->rx_bytes -= (nes->rx_unicast + nes->rx_multicast + - nes->rx_broadcast) *ETHER_CRC_LEN ; -i40e_stat_update_32 (hw,I40E_GLV_RDPC (idx), vsi->offset_loaded, &oes->rx_discards, &nes->rx_discards);/* GLV_REPC not supported */ --Quoted 1 line
2.11.0
Reviewed-by Kirill Rybalchenko <[email protected]>