@@ -577,17 +577,16 @@ otx2_pf_vf_mbox_irq(void *param)
intr = otx2_read64(dev->bar2 + RVU_VF_INT);
if (intr == 0)
- return;
+ otx2_base_dbg("Proceeding to check mbox UP messages if any");
otx2_write64(intr, dev->bar2 + RVU_VF_INT);
otx2_base_dbg("Irq 0x%" PRIx64 "(pf:%d,vf:%d)", intr, dev->pf, dev->vf);
- if (intr) {
- /* First process all configuration messages */
- otx2_process_msgs(dev, dev->mbox);
- /* Process Uplink messages */
- otx2_process_msgs_up(dev, &dev->mbox_up);
- }
+ /* First process all configuration messages */
+ otx2_process_msgs(dev, dev->mbox);
+
+ /* Process Uplink messages */
+ otx2_process_msgs_up(dev, &dev->mbox_up);
}
static void
@@ -598,18 +597,16 @@ otx2_af_pf_mbox_irq(void *param)
intr = otx2_read64(dev->bar2 + RVU_PF_INT);
if (intr == 0)
- return;
+ otx2_base_dbg("Proceeding to check mbox UP messages if any");
otx2_write64(intr, dev->bar2 + RVU_PF_INT);
-
otx2_base_dbg("Irq 0x%" PRIx64 "(pf:%d,vf:%d)", intr, dev->pf, dev->vf);
- if (intr) {
- /* First process all configuration messages */
- otx2_process_msgs(dev, dev->mbox);
- /* Process Uplink messages */
- otx2_process_msgs_up(dev, &dev->mbox_up);
- }
+ /* First process all configuration messages */
+ otx2_process_msgs(dev, dev->mbox);
+
+ /* Process Uplink messages */
+ otx2_process_msgs_up(dev, &dev->mbox_up);
}
static int
@@ -9,6 +9,7 @@
#include <stdbool.h>
#include <rte_ether.h>
+#include <rte_interrupts.h>
#include <rte_spinlock.h>
#include <otx2_common.h>
@@ -1627,28 +1628,40 @@ static inline int
otx2_mbox_process(struct otx2_mbox *mbox)
{
otx2_mbox_msg_send(mbox, 0);
- return otx2_mbox_get_rsp(mbox, 0, NULL);
+ if (rte_thread_is_intr())
+ return otx2_mbox_get_rsp_poll(mbox, 0, NULL);
+ else
+ return otx2_mbox_get_rsp(mbox, 0, NULL);
}
static inline int
otx2_mbox_process_msg(struct otx2_mbox *mbox, void **msg)
{
otx2_mbox_msg_send(mbox, 0);
- return otx2_mbox_get_rsp(mbox, 0, msg);
+ if (rte_thread_is_intr())
+ return otx2_mbox_get_rsp_poll(mbox, 0, msg);
+ else
+ return otx2_mbox_get_rsp(mbox, 0, msg);
}
static inline int
otx2_mbox_process_tmo(struct otx2_mbox *mbox, uint32_t tmo)
{
otx2_mbox_msg_send(mbox, 0);
- return otx2_mbox_get_rsp_tmo(mbox, 0, NULL, tmo);
+ if (rte_thread_is_intr())
+ return otx2_mbox_get_rsp_poll_tmo(mbox, 0, NULL, tmo);
+ else
+ return otx2_mbox_get_rsp_tmo(mbox, 0, NULL, tmo);
}
static inline int
otx2_mbox_process_msg_tmo(struct otx2_mbox *mbox, void **msg, uint32_t tmo)
{
otx2_mbox_msg_send(mbox, 0);
- return otx2_mbox_get_rsp_tmo(mbox, 0, msg, tmo);
+ if (rte_thread_is_intr())
+ return otx2_mbox_get_rsp_poll_tmo(mbox, 0, msg, tmo);
+ else
+ return otx2_mbox_get_rsp_tmo(mbox, 0, msg, tmo);
}
int otx2_send_ready_msg(struct otx2_mbox *mbox, uint16_t *pf_func /* out */);