Skip to contentSkip to conversation

net/e1000: add the VLAN capabilities of NIC

dpdk-dev New [email protected] 3 participants 6 messages Jul 20, 2020 – Jul 21, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

From: Peng Zhihong <[email protected]>

The rte_eth_dev_set_vlan_offload function will check whether the NIC has the set vlan feature. If it has not, it will return failure. So need to add all the vlan feature flags of the NIC.

Fixes ef990fb56e55 ("net/e1000: convert to new Rx offloads API")
---
 drivers/net/e1000/igb_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/e1000/igb_rxtx.c +2 -1
index 5717cdb70..966df3f20 100644
@@ -1647,7 +1647,8 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			  DEV_RX_OFFLOAD_JUMBO_FRAME |
 			  DEV_RX_OFFLOAD_KEEP_CRC    |
 			  DEV_RX_OFFLOAD_SCATTER     |
-			  DEV_RX_OFFLOAD_RSS_HASH;
+			  DEV_RX_OFFLOAD_RSS_HASH    |
+			  DEV_RX_OFFLOAD_VLAN_EXTEND;
 
 	return rx_offload_capa;
 }
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 8 lines

-----Original Message-----
From: Peng, ZhihongX <[email protected]>
Sent: Monday, July 20, 2020 9:47 AM
To: Zhao1, Wei <[email protected]>; Guo, Jia <[email protected]>
Cc: [email protected]; Peng, ZhihongX <[email protected]>; [email protected]
Subject: [DPDK] net/e1000: add the VLAN capabilities of NIC

Quoted 8 lines

From: Peng Zhihong <[email protected]>

The rte_eth_dev_set_vlan_offload function will check whether the NIC has the set vlan feature. If it has not, it will return failure. So need to add all the vlan feature flags of the NIC.

Fixes ef990fb56e55 ("net/e1000: convert to new Rx offloads API")

you should cc stable not wei.dai

Quoted 23 lines
---
 drivers/net/e1000/igb_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/e1000/igb_rxtx.c index renamed from drivers/net/e1000/igb_rxtx.c +0 -0

5717cdb70..966df3f20 100644

drivers/net/e1000/igb_rxtx.c +2 -1
@@ -1647,7 +1647,8 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev
 *dev)
 			  DEV_RX_OFFLOAD_JUMBO_FRAME |
 			  DEV_RX_OFFLOAD_KEEP_CRC    |
 			  DEV_RX_OFFLOAD_SCATTER     |
-			  DEV_RX_OFFLOAD_RSS_HASH;
+			  DEV_RX_OFFLOAD_RSS_HASH    |
+			  DEV_RX_OFFLOAD_VLAN_EXTEND;
 
 	return rx_offload_capa;

}
--
2.17.1

#2 lore raw

PATCH v2 1/1 net/e1000: add the VLAN capabilities of NIC

In reply to [email protected]

From: Peng Zhihong <[email protected]>

The rte_eth_dev_set_vlan_offload function will check whether the NIC has the set vlan feature. If it has not, it will return failure. So need to add all the vlan feature flags of the NIC.

Fixes ef990fb56e55 ("net/e1000: convert to new Rx offloads API")

---
Changes:
V2: modify commit log Cc to [email protected].

 drivers/net/e1000/igb_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/e1000/igb_rxtx.c +2 -1
index 5717cdb70..966df3f20 100644
@@ -1647,7 +1647,8 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			  DEV_RX_OFFLOAD_JUMBO_FRAME |
 			  DEV_RX_OFFLOAD_KEEP_CRC    |
 			  DEV_RX_OFFLOAD_SCATTER     |
-			  DEV_RX_OFFLOAD_RSS_HASH;
+			  DEV_RX_OFFLOAD_RSS_HASH    |
+			  DEV_RX_OFFLOAD_VLAN_EXTEND;
 
 	return rx_offload_capa;
 }
Signature · 1 line
2.17.1
#3 lore raw

PATCH v3 1/1 net/e1000: add VLAN extend feature to capability

From: Peng Zhihong <[email protected]>

The rte_eth_dev_set_vlan_offload function will check vlan rx offload capability, the i350/i210/i211 nics have vlan extend feature but DEV_RX_OFFLOAD_VLAN_EXTEND is not set into the capability, that will cause setting fail. So need to add this capability in igb_get_rx_port_offloads_capa function.

Fixes ef990fb56e55 ("net/e1000: convert to new Rx offloads API")
---
 drivers/net/e1000/igb_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/e1000/igb_rxtx.c +8 -1
