Skip to contentSkip to conversation

net/nfp: fix Vlan offload flags check

PATCH In review Olivier Matz 3 participants 9 messages Jan 12, 2017 – Jan 13, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/nfp: fix Vlan offload flags check

Fix typo when checking that no Vlan offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")
---
 drivers/net/nfp/nfp_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/nfp/nfp_net.c +2 -2
index 65ba09f..ed3c9b8 100644
@@ -2174,8 +2174,8 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	new_ctrl = 0;
 
 	if ((mask & ETH_VLAN_FILTER_OFFLOAD) ||
-	    (mask & ETH_VLAN_FILTER_OFFLOAD))
-		RTE_LOG(INFO, PMD, "Not support for ETH_VLAN_FILTER_OFFLOAD or"
+	    (mask & ETH_VLAN_FILTER_EXTEND))
+		RTE_LOG(INFO, PMD, "No support for ETH_VLAN_FILTER_OFFLOAD or"
 			" ETH_VLAN_FILTER_EXTEND");
 
 	/* Enable vlan strip if it is not configured yet */
Signature · 1 line
2.8.1
#1 lore raw

Acked.

Thanks!

Quoted 34 lines · Olivier Matz

Fix typo when checking that no Vlan offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")
---
 drivers/net/nfp/nfp_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/nfp/nfp_net.c +0 -2
index 65ba09f..ed3c9b8 100644
@@ -2174,8 +2174,8 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev,
 int mask)
        new_ctrl = 0;
 
        if ((mask & ETH_VLAN_FILTER_OFFLOAD) ||
-           (mask & ETH_VLAN_FILTER_OFFLOAD))
-               RTE_LOG(INFO, PMD, "Not support for

ETH_VLAN_FILTER_OFFLOAD or"

drivers/net/nfp/nfp_net.c +2 -0
+           (mask & ETH_VLAN_FILTER_EXTEND))
+               RTE_LOG(INFO, PMD, "No support for ETH_VLAN_FILTER_OFFLOAD

or"

                        " ETH_VLAN_FILTER_EXTEND");

        /* Enable vlan strip if it is not configured yet */

--
2.8.1

#2 lore raw
In reply to Olivier Matz
Quoted 17 lines · Olivier Matz

Fix typo when checking that no Vlan offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")
---
 drivers/net/nfp/nfp_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/nfp/nfp_net.c +0 -0
index 65ba09f..ed3c9b8 100644

drivers/net/nfp/nfp_net.c nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask) · line 2177

Quoted 6 lines
drivers/net/nfp/nfp_net.c +1 -2
@@ -2174,8 +2174,8 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	new_ctrl = 0;
 
 	if ((mask & ETH_VLAN_FILTER_OFFLOAD) ||
-	    (mask & ETH_VLAN_FILTER_OFFLOAD))
-		RTE_LOG(INFO, PMD, "Not support for ETH_VLAN_FILTER_OFFLOAD or"
+	    (mask & ETH_VLAN_FILTER_EXTEND))

I can't find "ETH_VLAN_FILTER_EXTEND",
do you mean "ETH_VLAN_EXTEND_OFFLOAD" ?

Quoted 5 lines
drivers/net/nfp/nfp_net.c +1 -0
+		RTE_LOG(INFO, PMD, "No support for ETH_VLAN_FILTER_OFFLOAD or"
 			" ETH_VLAN_FILTER_EXTEND");
 
 	/* Enable vlan strip if it is not configured yet */
#3 lore raw
Quoted 20 lines · Ferruh Yigit
Quoted 19 lines · Olivier Matz

Fix typo when checking that no Vlan offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")
---
 drivers/net/nfp/nfp_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/nfp/nfp_net.c +0 -0
index 65ba09f..ed3c9b8 100644
@@ -2174,8 +2174,8 @@ nfp_net_vlan_offload_set(struct rte_eth_dev
 *dev, int mask) new_ctrl = 0;
 
Quoted 8 lines

drivers/net/nfp/nfp_net.c nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask) · line 2177

Quoted 5 lines
drivers/net/nfp/nfp_net.c +0 -2
 	if ((mask & ETH_VLAN_FILTER_OFFLOAD) ||
-	    (mask & ETH_VLAN_FILTER_OFFLOAD))
-		RTE_LOG(INFO, PMD, "Not support for

ETH_VLAN_FILTER_OFFLOAD or"

drivers/net/nfp/nfp_net.c +1 -0
+	    (mask & ETH_VLAN_FILTER_EXTEND))  

I can't find "ETH_VLAN_FILTER_EXTEND",
do you mean "ETH_VLAN_EXTEND_OFFLOAD" ?

Erf... I'm sorry, my mistake, I copy/pasted the log below without verifying. I saw it while watching the code.

Yes I mean ETH_VLAN_EXTEND_OFFLOAD. By the way, it could even be replaced ETH_VLAN_*_MASK, but it's the same value. For reference, here are the definitions from rte_ethdev.h:

/* Definitions used for VLAN Offload functionality */

 #define ETH_VLAN_STRIP_OFFLOAD   0x0001 /**< VLAN Strip  On/Off */
 #define ETH_VLAN_FILTER_OFFLOAD  0x0002 /**< VLAN Filter On/Off */
 #define ETH_VLAN_EXTEND_OFFLOAD  0x0004 /**< VLAN Extend On/Off */

