DPDK patches and discussions
 help / color / mirror / Atom feed
From: motomu <motomu@hongo.wide.ad.jp>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] drivers/net/e1000/igb_ethdev.c:fix eth_igb_add_del_flex_filter
Date: Sun, 24 May 2015 16:17:31 +0000	[thread overview]
Message-ID: <1432484252-3517-1-git-send-email-motomu@hongo.wide.ad.jp> (raw)

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

             reply	other threads:[~2015-05-24  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-24 16:17 motomu [this message]
2015-07-10 14:48 ` Thomas Monjalon
2015-07-13  9:00 ` Lu, Wenzhuo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432484252-3517-1-git-send-email-motomu@hongo.wide.ad.jp \
    --to=motomu@hongo.wide.ad.jp \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).