index 5717cdb70..6411924e0 100644
@@ -1637,8 +1637,10 @@ uint64_t
 igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 {
 	uint64_t rx_offload_capa;
+	struct e1000_hw *hw;
+
+	hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	RTE_SET_USED(dev);
 	rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP  |
 			  DEV_RX_OFFLOAD_VLAN_FILTER |
 			  DEV_RX_OFFLOAD_IPV4_CKSUM  |
@@ -1649,6 +1651,11 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			  DEV_RX_OFFLOAD_SCATTER     |
 			  DEV_RX_OFFLOAD_RSS_HASH;
 
+	if (hw->mac.type == e1000_i350 ||
+	    hw->mac.type == e1000_i210 ||
+	    hw->mac.type == e1000_i211)
+		rx_offload_capa |= DEV_RX_OFFLOAD_VLAN_EXTEND;
+
 	return rx_offload_capa;
 }
 
Signature · 1 line
2.17.1
Reviewed-by on v3 1/1
#4 lore raw

Re: [dpdk-dev] [DPDK v3] net/e1000: add VLAN extend feature to capability

Quoted 54 lines

-----Original Message-----
From: Peng, ZhihongX <[email protected]>
Sent: Tuesday, July 21, 2020 11:05 AM
To: Zhao1, Wei <[email protected]>; Guo, Jia <[email protected]>
Cc: [email protected]; Peng, ZhihongX <[email protected]>; [email protected]
Subject: [DPDK v3] net/e1000: add VLAN extend feature to capability

From: Peng Zhihong <[email protected]>

The rte_eth_dev_set_vlan_offload function will check vlan rx offload capability, the i350/i210/i211 nics have vlan extend feature but DEV_RX_OFFLOAD_VLAN_EXTEND is not set into the capability, that will cause setting fail. So need to add this capability in igb_get_rx_port_offloads_capa function.

Fixes ef990fb56e55 ("net/e1000: convert to new Rx offloads API")
---
 drivers/net/e1000/igb_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/e1000/igb_rxtx.c index renamed from drivers/net/e1000/igb_rxtx.c +0 -0

5717cdb70..6411924e0 100644

drivers/net/e1000/igb_rxtx.c +8 -2
@@ -1637,8 +1637,10 @@ uint64_t
 igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev)  {
 	uint64_t rx_offload_capa;
+	struct e1000_hw *hw;
+
+	hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	RTE_SET_USED(dev);
 	rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP  |
 			  DEV_RX_OFFLOAD_VLAN_FILTER |
 			  DEV_RX_OFFLOAD_IPV4_CKSUM  |
@@ -1649,6 +1651,11 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev
 *dev)
 			  DEV_RX_OFFLOAD_SCATTER     |
 			  DEV_RX_OFFLOAD_RSS_HASH;
 
+	if (hw->mac.type == e1000_i350 ||
+	    hw->mac.type == e1000_i210 ||
+	    hw->mac.type == e1000_i211)
+		rx_offload_capa |= DEV_RX_OFFLOAD_VLAN_EXTEND;
+
 	return rx_offload_capa;
 }
 
--

2.17.1

Applied
#5 lore raw

Re: [dpdk-dev] [DPDK v3] net/e1000: add VLAN extend feature to capability

Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Zhao1, Wei
Sent: Tuesday, July 21, 2020 11:31 AM
To: Peng, ZhihongX <[email protected]>; Guo, Jia <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [DPDK v3] net/e1000: add VLAN extend feature to capability

Quoted 22 lines
Quoted 20 lines

-----Original Message-----
From: Peng, ZhihongX <[email protected]>
Sent: Tuesday, July 21, 2020 11:05 AM
To: Zhao1, Wei <[email protected]>; Guo, Jia <[email protected]>
Cc: [email protected]; Peng, ZhihongX <[email protected]>; [email protected]
Subject: [DPDK v3] net/e1000: add VLAN extend feature to capability

From: Peng Zhihong <[email protected]>

The rte_eth_dev_set_vlan_offload function will check vlan rx offload capability, the i350/i210/i211 nics have vlan extend feature but DEV_RX_OFFLOAD_VLAN_EXTEND is not set into the capability, that will cause setting fail. So need to add this capability in igb_get_rx_port_offloads_capa function.

Fixes ef990fb56e55 ("net/e1000: convert to new Rx offloads API")

Applied to dpdk-next-net-intel.

Thanks
Qi