/* Definitions used for mask VLAN setting */

 #define ETH_VLAN_STRIP_MASK   0x0001 /**< VLAN Strip  setting mask */
 #define ETH_VLAN_FILTER_MASK  0x0002 /**< VLAN Filter  setting mask*/
 #define ETH_VLAN_EXTEND_MASK  0x0004 /**< VLAN Extend  setting mask*/

I'll submit another patch with ETH_VLAN_EXTEND_OFFLOAD. Thanks Ferruh.

Olivier

#4 lore raw
Quoted 12 lines · Olivier Matz
Quoted 10 lines · Ferruh Yigit
Quoted 9 lines · Olivier Matz

Fix typo when checking that no Vlan offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")

---

<...>

Quoted 3 lines

I'll submit another patch with ETH_VLAN_EXTEND_OFFLOAD.

If this will be the only change, I can update it if you want:

- (mask & ETH_VLAN_FILTER_OFFLOAD))
- RTE_LOG(INFO, PMD, "Not support for ETH_VLAN_FILTER_OFFLOAD or"
- " ETH_VLAN_FILTER_EXTEND");
+ (mask & ETH_VLAN_EXTEND_OFFLOAD))
+ RTE_LOG(INFO, PMD, "No support for ETH_VLAN_FILTER_OFFLOAD or"
+ " ETH_VLAN_EXTEND_OFFLOAD");

Quoted 4 lines

Thanks Ferruh.

Olivier

#5 lore raw
Quoted 26 lines · Ferruh Yigit
Quoted 12 lines · Olivier Matz
Quoted 10 lines · Ferruh Yigit
Quoted 9 lines · Olivier Matz

Fix typo when checking that no Vlan offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")

---

<...>

Quoted 3 lines

I'll submit another patch with ETH_VLAN_EXTEND_OFFLOAD.

If this will be the only change, I can update it if you want:

(quoted diff) +0 -2
-   (mask & ETH_VLAN_FILTER_OFFLOAD))
-       RTE_LOG(INFO, PMD, "Not support for ETH_VLAN_FILTER_OFFLOAD

or"

Review

Quoted 4 lines
(quoted diff) +3 -1
-                       " ETH_VLAN_FILTER_EXTEND");
+   (mask & ETH_VLAN_EXTEND_OFFLOAD))
+       RTE_LOG(INFO, PMD, "No support for ETH_VLAN_FILTER_OFFLOAD or"
+                       " ETH_VLAN_EXTEND_OFFLOAD");

Looks good to me, thank you.

Olivier

#6 lore raw

I was assuming in my acked answer, that the patch had followed usual path and automatic compilation did not fail.

But I forgot about the NFP PMD not being enabled by default :-)

Hopefully, this will change if this just sent patch is accepted:

http://www.dpdk.org/ml/archives/dev/2017-January/054890.html

By other hand, I have compiled the NFP PMD with this patch and it works.

So acked again.

Thanks

Quoted 37 lines · Olivier Matz
Quoted 26 lines · Ferruh Yigit
Quoted 12 lines · Olivier Matz
Quoted 10 lines · Ferruh Yigit
Quoted 9 lines · Olivier Matz

Fix typo when checking that no Vlan offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")

---

<...>

Quoted 3 lines

I'll submit another patch with ETH_VLAN_EXTEND_OFFLOAD.

If this will be the only change, I can update it if you want:

(quoted diff) +0 -2
-   (mask & ETH_VLAN_FILTER_OFFLOAD))
-       RTE_LOG(INFO, PMD, "Not support for ETH_VLAN_FILTER_OFFLOAD

or"

Review

Quoted 4 lines
(quoted diff) +3 -1
-                       " ETH_VLAN_FILTER_EXTEND");
+   (mask & ETH_VLAN_EXTEND_OFFLOAD))
+       RTE_LOG(INFO, PMD, "No support for ETH_VLAN_FILTER_OFFLOAD or"
+                       " ETH_VLAN_EXTEND_OFFLOAD");

Looks good to me, thank you.

Olivier

#7 lore raw

PATCH 1/1 net/nfp: fix VLAN offload flags check

From: Olivier Matz <[email protected]>

Fix typo when checking that no VLAN offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")
---
 drivers/net/nfp/nfp_net.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/nfp/nfp_net.c +3 -3
index 31e72e2..ab2d331 100644
@@ -2174,9 +2174,9 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	new_ctrl = 0;
 
 	if ((mask & ETH_VLAN_FILTER_OFFLOAD) ||
-	    (mask & ETH_VLAN_FILTER_OFFLOAD))
-		RTE_LOG(INFO, PMD, "Not support for ETH_VLAN_FILTER_OFFLOAD or"
-			" ETH_VLAN_FILTER_EXTEND");
+	    (mask & ETH_VLAN_EXTEND_OFFLOAD))
+		RTE_LOG(INFO, PMD, "No support for ETH_VLAN_FILTER_OFFLOAD or"
+			" ETH_VLAN_EXTEND_OFFLOAD");
 
 	/* Enable vlan strip if it is not configured yet */
 	if ((mask & ETH_VLAN_STRIP_OFFLOAD) &&
Signature · 1 line
2.9.3
Applied
#8 lore raw

Re: [PATCH] net/nfp: fix VLAN offload flags check

Quoted 11 lines · Ferruh Yigit

From: Olivier Matz <[email protected]>

Fix typo when checking that no VLAN offload flags are passed at port initialization.

By the way, also fix a typo in the log.

Fixes d4a27a3b092a ("nfp: add basic features")

Applied to dpdk-next-net/master, thanks.

(I forget about stable tree, that is why need to re-send latest patch)