DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/net/e1000/igb_ethdev.c:fix eth_igb_add_del_flex_filter
@ 2015-05-24 16:17 motomu
  2015-07-10 14:48 ` Thomas Monjalon
  2015-07-13  9:00 ` Lu, Wenzhuo
  0 siblings, 2 replies; 3+ messages in thread
From: motomu @ 2015-05-24 16:17 UTC (permalink / raw)
  To: dev

From: Motomu Utsumi <motomu@hongo.wide.ad.jp>

in add flexfiler it always write to same register address,
so when try to adapt some filters only last one is enabled.
I substitute value based on based on flex_filter->index for reg_off.

in del flexfilter, it delete target filter and 
also delete first filter because of similar reason.
I substitute value based on based on it->index for reg_off.

---
 drivers/net/e1000/igb_ethdev.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index e4b370d..5a7f50a 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -2781,10 +2781,6 @@ eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
 	}
 
 	wufc = E1000_READ_REG(hw, E1000_WUFC);
-	if (flex_filter->index < E1000_MAX_FHFT)
-		reg_off = E1000_FHFT(flex_filter->index);
-	else
-		reg_off = E1000_FHFT_EXT(flex_filter->index - E1000_MAX_FHFT);
 
 	if (add) {
 		if (eth_igb_flex_filter_lookup(&filter_info->flex_list,
@@ -2813,6 +2809,10 @@ eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
 			rte_free(flex_filter);
 			return -ENOSYS;
 		}
+    if (flex_filter->index < E1000_MAX_FHFT)
+      reg_off = E1000_FHFT(flex_filter->index);
+    else
+      reg_off = E1000_FHFT_EXT(flex_filter->index - E1000_MAX_FHFT);
 
 		E1000_WRITE_REG(hw, E1000_WUFC, wufc | E1000_WUFC_FLEX_HQ |
 				(E1000_WUFC_FLX0 << flex_filter->index));
@@ -2841,6 +2841,10 @@ eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
 			rte_free(flex_filter);
 			return -ENOENT;
 		}
+    if (it->index < E1000_MAX_FHFT)
+      reg_off = E1000_FHFT(it->index);
+    else
+      reg_off = E1000_FHFT_EXT(it->index - E1000_MAX_FHFT);
 
 		for (i = 0; i < E1000_FHFT_SIZE_IN_DWD; i++)
 			E1000_WRITE_REG(hw, reg_off + i * sizeof(uint32_t), 0);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-13  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24 16:17 [dpdk-dev] [PATCH] drivers/net/e1000/igb_ethdev.c:fix eth_igb_add_del_flex_filter motomu
2015-07-10 14:48 ` Thomas Monjalon
2015-07-13  9:00 ` Lu, Wenzhuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).