DPDK patches and discussions
 help / color / mirror / Atom feed
From: Markus Theil <markus.theil@tu-ilmenau.de>
To: dev@dpdk.org
Cc: Markus Theil <markus.theil@tu-ilmenau.de>
Subject: [dpdk-dev] [PATCH v2] net/igb: fix add/delete of flex filters
Date: Thu, 18 May 2017 14:20:14 +0200	[thread overview]
Message-ID: <1495110014-20074-1-git-send-email-markus.theil@tu-ilmenau.de> (raw)
In-Reply-To: <1495107150-22206-1-git-send-email-markus.theil@tu-ilmenau.de>

Before this patch, flex_filter->index was always zero when it was read
and used after rte_zmalloc. The corresponding code was therefore moved
into the add and delete parts of the if/else statement. i210 and i211
also support flex filters.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 drivers/net/e1000/igb_ethdev.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 43d1f5f..f090e47 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -3657,7 +3657,8 @@ eth_igb_syn_filter_handle(struct rte_eth_dev *dev,
 }

 #define MAC_TYPE_FILTER_SUP_EXT(type)    do {\
-	if ((type) != e1000_82580 && (type) != e1000_i350)\
+	if ((type) != e1000_82580 && (type) != e1000_i350 &&\
+		(type) != e1000_i210 && (type) != e1000_i211)\
 		return -ENOSYS; \
 } while (0)

@@ -3913,10 +3914,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,
@@ -3946,6 +3943,11 @@ eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
 			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));
 		queueing = filter->len |
@@ -3974,6 +3976,11 @@ eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
 			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);
 		E1000_WRITE_REG(hw, E1000_WUFC, wufc &
--
2.7.4

  reply	other threads:[~2017-05-18 12:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 11:32 [dpdk-dev] [PATCH] " Markus Theil
2017-05-18 12:20 ` Markus Theil [this message]
2017-05-22  1:51   ` [dpdk-dev] [PATCH v2] " Lu, Wenzhuo
2017-05-22 10:17   ` [dpdk-dev] [PATCH v3 1/2] net/igb: support flex filters on i210/i211 Markus Theil
2017-05-22 10:17     ` [dpdk-dev] [PATCH v3 2/2] net/igb: fix add/delete of flex filters Markus Theil
2017-05-23  0:37       ` Lu, Wenzhuo
2017-05-23  0:36     ` [dpdk-dev] [PATCH v3 1/2] net/igb: support flex filters on i210/i211 Lu, Wenzhuo
2017-05-23 12:28       ` Ferruh Yigit

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=1495110014-20074-1-git-send-email-markus.theil@tu-ilmenau.de \
    --to=markus.theil@tu-ilmenau.de \
    --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).