net/i40e: fix vlan insert code redundance
PATCH 1/1 net/i40e: fix vlan insert code redundance
This patch removed useless tx_flags in vlan insertion.
--- drivers/net/i40e/i40e_rxtx.c | 8 +------- drivers/net/i40e/i40e_rxtx.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-)
drivers/net/i40e/i40e_rxtx.c +1 -7
@@ -1026,7 +1026,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)uint16_t nb_tx;uint32_t td_cmd;uint32_t td_offset; -uint32_t tx_flags;uint32_t td_tag;uint64_t ol_flags;uint16_t nb_used;
@@ -1050,7 +1049,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) td_cmd =0 ; td_tag =0 ; td_offset =0 ; - tx_flags =0 ; tx_pkt = *tx_pkts++;RTE_MBUF_PREFETCH_TO_FREE (txe->mbuf);
@@ -1097,12 +1095,8 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)/* Descriptor based VLAN insertion */ if (ol_flags & (PKT_TX_VLAN_PKT |PKT_TX_QINQ_PKT )) { - tx_flags |= tx_pkt->vlan_tci << -I40E_TX_FLAG_L2TAG1_SHIFT ; - tx_flags |=I40E_TX_FLAG_INSERT_VLAN ; td_cmd |=I40E_TX_DESC_CMD_IL2TAG1 ; - td_tag = (tx_flags &I40E_TX_FLAG_L2TAG1_MASK ) >> -I40E_TX_FLAG_L2TAG1_SHIFT ; + td_tag = tx_pkt->vlan_tci; }/* Always enable CRC offload insertion */
drivers/net/i40e/i40e_rxtx.h +0 -2
@@ -38,8 +38,6 @@* 32 bits tx flags, high 16 bits for L2TAG1 (VLAN), * low 16 bits for others. */ -#define I40E_TX_FLAG_L2TAG1_SHIFT 16 -#define I40E_TX_FLAG_L2TAG1_MASK 0xffff0000#define I40E_TX_FLAG_CSUM ((uint32_t)(1 << 0))#define I40E_TX_FLAG_INSERT_VLAN ((uint32_t)(1 << 1))#define I40E_TX_FLAG_TSYN ((uint32_t)(1 << 2))
Signature · 1 line
2.7.4
Quoted 1 line · Qiming Yang
This patch removed useless
tx_flagsin vlan insertion.
Overall this looks good, I wonder what was the initial intention of this code, understanding it helps to figure out if there is a hidden defect.
This code not fixes a defect, but improves the code, is there any performance gain with this?
If not, I am for deferring this to next release.
Quoted 30 lines
Fixes 4861cde46116 ("i40e: new poll mode driver")Signed-off-by Qiming Yang <[email protected]>--- drivers/net/i40e/i40e_rxtx.c | 8 +------- drivers/net/i40e/i40e_rxtx.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-)drivers/net/i40e/i40e_rxtx.c +0
-2@@ -1026,7 +1026,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)uint16_t nb_tx;uint32_t td_cmd;uint32_t td_offset; -uint32_t tx_flags;uint32_t td_tag;uint64_t ol_flags;uint16_t nb_used;@@ -1050,7 +1049,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) td_cmd =0 ; td_tag =0 ; td_offset =0 ; - tx_flags =0 ; tx_pkt = *tx_pkts++;RTE_MBUF_PREFETCH_TO_FREE (txe->mbuf);
drivers/net/i40e/i40e_rxtx.c i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) · line 1102
Quoted 6 lines
drivers/net/i40e/i40e_rxtx.c +0
-3@@ -1097,12 +1095,8 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)/* Descriptor based VLAN insertion */ if (ol_flags & (PKT_TX_VLAN_PKT |PKT_TX_QINQ_PKT )) { - tx_flags |= tx_pkt->vlan_tci << -I40E_TX_FLAG_L2TAG1_SHIFT ; - tx_flags |=I40E_TX_FLAG_INSERT_VLAN ;
The I40E_TX_FLAG_INSERT_VLAN flag also seems used only here, and can be removed.
Also I40E_TX_FLAG_CSUM and I40E_TX_FLAG_TSYN seems not used at all, understanding why they are introduced at first place can be useful.
Quoted 21 lines
drivers/net/i40e/i40e_rxtx.c +1
-2td_cmd |=I40E_TX_DESC_CMD_IL2TAG1 ; - td_tag = (tx_flags &I40E_TX_FLAG_L2TAG1_MASK ) >> -I40E_TX_FLAG_L2TAG1_SHIFT ; + td_tag = tx_pkt->vlan_tci; }/* Always enable CRC offload insertion */ drivers/net/i40e/i40e_rxtx.h +0
-2@@ -38,8 +38,6 @@* 32 bits tx flags, high 16 bits for L2TAG1 (VLAN), * low 16 bits for others. */ -#define I40E_TX_FLAG_L2TAG1_SHIFT 16 -#define I40E_TX_FLAG_L2TAG1_MASK 0xffff0000#define I40E_TX_FLAG_CSUM ((uint32_t)(1 << 0))#define I40E_TX_FLAG_INSERT_VLAN ((uint32_t)(1 << 1))#define I40E_TX_FLAG_TSYN ((uint32_t)(1 << 2))
Quoted 9 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, February 10, 2017 6:25 PM
To: Yang, Qiming <[email protected]>; [email protected]
Cc: Wu, Jingjing <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix vlan insert code redundance
Quoted 5 lines
Quoted 1 line · Qiming Yang
This patch removed useless
tx_flagsin vlan insertion.Overall this looks good, I wonder what was the initial intention of this code, understanding it helps to figure out if there is a hidden defect.
Thank you for your remind. I'll investigate it.
Quoted 3 lines
This code not fixes a defect, but improves the code, is there any performance gain with this?
I'll do more test and give you a feedback.
Quoted 71 lines
If not, I am for deferring this to next release.
drivers/net/i40e/i40e_rxtx.c i40e_xmit_pkts(void *tx_queue, struct rte_mbuf
Quoted 14 lines
Fixes 4861cde46116 ("i40e: new poll mode driver")Signed-off-by Qiming Yang <[email protected]>--- drivers/net/i40e/i40e_rxtx.c | 8 +------- drivers/net/i40e/i40e_rxtx.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_rxtx.cindex 608685f..b91cd70 100644drivers/net/i40e/i40e_rxtx.c +0
-0@@ -1026,7 +1026,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf**tx_pkts,
uint16_tnb_pkts)drivers/net/i40e/i40e_rxtx.c i40e_xmit_pkts(void *tx_queue, struct rte_mbuf
Quoted 8 lines
drivers/net/i40e/i40e_rxtx.c +0
-1uint16_t nb_tx;uint32_t td_cmd;uint32_t td_offset; -uint32_t tx_flags;uint32_t td_tag;uint64_t ol_flags;uint16_t nb_used;@@ -1050,7 +1049,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf**tx_pkts,
uint16_tnb_pkts)drivers/net/i40e/i40e_rxtx.c i40e_xmit_pkts(void *tx_queue, struct
Quoted 8 lines
drivers/net/i40e/i40e_rxtx.c +0
-1td_cmd =0 ; td_tag =0 ; td_offset =0 ; - tx_flags =0 ; tx_pkt = *tx_pkts++;RTE_MBUF_PREFETCH_TO_FREE (txe->mbuf);@@ -1097,12 +1095,8 @@ i40e_xmit_pkts(void *tx_queue, struct
rte_mbufdrivers/net/i40e/i40e_rxtx.c i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) · line 1102
Quoted 7 lines
drivers/net/i40e/i40e_rxtx.c +0
-3**tx_pkts, uint16_t nb_pkts)/* Descriptor based VLAN insertion */ if (ol_flags & (PKT_TX_VLAN_PKT |PKT_TX_QINQ_PKT )) { - tx_flags |= tx_pkt->vlan_tci << -I40E_TX_FLAG_L2TAG1_SHIFT ; - tx_flags |=I40E_TX_FLAG_INSERT_VLAN ;The
I40E_TX_FLAG_INSERT_VLANflag also seems used only here, and can be removed.Also
I40E_TX_FLAG_CSUMandI40E_TX_FLAG_TSYNseems not used at all, understanding why they are introduced at first place can be useful.drivers/net/i40e/i40e_rxtx.c i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
Quoted 3 lines
drivers/net/i40e/i40e_rxtx.c +0
-2td_cmd |=I40E_TX_DESC_CMD_IL2TAG1 ; - td_tag = (tx_flags & I40E_TX_FLAG_L2TAG1_MASK) >> -I40E_TX_FLAG_L2TAG1_SHIFT;Quoted 18 lines
drivers/net/i40e/i40e_rxtx.c +1
-0+ td_tag = tx_pkt->vlan_tci; }/* Always enable CRC offload insertion */ diff --git
a/drivers/net/i40e/i40e_rxtx.hb/drivers/net/i40e/i40e_rxtx.hindex 9df8a56..3d4abdc 100644drivers/net/i40e/i40e_rxtx.h +0
-2@@ -38,8 +38,6 @@* 32 bits tx flags, high 16 bits for L2TAG1 (VLAN), * low 16 bits for others. */ -#define I40E_TX_FLAG_L2TAG1_SHIFT 16 -#define I40E_TX_FLAG_L2TAG1_MASK 0xffff0000#define I40E_TX_FLAG_CSUM ((uint32_t)(1 << 0))#define I40E_TX_FLAG_INSERT_VLAN ((uint32_t)(1 << 1))#define I40E_TX_FLAG_TSYN ((uint32_t)(1 << 2))
PATCH 1/1 net/i40e: fix vlan insert code redundance
Hi, Ferruh
Quoted 7 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yang, Qiming
Sent: Friday, February 10, 2017 7:21 PM
To: Yigit, Ferruh <[email protected]>; [email protected]
Cc: Wu, Jingjing <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix vlan insert code redundance
Quoted 7 lines
Quoted 5 lines · Qiming Yang
Quoted 1 line
This patch removed useless
tx_flagsin vlan insertion.Overall this looks good, I wonder what was the initial intention of this code, understanding it helps to figure out if there is a hidden defect.
Thank you for your remind. I'll investigate it.
I have aligned with Helin (he contribute these code), and make sure these code is useless, these code is left by history.
Quoted 6 lines
Quoted 4 lines
This code not fixes a defect, but improves the code, is there any performance gain with this?
I'll do more test and give you a feedback.
According to my test, this code will not bring any obvious performance gain, and no lose also. And as you said this is not a bug fix, should I remove the fix line and modify the commit log?
Quoted 8 lines
Quoted 8 lines
If not, I am for deferring this to next release.
Quoted 5 lines
Fixes 4861cde46116 ("i40e: new poll mode driver")Signed-off-by Qiming Yang <[email protected]>---
Quoted 21 lines · Qiming
Hi, Ferruh
Quoted 7 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yang, Qiming
Sent: Friday, February 10, 2017 7:21 PM
To: Yigit, Ferruh <[email protected]>; [email protected]
Cc: Wu, Jingjing <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix vlan insert code redundanceQuoted 7 lines
Quoted 5 lines · Qiming Yang
Quoted 1 line
This patch removed useless
tx_flagsin vlan insertion.Overall this looks good, I wonder what was the initial intention of this code, understanding it helps to figure out if there is a hidden defect.
Thank you for your remind. I'll investigate it.
I have aligned with Helin (he contribute these code), and make sure these code is useless, these code is left by history.
Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This code not fixes a defect, but improves the code, is there any performance gain with this?
I'll do more test and give you a feedback.
According to my test, this code will not bring any obvious performance gain, and no lose also. And as you said this is not a bug fix, should I remove the fix line and modify the commit log?
Please do if you will send a new version already, no need to send a new version just for title update.
Thanks,
ferruh
Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
If not, I am for deferring this to next release.
Quoted 5 lines
Fixes 4861cde46116 ("i40e: new poll mode driver")Signed-off-by Qiming Yang <[email protected]>---
PATCH v2 1/1 net/i40e: remove redundant vlan insert code
In reply to Qiming YangThis patch removed useless tx_flags and related macros in vlan insertion.
---
v2 changes:
* removed I40E_TX_FLAG_INSERT_VLAN and modified the commit log.
--- drivers/net/i40e/i40e_rxtx.c | 8 +------- drivers/net/i40e/i40e_rxtx.h | 3 --- 2 files changed, 1 insertion(+), 10 deletions(-)
drivers/net/i40e/i40e_rxtx.c +1 -7
@@ -1034,7 +1034,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)uint16_t nb_tx;uint32_t td_cmd;uint32_t td_offset; -uint32_t tx_flags;uint32_t td_tag;uint64_t ol_flags;uint16_t nb_used;
@@ -1058,7 +1057,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) td_cmd =0 ; td_tag =0 ; td_offset =0 ; - tx_flags =0 ; tx_pkt = *tx_pkts++;RTE_MBUF_PREFETCH_TO_FREE (txe->mbuf);
@@ -1105,12 +1103,8 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)/* Descriptor based VLAN insertion */ if (ol_flags & (PKT_TX_VLAN_PKT |PKT_TX_QINQ_PKT )) { - tx_flags |= tx_pkt->vlan_tci << -I40E_TX_FLAG_L2TAG1_SHIFT ; - tx_flags |=I40E_TX_FLAG_INSERT_VLAN ; td_cmd |=I40E_TX_DESC_CMD_IL2TAG1 ; - td_tag = (tx_flags &I40E_TX_FLAG_L2TAG1_MASK ) >> -I40E_TX_FLAG_L2TAG1_SHIFT ; + td_tag = tx_pkt->vlan_tci; }/* Always enable CRC offload insertion */
drivers/net/i40e/i40e_rxtx.h +0 -3
@@ -38,10 +38,7 @@* 32 bits tx flags, high 16 bits for L2TAG1 (VLAN), * low 16 bits for others. */ -#define I40E_TX_FLAG_L2TAG1_SHIFT 16 -#define I40E_TX_FLAG_L2TAG1_MASK 0xffff0000#define I40E_TX_FLAG_CSUM ((uint32_t)(1 << 0)) -#define I40E_TX_FLAG_INSERT_VLAN ((uint32_t)(1 << 1))#define I40E_TX_FLAG_TSYN ((uint32_t)(1 << 2))#define RTE_PMD_I40E_RX_MAX_BURST 32
Signature · 1 line
2.7.4
Ferruh Yigit
AppliedRe: [PATCH v2] net/i40e: remove redundant vlan insert code
Quoted 4 lines · Qiming Yang
This patch removed useless
tx_flagsand related macros in vlan insertion.Signed-off-by Qiming Yang <[email protected]>
Applied to dpdk-next-net/master, thanks.
PATCH v2 1/1 net/i40e: remove redundant vlan insert code
In reply to Qiming YangThis patch removed useless tx_flags and related macros in vlan insertion.
---
v2 changes:
* removed I40E_TX_FLAG_INSERT_VLAN and modified the commit log.
--- drivers/net/i40e/i40e_rxtx.c | 8 +------- drivers/net/i40e/i40e_rxtx.h | 7 ------- 2 files changed, 1 insertion(+), 14 deletions(-)
drivers/net/i40e/i40e_rxtx.c +1 -7
@@ -1034,7 +1034,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)uint16_t nb_tx;uint32_t td_cmd;uint32_t td_offset; -uint32_t tx_flags;uint32_t td_tag;uint64_t ol_flags;uint16_t nb_used;
@@ -1058,7 +1057,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) td_cmd =0 ; td_tag =0 ; td_offset =0 ; - tx_flags =0 ; tx_pkt = *tx_pkts++;RTE_MBUF_PREFETCH_TO_FREE (txe->mbuf);
@@ -1105,12 +1103,8 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)/* Descriptor based VLAN insertion */ if (ol_flags & (PKT_TX_VLAN_PKT |PKT_TX_QINQ_PKT )) { - tx_flags |= tx_pkt->vlan_tci << -I40E_TX_FLAG_L2TAG1_SHIFT ; - tx_flags |=I40E_TX_FLAG_INSERT_VLAN ; td_cmd |=I40E_TX_DESC_CMD_IL2TAG1 ; - td_tag = (tx_flags &I40E_TX_FLAG_L2TAG1_MASK ) >> -I40E_TX_FLAG_L2TAG1_SHIFT ; + td_tag = tx_pkt->vlan_tci; }/* Always enable CRC offload insertion */
drivers/net/i40e/i40e_rxtx.h +0 -7
@@ -34,14 +34,7 @@#ifndef _I40E_RXTX_H_#define _I40E_RXTX_H_ -/** -* 32 bits tx flags, high 16 bits for L2TAG1 (VLAN), -* low 16 bits for others. -*/ -#define I40E_TX_FLAG_L2TAG1_SHIFT 16 -#define I40E_TX_FLAG_L2TAG1_MASK 0xffff0000#define I40E_TX_FLAG_CSUM ((uint32_t)(1 << 0)) -#define I40E_TX_FLAG_INSERT_VLAN ((uint32_t)(1 << 1))#define I40E_TX_FLAG_TSYN ((uint32_t)(1 << 2))#define RTE_PMD_I40E_RX_MAX_BURST 32
Signature · 1 line
2.7.4