Skip to contentSkip to conversation

common/octeontx2: reduce wait time for mbox messages

PATCH Applied Sunil Kumar Kori 2 participants 2 messages Dec 16, 2019 – Jan 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/octeontx2: reduce wait time for mbox messages

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.

---
 drivers/common/octeontx2/otx2_mbox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/common/octeontx2/otx2_mbox.c +2 -1
index c359bf42f..cc341aac3 100644
@@ -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 =
Signature · 1 line
2.17.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 6 lines · Sunil Kumar Kori

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.

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 22 lines
---
 drivers/common/octeontx2/otx2_mbox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/common/octeontx2/otx2_mbox.c +2 -2
index c359bf42f..cc341aac3 100644
@@ -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