i40e: Fix dropped jumbo frames statistics

[ Upstream commit 1adb1563e7b7ec659379a18e607e8bc3522d8a78 ]

Dropped packets caused by too large frames were not included in
dropped RX packets statistics.
Issue was caused by not reading the GL_RXERR1 register. That register
stores count of packet which was have been dropped due to too large
size.

Fix it by reading GL_RXERR1 register for each interface.

Repro steps:
Send a packet larger than the set MTU to SUT
Observe rx statists: ethtool -S <interface> | grep rx | grep -v ": 0"

Fixes: 41a9e55c89 ("i40e: add missing VSI statistics")
Signed-off-by: Lukasz Cieplicki <lukaszx.cieplicki@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Lukasz Cieplicki
2022-05-31 12:54:20 +02:00
committed by Greg Kroah-Hartman
parent 5561bddd05
commit 2b4659c145
4 changed files with 103 additions and 0 deletions

View File

@@ -37,6 +37,7 @@
#include <net/tc_act/tc_mirred.h>
#include <net/udp_tunnel.h>
#include <net/xdp_sock.h>
#include <linux/bitfield.h>
#include "i40e_type.h"
#include "i40e_prototype.h"
#include <linux/net/intel/i40e_client.h>
@@ -991,6 +992,21 @@ static inline void i40e_write_fd_input_set(struct i40e_pf *pf,
(u32)(val & 0xFFFFFFFFULL));
}
/**
* i40e_get_pf_count - get PCI PF count.
* @hw: pointer to a hw.
*
* Reports the function number of the highest PCI physical
* function plus 1 as it is loaded from the NVM.
*
* Return: PCI PF count.
**/
static inline u32 i40e_get_pf_count(struct i40e_hw *hw)
{
return FIELD_GET(I40E_GLGEN_PCIFCNCNT_PCIPFCNT_MASK,
rd32(hw, I40E_GLGEN_PCIFCNCNT));
}
/* needed by i40e_ethtool.c */
int i40e_up(struct i40e_vsi *vsi);
void i40e_down(struct i40e_vsi *vsi);