net/i40e: Improved FDIR programming times
PATCH v3 1/1 net/i40e: Improved FDIR programming times
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
---
v3:
* Code style fix
--- drivers/net/i40e/i40e_fdir.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/net/i40e/i40e_fdir.c +13 -8
@@ -1296,23 +1296,28 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) {if ((txdp->cmd_type_offset_bsz & -rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) == -rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE )) +rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) == +rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >= (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US )) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" time out to get DD on tx queue." ); +" time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) { +break ; + } +rte_delay_us (1 ); + }if (i40e_check_fdir_programming_status (rxq) <0 ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); +" programming status reported." );return -ENOSYS ; }
--
2.12.2
Disclaimer: This email and any files transmitted with it may contain confidential information intended for the addressee(s) only. The information is not to be surrendered or copied to unauthorized persons. If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
Hi,
Seems my comments in v2 are not addressed, add the comments here again.
Quoted 57 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Lilja
Sent: Wednesday, May 17, 2017 6:02 AM
To: [email protected]
Cc: Michael Lilja <[email protected]>
Subject: [dpdk-dev] [PATCH v3] net/i40e: Improved FDIR programming timesPreviously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of 22usec with a max of 60usec .Signed-off-by Michael Lilja <[email protected]>---
v3:
* Code style fix--- drivers/net/i40e/i40e_fdir.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)drivers/net/i40e/i40e_fdir.c index renamed from drivers/net/i40e/i40e_fdir.c +0
-0
28cc554f5..2162443f5100644drivers/net/i40e/i40e_fdir.c +2
-3@@ -1296,23 +1296,28 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT * +I40E_FDIR_WAIT_INTERVAL_US ); i++) { if ((txdp->cmd_type_offset_bsz & -
rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) ==
-rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))
+rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) ==
+rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))break;drivers/net/i40e/i40e_fdir.c +2
-1+rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >= (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US )){
PMD_DRV_LOG(ERR, "Failed to program FDIR filter:"drivers/net/i40e/i40e_fdir.c +1
-2- " time out to get DD on tx queue."); + " time out to get DD on tx queue.");return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ - rte_delay_us((I40E_FDIR_WAIT_COUNT - i) *
I40E_FDIR_WAIT_INTERVAL_US);
+ for (i = 0; i < (I40E_FDIR_WAIT_COUNT*I40E_FDIR_WAIT_INTERVAL_US); i++) {
drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf, · line 1314
Quoted 2 lines
drivers/net/i40e/i40e_fdir.c +2
-0+if (i40e_check_fdir_programming_status (rxq) >=0 ) { +break ;
Braces {} should be removed here according to the coding style. Besides, I think we can return 0 here directly.
drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf, · line 1318
Quoted 4 lines
drivers/net/i40e/i40e_fdir.c +3
-0+ } +rte_delay_us (1 ); + }if (i40e_check_fdir_programming_status (rxq) <0 ) {
This condition can be removed, just keep the following error log.
Quoted 14 lines
PMD_DRV_LOG(ERR, "Failed to program FDIR filter:"
drivers/net/i40e/i40e_fdir.c +1
-2- " programming status reported."); + " programming status reported.");return -ENOSYS ; } --2.12.2
Disclaimer: This email and any files transmitted with it may contain confidential information intended for the addressee(s) only. The information is not to be surrendered or copied to unauthorized persons. If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
Quoted 3 lines · Beilei
Hi,
Seems my comments in v2 are not addressed, add the comments here again.
Hi Michael,
And can you please use "--in-reply-to" option of the git send-email when sending the new version of the patch.
To make new version of the patch in same mail thread, as a reply to previous version.
Thanks,
ferruh
Quoted 13 lines
Quoted 13 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Lilja
Sent: Wednesday, May 17, 2017 6:02 AM
To: [email protected]
Cc: Michael Lilja <[email protected]>
Subject: [dpdk-dev] [PATCH v3] net/i40e: Improved FDIR programming timesPreviously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of 22usec with a max of 60usec .Signed-off-by Michael Lilja <[email protected]>
<...>
PATCH v4 1/1 net/i40e: improved FDIR programming times
In reply to Michael LiljaPreviously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
---
v4:
* Code style fix
---
--- drivers/net/i40e/i40e_fdir.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/i40e/i40e_fdir.c +10 -10
@@ -1296,27 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >= (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US )) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ENOSYS ; }/*
Signature · 1 line
2.12.2
Re: [PATCH v4] net/i40e: improved FDIR programming times
Hi Michael,
Quoted 48 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Lilja
Sent: Wednesday, May 17, 2017 5:12 PM
To: [email protected]
Cc: Michael Lilja <[email protected]>
Subject: [dpdk-dev] [PATCH v4] net/i40e: improved FDIR programming timesPreviously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of 22usec with a max of 60usec .Signed-off-by Michael Lilja <[email protected]>---
v4:
* Code style fix
------ drivers/net/i40e/i40e_fdir.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)drivers/net/i40e/i40e_fdir.c index renamed from drivers/net/i40e/i40e_fdir.c +0
-0
28cc554f5..32f6aeafb100644drivers/net/i40e/i40e_fdir.c +4
-3@@ -1296,27 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); +i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >= (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US )) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ;
drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf, · line 1319
Quoted 10 lines
drivers/net/i40e/i40e_fdir.c +1
-5}/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) * I40E_FDIR_WAIT_INTERVAL_US); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) {
To keep the original intention, "i" shouldn't be set to 0 again but keep above value. Please refer to " rte_delay_us((I40E_FDIR_WAIT_COUNT - i) *> I40E_FDIR_WAIT_INTERVAL_US)". Sorry for missing it before.
Overall it's OK for me, thanks.
Beilei
PATCH v5 1/1 net/i40e: improved FDIR programming times
In reply to Michael LiljaPreviously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
---
v5:
* Reinitialization of "i" inconsistent with original intent
---
--- drivers/net/i40e/i40e_fdir.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/i40e/i40e_fdir.c +10 -10
@@ -1296,27 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >= (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US )) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ENOSYS ; }/*
Signature · 1 line
2.12.2
Re: [PATCH v5] net/i40e: improved FDIR programming times
Hi,
Quoted 7 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Lilja
Sent: Wednesday, May 17, 2017 6:38 PM
To: [email protected]
Cc: Michael Lilja <[email protected]>
Subject: [dpdk-dev] [PATCH v5] net/i40e: improved FDIR programming times
Quoted 5 lines
Previously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of 22usec with a max of 60usec .Signed-off-by Michael Lilja <[email protected]>
Re: [PATCH v5] net/i40e: improved FDIR programming times
In reply to Michael LiljaQuoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>
Please keeps maintainers in CC while sending patches.
Quoted 4 lines
---
v5:
* Reinitialization of "i" inconsistent with original intent
It can be useful to keep history about older versions.
Quoted 1 line
---
There are two checkpatch warnings, can you please fix them [1], you can keep Beilei's ack in next version.
[1]
WARNING:LONG_LINE: line over 80 characters
#39: FILE: drivers/net/i40e/i40e_fdir.c:1299:
+ for (i = 0; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US); i++) {
WARNING:ENOSYS: ENOSYS means 'invalid syscall nr' and nothing else #67: FILE: drivers/net/i40e/i40e_fdir.c:1319:
+ return -ENOSYS;
<...>
PATCH v6 1/1 net/i40e: improved FDIR programming times
In reply to Michael LiljaPreviously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
---
v6:
* Fixed code style issues
v5:
* Reinitialization of "i" inconsistent with original intent
v4:
* Code style fix
v3:
* Replaced commit message
v2:
* Code style fix
v1:
* Initial version
---
--- drivers/net/i40e/i40e_fdir.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/net/i40e/i40e_fdir.c +13 -13
@@ -1295,28 +1295,28 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); + i =0 ; +for (; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) {if ((txdp->cmd_type_offset_bsz & -rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) == -rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE )) +rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) == +rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >= (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US )) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/*
Signature · 1 line
2.12.2
Re: [PATCH v6] net/i40e: improved FDIR programming times
Quoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>
Please cc maintainers in the patch.
Quoted 29 lines
---
v6:
* Fixed code style issuesv5:
* Reinitialization of "i" inconsistent with original intentv4:
* Code style fixv3:
* Replaced commit messagev2:
* Code style fixv1:
* Initial version
------ drivers/net/i40e/i40e_fdir.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)drivers/net/i40e/i40e_fdir.c +0
-0
drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf, · line 1298
Quoted 7 lines
drivers/net/i40e/i40e_fdir.c +1
-3@@ -1295,28 +1295,28 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); + i =0 ;
This is extracted out of "for" to stay in 80 columns limit, but instead what do you think:
Create a variable, something like "wait_us_count":wait_us_count = I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTERVAL_US;
and used it below three times, and lines will stay in limit.
drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf, · line 1302
Quoted 6 lines
drivers/net/i40e/i40e_fdir.c +3
-2+for (; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) {if ((txdp->cmd_type_offset_bsz & -rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) == -rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE )) +rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) == +rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))
Old indentation was correct I think, that is to differentiate the code in below line easily.
Quoted 29 lines
drivers/net/i40e/i40e_fdir.c +9
-8break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >= (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US )) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i < (I40E_FDIR_WAIT_COUNT *I40E_FDIR_WAIT_INTERVAL_US ); i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/*
PATCH v7 1/1 net/i40e: improved FDIR programming times
In reply to Michael LiljaPreviously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
---
v7:
* Code style changes
v6:
* Fixed code style issues
v5:
* Reinitialization of "i" inconsistent with original intent
v4:
* Code style fix
v3:
* Replaced commit message
v2:
* Code style fix
v1:
* Initial version
---
--- drivers/net/i40e/i40e_fdir.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/net/i40e/i40e_fdir.c +11 -11
@@ -76,6 +76,7 @@/* Wait count and interval for fdir filter programming */ #define I40E_FDIR_WAIT_COUNT 10#define I40E_FDIR_WAIT_INTERVAL_US 1000 +#define I40E_FDIR_MAX_WAIT (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTERVAL_US)/* Wait count and interval for fdir filter flush */ #define I40E_FDIR_FLUSH_RETRY 50
@@ -1295,28 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i <I40E_FDIR_MAX_WAIT ; i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >=I40E_FDIR_MAX_WAIT ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/*
Signature · 1 line
2.12.2
Re: [PATCH v7] net/i40e: improved FDIR programming times
Quoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>
Sorry for multiple, minor change requests ...
Quoted 32 lines
---
v7:
* Code style changesv6:
* Fixed code style issuesv5:
* Reinitialization of "i" inconsistent with original intentv4:
* Code style fixv3:
* Replaced commit messagev2:
* Code style fixv1:
* Initial version
------ drivers/net/i40e/i40e_fdir.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)drivers/net/i40e/i40e_fdir.c +0
-0
drivers/net/i40e/i40e_fdir.c line 79
Quoted 4 lines
drivers/net/i40e/i40e_fdir.c +1
-0@@ -76,6 +76,7 @@/* Wait count and interval for fdir filter programming */ #define I40E_FDIR_WAIT_COUNT 10#define I40E_FDIR_WAIT_INTERVAL_US 1000 +#define I40E_FDIR_MAX_WAIT (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTERVAL_US)
It looks like I40E_FDIR_WAIT_COUNT and I40E_FDIR_WAIT_INTERVAL_US not used anywhere else, is there any value to keep them?
why not:
#define I40E_FDIR_MAX_WAIT_US 10000 /* 10 ms */
Quoted 43 lines
drivers/net/i40e/i40e_fdir.c +10
-11/* Wait count and interval for fdir filter flush */ #define I40E_FDIR_FLUSH_RETRY 50@@ -1295,28 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i <I40E_FDIR_MAX_WAIT ; i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >=I40E_FDIR_MAX_WAIT ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/*
Re: [PATCH v7] net/i40e: improved FDIR programming times
It's ok. I didn't write the original code so I cannot tell why the two defines were made in the initial case. It make sense to remove them, but the maintainers must have had a reason, maybe they are needed in a future version of the code?
/Michael
-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: 17 May 2017 16:44
To: Michael Lilja <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7] net/i40e: improved FDIR programming times
Quoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>
Sorry for multiple, minor change requests ...
Quoted 32 lines
---
v7:
* Code style changesv6:
* Fixed code style issuesv5:
* Reinitialization of "i" inconsistent with original intentv4:
* Code style fixv3:
* Replaced commit messagev2:
* Code style fixv1:
* Initial version
------ drivers/net/i40e/i40e_fdir.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_fdir.cindex28cc554f5..1192d5831100644
drivers/net/i40e/i40e_fdir.c line 80
Quoted 5 lines
drivers/net/i40e/i40e_fdir.c +2
-0@@ -76,6 +76,7 @@/* Wait count and interval for fdir filter programming */ #define I40E_FDIR_WAIT_COUNT 10#define I40E_FDIR_WAIT_INTERVAL_US 1000 +#define I40E_FDIR_MAX_WAIT (I40E_FDIR_WAIT_COUNT * +I40E_FDIR_WAIT_INTERVAL_US)
It looks like I40E_FDIR_WAIT_COUNT and I40E_FDIR_WAIT_INTERVAL_US not used anywhere else, is there any value to keep them?
why not:
#define I40E_FDIR_MAX_WAIT_US 10000 /* 10 ms */
Quoted 43 lines
drivers/net/i40e/i40e_fdir.c +10
-11/* Wait count and interval for fdir filter flush */ #define I40E_FDIR_FLUSH_RETRY 50@@ -1295,28 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i <I40E_FDIR_MAX_WAIT ; i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >=I40E_FDIR_MAX_WAIT ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/*
Re: [PATCH v7] net/i40e: improved FDIR programming times
Quoted 1 line · Michael Lilja
It's ok. I didn't write the original code so I cannot tell why the two defines were made in the initial case. It make sense to remove them, but the maintainers must have had a reason, maybe they are needed in a future version of the code?
In original code, they have a meaning:
for (i = 0; i < I40E_FDIR_WAIT_COUNT; i++)
rte_delay_us(I40E_FDIR_WAIT_INTERVAL_US);
wait step is I40E_FDIR_WAIT_INTERVAL_US.
But you changed to fixes 1us stepping. So WAIT_COUNT and WAIT_INTERVAL_US are no more meaningful. And since they are not used anywhere else, I think they can go away.
And we can wait from maintainers ack for any "plan to use in the future" case.
Thanks,
ferruh
Quoted 108 lines
/Michael
-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: 17 May 2017 16:44
To: Michael Lilja <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7] net/i40e: improved FDIR programming timesQuoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>Sorry for multiple, minor change requests ...
Quoted 32 lines
---
v7:
* Code style changesv6:
* Fixed code style issuesv5:
* Reinitialization of "i" inconsistent with original intentv4:
* Code style fixv3:
* Replaced commit messagev2:
* Code style fixv1:
* Initial version
------ drivers/net/i40e/i40e_fdir.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_fdir.cindex28cc554f5..1192d5831100644drivers/net/i40e/i40e_fdir.c line 80
Quoted 5 lines
drivers/net/i40e/i40e_fdir.c +2
-0@@ -76,6 +76,7 @@/* Wait count and interval for fdir filter programming */ #define I40E_FDIR_WAIT_COUNT 10#define I40E_FDIR_WAIT_INTERVAL_US 1000 +#define I40E_FDIR_MAX_WAIT (I40E_FDIR_WAIT_COUNT * +I40E_FDIR_WAIT_INTERVAL_US)It looks like
I40E_FDIR_WAIT_COUNTandI40E_FDIR_WAIT_INTERVAL_USnot used anywhere else, is there any value to keep them?why not:
#defineI40E_FDIR_MAX_WAIT_US10000 /* 10 ms */Quoted 33 lines
drivers/net/i40e/i40e_fdir.c +6
-9/* Wait count and interval for fdir filter flush */ #define I40E_FDIR_FLUSH_RETRY 50@@ -1295,28 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i <I40E_FDIR_MAX_WAIT ; i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >=I40E_FDIR_MAX_WAIT ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ;drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf, · line 1322
Quoted 10 lines
drivers/net/i40e/i40e_fdir.c +4
-2+rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/* Disclaimer: This email and any files transmitted with it may contain confidential information intended for the addressee(s) only. The information is not to be surrendered or copied to unauthorized persons. If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
Re: [PATCH v7] net/i40e: improved FDIR programming times
Ok, I'll make a v8 removing the define.
/Michael
-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: 17 May 2017 16:50
To: Michael Lilja <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7] net/i40e: improved FDIR programming times
Quoted 1 line · Michael Lilja
It's ok. I didn't write the original code so I cannot tell why the two defines were made in the initial case. It make sense to remove them, but the maintainers must have had a reason, maybe they are needed in a future version of the code?
In original code, they have a meaning:
for (i = 0; i < I40E_FDIR_WAIT_COUNT; i++)
rte_delay_us(I40E_FDIR_WAIT_INTERVAL_US);
wait step is I40E_FDIR_WAIT_INTERVAL_US.
But you changed to fixes 1us stepping. So WAIT_COUNT and WAIT_INTERVAL_US are no more meaningful. And since they are not used anywhere else, I think they can go away.
And we can wait from maintainers ack for any "plan to use in the future" case.
Thanks,
ferruh
Quoted 108 lines
/Michael
-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: 17 May 2017 16:44
To: Michael Lilja <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7] net/i40e: improved FDIR programming timesQuoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>Sorry for multiple, minor change requests ...
Quoted 32 lines
---
v7:
* Code style changesv6:
* Fixed code style issuesv5:
* Reinitialization of "i" inconsistent with original intentv4:
* Code style fixv3:
* Replaced commit messagev2:
* Code style fixv1:
* Initial version
------ drivers/net/i40e/i40e_fdir.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_fdir.cindex28cc554f5..1192d5831100644drivers/net/i40e/i40e_fdir.c line 80
Quoted 5 lines
drivers/net/i40e/i40e_fdir.c +2
-0@@ -76,6 +76,7 @@/* Wait count and interval for fdir filter programming */ #define I40E_FDIR_WAIT_COUNT 10#define I40E_FDIR_WAIT_INTERVAL_US 1000 +#define I40E_FDIR_MAX_WAIT (I40E_FDIR_WAIT_COUNT * +I40E_FDIR_WAIT_INTERVAL_US)It looks like
I40E_FDIR_WAIT_COUNTandI40E_FDIR_WAIT_INTERVAL_USnot used anywhere else, is there any value to keep them?why not:
#defineI40E_FDIR_MAX_WAIT_US10000 /* 10 ms */Quoted 31 lines
drivers/net/i40e/i40e_fdir.c +3
-5/* Wait count and interval for fdir filter flush */ #define I40E_FDIR_FLUSH_RETRY 50@@ -1295,28 +1296,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i <I40E_FDIR_MAX_WAIT ; i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >=I40E_FDIR_MAX_WAIT ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us((I40E_FDIR_WAIT_COUNT - i) *
I40E_FDIR_WAIT_INTERVAL_US); -if
(i40e_check_fdir_programming_status(rxq)< 0) { -PMD_DRV_LOG(ERR, "Failed to program FDIR filter:"drivers/net/i40e/i40e_fdir.c +2
-2- " programming status reported."); -return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT ; i++) {if +(i40e_check_fdir_programming_status (rxq) >=0 )return 0 ;drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf, · line 1322
Quoted 10 lines
drivers/net/i40e/i40e_fdir.c +4
-2+rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/* Disclaimer: This email and any files transmitted with it may contain confidential information intended for the addressee(s) only. The information is not to be surrendered or copied to unauthorized persons. If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
PATCH v8 1/1 net/i40e: improved FDIR programming times
In reply to Michael LiljaPreviously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
---
v8:
* Merged two defines into one handling max wait time
v7:
* Code style changes
v6:
* Fixed code style issues
v5:
* Reinitialization of "i" inconsistent with original intent
v4:
* Code style fix
v3:
* Replaced commit message
v2:
* Code style fix
v1:
* Initial version
---
--- drivers/net/i40e/i40e_fdir.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/net/i40e/i40e_fdir.c +12 -14
@@ -73,9 +73,8 @@#define I40E_FDIR_IPv6_PAYLOAD_LEN 380#define I40E_FDIR_UDP_DEFAULT_LEN 400 -/* Wait count and interval for fdir filter programming */ -#define I40E_FDIR_WAIT_COUNT 10 -#define I40E_FDIR_WAIT_INTERVAL_US 1000 +/* Wait time for fdir filter programming */ +#define I40E_FDIR_MAX_WAIT_US 10000/* Wait count and interval for fdir filter flush */ #define I40E_FDIR_FLUSH_RETRY 50
@@ -1295,28 +1294,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i <I40E_FDIR_MAX_WAIT_US ; i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >=I40E_FDIR_MAX_WAIT_US ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT_US ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ; }/*
Signature · 1 line
2.12.2
Re: [PATCH v8] net/i40e: improved FDIR programming times
Quoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>
<...>
Quoted 5 lines
drivers/net/i40e/i40e_fdir.c +0
-4/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." );
drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf,
Quoted 10 lines
drivers/net/i40e/i40e_fdir.c +6
-3-return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT_US ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" + " programming status reported."
I am aware that you just moved this log, but since you have touched to it, can you please fix it too [1]:
PMD_DRV_LOG(ERR,
"Failed to program FDIR filter: programming status reported.");
[1] Or if you prefer please let me know, so I can fix it while applying.
Quoted 5 lines
drivers/net/i40e/i40e_fdir.c +1
-0+return -ETIMEDOUT ; }/*
Re: [PATCH v8] net/i40e: improved FDIR programming times
Please fix while applying.
-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: 17 May 2017 17:17
To: Michael Lilja <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v8] net/i40e: improved FDIR programming times
Quoted 5 lines · Michael Lilja
Previously, the FDIR programming time is +11ms on i40e. This patch will result in an average programming time of 22usec with a max of 60usec .
Signed-off-by Michael Lilja <[email protected]>
<...>
Quoted 5 lines
drivers/net/i40e/i40e_fdir.c +0
-4/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) *I40E_FDIR_WAIT_INTERVAL_US ); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." );
drivers/net/i40e/i40e_fdir.c i40e_fdir_filter_programming(struct i40e_pf *pf,
Quoted 10 lines
drivers/net/i40e/i40e_fdir.c +6
-3-return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT_US ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" + " programming status reported."
I am aware that you just moved this log, but since you have touched to it, can you please fix it too [1]:
PMD_DRV_LOG(ERR,
"Failed to program FDIR filter: programming status reported.");
[1] Or if you prefer please let me know, so I can fix it while applying.
Quoted 5 lines
drivers/net/i40e/i40e_fdir.c +1
-0+return -ETIMEDOUT ; }/*
Re: [PATCH v8] net/i40e: improved FDIR programming times
In reply to Michael LiljaHi,
Quoted 100 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Lilja
Sent: Wednesday, May 17, 2017 10:58 PM
To: Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]; Michael Lilja <[email protected]>
Subject: [dpdk-dev] [PATCH v8] net/i40e: improved FDIR programming timesPreviously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of 22usec with a max of 60usec .Signed-off-by Michael Lilja <[email protected]>---
v8:
* Merged two defines into one handling max wait timev7:
* Code style changesv6:
* Fixed code style issuesv5:
* Reinitialization of "i" inconsistent with original intentv4:
* Code style fixv3:
* Replaced commit messagev2:
* Code style fixv1:
* Initial version
------ drivers/net/i40e/i40e_fdir.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)drivers/net/i40e/i40e_fdir.c index renamed from drivers/net/i40e/i40e_fdir.c +0
-0
28cc554f5..f94e1c3b8100644drivers/net/i40e/i40e_fdir.c +12
-14@@ -73,9 +73,8 @@#define I40E_FDIR_IPv6_PAYLOAD_LEN 380#define I40E_FDIR_UDP_DEFAULT_LEN 400 -/* Wait count and interval for fdir filter programming */ -#define I40E_FDIR_WAIT_COUNT 10 -#define I40E_FDIR_WAIT_INTERVAL_US 1000 +/* Wait time for fdir filter programming */ #define +I40E_FDIR_MAX_WAIT_US 10000/* Wait count and interval for fdir filter flush */ #define I40E_FDIR_FLUSH_RETRY 50@@ -1295,28 +1294,27 @@ i40e_fdir_filter_programming(struct i40e_pf *pf,/* Update the tx tail register */ rte_wmb ();I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); - -for (i =0 ; i <I40E_FDIR_WAIT_COUNT ; i++) { -rte_delay_us (I40E_FDIR_WAIT_INTERVAL_US ); +for (i =0 ; i <I40E_FDIR_MAX_WAIT_US ; i++) {if ((txdp->cmd_type_offset_bsz &rte_cpu_to_le_64 (I40E_TXD_QW1_DTYPE_MASK )) ==rte_cpu_to_le_64 (I40E_TX_DESC_DTYPE_DESC_DONE ))break ; +rte_delay_us (1 ); } -if (i >=I40E_FDIR_WAIT_COUNT ) { +if (i >=I40E_FDIR_MAX_WAIT_US ) {PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" " time out to get DD on tx queue." );return -ETIMEDOUT ; }/* totally delay 10 ms to check programming status*/ -rte_delay_us ((I40E_FDIR_WAIT_COUNT - i) * I40E_FDIR_WAIT_INTERVAL_US); -if (i40e_check_fdir_programming_status (rxq) <0 ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" programming status reported." ); -return -ENOSYS ; +for (; i <I40E_FDIR_MAX_WAIT_US ; i++) { +if (i40e_check_fdir_programming_status (rxq) >=0 ) +return 0 ; +rte_delay_us (1 ); } - -return 0 ; +PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" +" programming status reported." ); +return -ETIMEDOUT ;}
Quoted 3 lines
/*
--
2.12.2
Ferruh Yigit
AppliedRe: [PATCH v8] net/i40e: improved FDIR programming times
Quoted 10 lines · Beilei
Hi,
Quoted 8 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Lilja
Sent: Wednesday, May 17, 2017 10:58 PM
To: Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]; Michael Lilja <[email protected]>
Subject: [dpdk-dev] [PATCH v8] net/i40e: improved FDIR programming times
Quoted 7 lines
Quoted 5 lines
Previously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of 22usec with a max of 60usec .Signed-off-by Michael Lilja <[email protected]>Acked-by Beilei Xing <[email protected]>
Applied to dpdk-next-net/master, thanks.