common/octeontx2: reduce wait time for mbox messages

Message ID 20191216150253.22835-1-skori@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series common/octeontx2: reduce wait time for mbox messages |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation fail apply issues

Commit Message

Sunil Kumar Kori Dec. 16, 2019, 3:02 p.m. UTC
  After each mbox send operation, context waits for minimum 1ms to get
corresponding response although response can come earlier.
So reducing wait time to lower granularity.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 drivers/common/octeontx2/otx2_mbox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Jerin Jacob Jan. 14, 2020, 3:49 a.m. UTC | #1
On Mon, Dec 16, 2019 at 8:33 PM Sunil Kumar Kori <skori@marvell.com> wrote:
>
> After each mbox send operation, context waits for minimum 1ms to get
> corresponding response although response can come earlier.
> So reducing wait time to lower granularity.
>
> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>


Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/master. Thanks

> ---
>  drivers/common/octeontx2/otx2_mbox.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/common/octeontx2/otx2_mbox.c b/drivers/common/octeontx2/otx2_mbox.c
> index c359bf42f..cc341aac3 100644
> --- a/drivers/common/octeontx2/otx2_mbox.c
> +++ b/drivers/common/octeontx2/otx2_mbox.c
> @@ -278,8 +278,9 @@ mbox_wait(struct otx2_mbox *mbox, int devid, uint32_t rst_timo)
>         volatile struct otx2_mbox_dev *mdev = &mbox->dev[devid];
>         uint32_t timeout = 0, sleep = 1;
>
> +       rst_timo  = rst_timo * 1000; /* Milli seconds to micro seconds */
>         while (mdev->num_msgs > mdev->msgs_acked) {
> -               rte_delay_ms(sleep);
> +               rte_delay_us(sleep);
>                 timeout += sleep;
>                 if (timeout >= rst_timo) {
>                         struct mbox_hdr *tx_hdr =
> --
> 2.17.1
>
  

Patch

diff --git a/drivers/common/octeontx2/otx2_mbox.c b/drivers/common/octeontx2/otx2_mbox.c
index c359bf42f..cc341aac3 100644
--- a/drivers/common/octeontx2/otx2_mbox.c
+++ b/drivers/common/octeontx2/otx2_mbox.c
@@ -278,8 +278,9 @@  mbox_wait(struct otx2_mbox *mbox, int devid, uint32_t rst_timo)
 	volatile struct otx2_mbox_dev *mdev = &mbox->dev[devid];
 	uint32_t timeout = 0, sleep = 1;
 
+	rst_timo  = rst_timo * 1000; /* Milli seconds to micro seconds */
 	while (mdev->num_msgs > mdev->msgs_acked) {
-		rte_delay_ms(sleep);
+		rte_delay_us(sleep);
 		timeout += sleep;
 		if (timeout >= rst_timo) {
 			struct mbox_hdr *tx_hdr =