ixgbe: write flush vfta registers
Subsystems (3)
PATCH 1/1 ixgbe: write flush vfta registers
From: Zhu Yanjun <[email protected]>
Sometimes vfta registers can not be written successfully in dcb mode. This is very occassional. When the ixgbe nic runs for a very long time, sometimes this bug occurs. But after IXGBE_WRITE_FLUSH is executed, this bug never occurs.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +4 -1
@@ -4138,8 +4138,10 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) }/* Set all bits in the VLAN filter table array */ -for (i = hw->mac.vft_size; i--;) +for (i = hw->mac.vft_size; i--;) {IXGBE_WRITE_REG (hw,IXGBE_VFTA (i), ~0U ); +IXGBE_WRITE_FLUSH (hw); + } }#define VFTA_BLOCK_SIZE 8
@@ -4186,6 +4188,7 @@ static void ixgbe_scrub_vfta(struct ixgbe_adapter *adapter, u32 vfta_offset) vfta[i] |= adapter->active_vlans[word] >> bits;IXGBE_WRITE_REG (hw,IXGBE_VFTA (vfta_offset + i), vfta[i]); +IXGBE_WRITE_FLUSH (hw); } }
Signature · 1 line
2.7.4
Hi,
Quoted 16 lines
Sometimes vfta registers can not be written successfully in dcb mode. This is very occassional. When the ixgbe nic runs for a very long time, sometimes this bug occurs. But after
IXGBE_WRITE_FLUSHis executed, this bug never occurs.Signed-off-by Zhu Yanjun <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +0
-0
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) · line 4144
Quoted 8 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +3
-1@@ -4138,8 +4138,10 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) }/* Set all bits in the VLAN filter table array */ -for (i = hw->mac.vft_size; i--;) +for (i = hw->mac.vft_size; i--;) {IXGBE_WRITE_REG (hw,IXGBE_VFTA (i), ~0U ); +IXGBE_WRITE_FLUSH (hw); + }
Should it not be sufficient to do the flush only once, at the end of the function?
Regards,
Lino
Sure. From the following.
"
VLAN Filter. Each bit ?i? in register ?n? affects packets with VLAN tags equal to 32*n+i.
128 VLAN Filter registers compose a table of 4096 bits that cover all possible VLAN
tags.
Each bit when set, enables packets with the associated VLAN tags to pass. Each bit
when cleared, blocks packets with this VLAN tag.
"
Your suggestions seems reasonable. Please wait. I will make tests to vefiry your suggestions.
I will keep you update.
Quoted 33 lines · Lino Sanfilippo
Hi,
Quoted 16 lines
Sometimes vfta registers can not be written successfully in dcb mode. This is very occassional. When the ixgbe nic runs for a very long time, sometimes this bug occurs. But after
IXGBE_WRITE_FLUSHis executed, this bug never occurs.Signed-off-by Zhu Yanjun <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +0
-0drivers/net/ethernet/intel/ixgbe/ixgbe_main.c static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) · line 4144
Quoted 8 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +3
-1@@ -4138,8 +4138,10 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) }/* Set all bits in the VLAN filter table array */ -for (i = hw->mac.vft_size; i--;) +for (i = hw->mac.vft_size; i--;) {IXGBE_WRITE_REG (hw,IXGBE_VFTA (i), ~0U ); +IXGBE_WRITE_FLUSH (hw); + }Should it not be sufficient to do the flush only once, at the end of the function?
Regards,
Lino
After several week tests, your advice still make this bug appear. But my patch make this bug disappear.
Zhu Yanjun
Quoted 50 lines · zhuyj
Sure. From the following.
"
VLAN Filter. Each bit ?i? in register ?n? affects packets with VLAN tags equal to 32*n+i.
128 VLAN Filter registers compose a table of 4096 bits that cover all possible VLAN
tags.
Each bit when set, enables packets with the associated VLAN tags to pass. Each bit
when cleared, blocks packets with this VLAN tag.
"
Your suggestions seems reasonable. Please wait. I will make tests to vefiry your suggestions.I will keep you update.
Quoted 33 lines · Lino Sanfilippo
Hi,
Quoted 16 lines
Sometimes vfta registers can not be written successfully in dcb mode. This is very occassional. When the ixgbe nic runs for a very long time, sometimes this bug occurs. But after
IXGBE_WRITE_FLUSHis executed, this bug never occurs.Signed-off-by Zhu Yanjun <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +0
-0drivers/net/ethernet/intel/ixgbe/ixgbe_main.c static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) · line 4144
Quoted 8 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +3
-1@@ -4138,8 +4138,10 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) }/* Set all bits in the VLAN filter table array */ -for (i = hw->mac.vft_size; i--;) +for (i = hw->mac.vft_size; i--;) {IXGBE_WRITE_REG (hw,IXGBE_VFTA (i), ~0U ); +IXGBE_WRITE_FLUSH (hw); + }Should it not be sufficient to do the flush only once, at the end of the function?
Regards,
Lino
Hi Zhu,
Quoted 5 lines · zhuyj
After several week tests, your advice still make this bug appear. But my patch make this bug disappear.
Zhu Yanjun
In your commit message you wrote
"Sometimes vfta registers can not be written successfully in dcb mode."
Do you mean that the writes to the registers dont seem to have any effect at all? Or is the effect only delayed? What exactly is your test case?
(BTW: please dont top-post).
Regards,
Lino