Skip to contentSkip to conversation

ether: use named constants for deprecated QinQ TPIDs

PATCH Applied Andrew Rybchenko 2 participants 2 messages Jun 19, 2020 – Jul 10, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ether: use named constants for deprecated QinQ TPIDs

From: Ivan Malov <[email protected]>

Add named constants for deprecated QinQ TPIDs. Update drivers which have already been using existing TPID named constants from librte_net to use the new named constants rather than magic numbers.

---
 drivers/net/bnxt/bnxt_ethdev.c | 6 +++---
 lib/librte_net/rte_ether.h     | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +3 -3
index e8b4c058a1..74485a7aaf 100644
@@ -2409,15 +2409,15 @@ bnxt_vlan_tpid_set_op(struct rte_eth_dev *dev, enum rte_vlan_type vlan_type,
 			bp->outer_tpid_bd =
 				TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100;
 				break;
-		case 0x9100:
+		case RTE_ETHER_TYPE_QINQ1:
 			bp->outer_tpid_bd =
 				TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100;
 				break;
-		case 0x9200:
+		case RTE_ETHER_TYPE_QINQ2:
 			bp->outer_tpid_bd =
 				TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200;
 				break;
-		case 0x9300:
+		case RTE_ETHER_TYPE_QINQ3:
 			bp->outer_tpid_bd =
 				 TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300;
 				break;
lib/librte_net/rte_ether.h +3 -0
index 0ae4e75b6c..e942556c5a 100644
@@ -294,6 +294,9 @@ struct rte_vlan_hdr {
 #define RTE_ETHER_TYPE_RARP 0x8035 /**< Reverse Arp Protocol. */
 #define RTE_ETHER_TYPE_VLAN 0x8100 /**< IEEE 802.1Q VLAN tagging. */
 #define RTE_ETHER_TYPE_QINQ 0x88A8 /**< IEEE 802.1ad QinQ tagging. */
+#define RTE_ETHER_TYPE_QINQ1 0x9100 /**< Deprecated QinQ VLAN. */
+#define RTE_ETHER_TYPE_QINQ2 0x9200 /**< Deprecated QinQ VLAN. */
+#define RTE_ETHER_TYPE_QINQ3 0x9300 /**< Deprecated QinQ VLAN. */
 #define RTE_ETHER_TYPE_PPPOE_DISCOVERY 0x8863 /**< PPPoE Discovery Stage. */
 #define RTE_ETHER_TYPE_PPPOE_SESSION 0x8864 /**< PPPoE Session Stage. */
 #define RTE_ETHER_TYPE_ETAG 0x893F /**< IEEE 802.1BR E-Tag. */
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 9 lines · Andrew Rybchenko

From: Ivan Malov <[email protected]>

Add named constants for deprecated QinQ TPIDs. Update drivers which have already been using existing TPID named constants from librte_net to use the new named constants rather than magic numbers.

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