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

* Re: [dpdk-dev] [PATCH] drivers/net/e1000/igb_ethdev.c:fix eth_igb_add_del_flex_filter
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-07-10 14:48 UTC (permalink / raw)
  To: motomu; +Cc: dev

We definitely need a maintainer for e1000.

2015-05-24 16:17, motomu:
> 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.

You forgot a Signed-off.

[...]
>  		}
> +    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);

On the formatting side, it seems indent is wrong.

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

* Re: [dpdk-dev] [PATCH] drivers/net/e1000/igb_ethdev.c:fix eth_igb_add_del_flex_filter
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Lu, Wenzhuo @ 2015-07-13  9:00 UTC (permalink / raw)
  To: motomu, dev

Hi Motomu,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of motomu
> Sent: Monday, May 25, 2015 12:18 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] drivers/net/e1000/igb_ethdev.c:fix
> eth_igb_add_del_flex_filter
> 
> 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 don't understand what the " same register address " means. So, I don't think it's necessary to change the code. Would you like to give more details? Thanks.

Wenzhuo

> 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).