Skip to contentSkip to conversation

vdpa/mlx5: workaround FW first completion in start

PATCH Superseded Xueming Li 2 participants 16 messages Sep 23, 2021 – Oct 21, 2021

Subsystems (2)
lore
Share & tools
lore

Xueming Li

author
#0 lore raw

PATCH 1/2 vdpa/mlx5: workaround FW first completion in start

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

---
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +4 -0
index f530646058..71470d23d9 100644
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/mman.h>
+#include <sys/eventfd.h>
 
 #include <rte_malloc.h>
 #include <rte_errno.h>
@@ -367,6 +368,9 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
 		goto error;
 	}
 	virtq->stopped = false;
+	/* Initial notification to ask qemu handling completed buffers. */
+	if (virtq->eqp.cq.callfd != -1)
+		eventfd_write(virtq->eqp.cq.callfd, (eventfd_t)1);
 	DRV_LOG(DEBUG, "vid %u virtq %u was created successfully.", priv->vid,
 		index);
 	return 0;
Signature · 1 line
2.33.0
author
#1 lore raw

PATCH 1/2 vdpa/mlx5: workaround FW first completion in start

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

---
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +4 -0
index f530646058f..71470d23d9e 100644
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/mman.h>
+#include <sys/eventfd.h>
 
 #include <rte_malloc.h>
 #include <rte_errno.h>
@@ -367,6 +368,9 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
 		goto error;
 	}
 	virtq->stopped = false;
+	/* Initial notification to ask qemu handling completed buffers. */
+	if (virtq->eqp.cq.callfd != -1)
+		eventfd_write(virtq->eqp.cq.callfd, (eventfd_t)1);
 	DRV_LOG(DEBUG, "vid %u virtq %u was created successfully.", priv->vid,
 		index);
 	return 0;
Signature · 1 line
2.33.0
author
#2 lore raw

PATCH 2/2 vdpa/mlx5: retry VAR allocation during vDPA restart

VAR is the device memory space for the virtio queues doorbells, qemu could mmap it to directly to speed up doorbell push.

On a busy system, Qemu takes time to release VAR resources during driver shutdown. If vdpa restarted quickly, the VAR allocation failed with error 28 since the VAR is singleton resource per device.

This patch adds retry mechanism for VAR allocation.

---
 drivers/vdpa/mlx5/mlx5_vdpa.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +8 -1
index 6d17d7a6f3e..991739e9840 100644
@@ -693,7 +693,14 @@ mlx5_vdpa_dev_probe(struct rte_device *dev)
 	if (attr.num_lag_ports == 0)
 		priv->num_lag_ports = 1;
 	priv->ctx = ctx;
-	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+	for (retry = 0; retry < 7; retry++) {
+		priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+		if (priv->var != NULL)
+			break;
+		DRV_LOG(WARNING, "Failed to allocate VAR, retry %d.\n", retry);
+		/* Wait Qemu release VAR during vdpa restart, 0.1 sec based. */
+		usleep(100000U << retry);
+	}
 	if (!priv->var) {
 		DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
 		goto error;
Signature · 1 line
2.33.0
#3 lore raw
In reply to Xueming Li
Quoted 9 lines · Xueming Li

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

As I mentionned on my reply to the v1, I would expect a Fixes tag, it would make downstream maintainers life easier.

Maybe pointing to the commit introducing the function would help. this is not ideal, but otherwise the risk is that your patch get missed by the stable maintainers.

Thanks!
Maxime

Quoted 31 lines
---
  drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +4 -0
index f530646058f..71470d23d9e 100644
@@ -4,6 +4,7 @@
  #include <string.h>
  #include <unistd.h>
  #include <sys/mman.h>
+#include <sys/eventfd.h>
 
  #include <rte_malloc.h>
  #include <rte_errno.h>
@@ -367,6 +368,9 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
  		goto error;
  	}
  	virtq->stopped = false;
+	/* Initial notification to ask qemu handling completed buffers. */
+	if (virtq->eqp.cq.callfd != -1)
+		eventfd_write(virtq->eqp.cq.callfd, (eventfd_t)1);
  	DRV_LOG(DEBUG, "vid %u virtq %u was created successfully.", priv->vid,
  		index);
  	return 0;
#4 lore raw
Quoted 12 lines · Maxime Coquelin
Quoted 9 lines · Xueming Li

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

Quoted 6 lines

As I mentionned on my reply to the v1, I would expect a Fixes tag, it would make downstream maintainers life easier.

Maybe pointing to the commit introducing the function would help. this is not ideal, but otherwise the risk is that your patch get missed by the stable maintainers.

Yes, my bad, a Fixes tag should be helpful to identify which LTS need it, thanks!

Quoted 36 lines

Thanks!
Maxime

Quoted 31 lines
---
  drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +4 -0
index f530646058f..71470d23d9e 100644
@@ -4,6 +4,7 @@
  #include <string.h>
  #include <unistd.h>
  #include <sys/mman.h>
+#include <sys/eventfd.h>
 
  #include <rte_malloc.h>
  #include <rte_errno.h>
@@ -367,6 +368,9 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
  		goto error;
  	}
  	virtq->stopped = false;
+	/* Initial notification to ask qemu handling completed buffers. */
+	if (virtq->eqp.cq.callfd != -1)
+		eventfd_write(virtq->eqp.cq.callfd, (eventfd_t)1);
  	DRV_LOG(DEBUG, "vid %u virtq %u was created successfully.", priv->vid,
  		index);
  	return 0;
#5 lore raw
In reply to Xueming Li

Hi Xueming,

Quoted 29 lines · Xueming Li

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

---
  drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +1 -0
index f530646058..71470d23d9 100644
@@ -4,6 +4,7 @@
  #include <string.h>
  #include <unistd.h>
  #include <sys/mman.h>
+#include <sys/eventfd.h>
 
  #include <rte_malloc.h>
  #include <rte_errno.h>

drivers/vdpa/mlx5/mlx5_vdpa_virtq.c mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index) · line 376

Quoted 9 lines
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +3 -0
@@ -367,6 +368,9 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
  		goto error;
  	}
  	virtq->stopped = false;
+	/* Initial notification to ask qemu handling completed buffers. */
+	if (virtq->eqp.cq.callfd != -1)
+		eventfd_write(virtq->eqp.cq.callfd, (eventfd_t)1);
  	DRV_LOG(DEBUG, "vid %u virtq %u was created successfully.", priv->vid,
  		index);
  	return 0;

Maybe this patch should be backported to stable branch? If so, could you reply with the Fixes tag so that I can add it while applying?

Thanks,
Maxime

author
#6 lore raw

PATCH 2/2 vdpa/mlx5: retry VAR allocation during vDPA restart

In reply to Xueming Li

VAR is the device memory space for the virtio queues doorbells, qemu could mmap it to directly to speed up doorbell push.

On a busy system, Qemu takes time to release VAR resources during driver shutdown. If vdpa restarted quickly, the VAR allocation failed with error 28 since the VAR is singleton resource per device.

This patch adds retry mechanism for VAR allocation.

---
 drivers/vdpa/mlx5/mlx5_vdpa.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +8 -1
index 6d17d7a6f3..991739e984 100644
@@ -693,7 +693,14 @@ mlx5_vdpa_dev_probe(struct rte_device *dev)
 	if (attr.num_lag_ports == 0)
 		priv->num_lag_ports = 1;
 	priv->ctx = ctx;
-	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+	for (retry = 0; retry < 7; retry++) {
+		priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+		if (priv->var != NULL)
+			break;
+		DRV_LOG(WARNING, "Failed to allocate VAR, retry %d.\n", retry);
+		/* Wait Qemu release VAR during vdpa restart, 0.1 sec based. */
+		usleep(100000U << retry);
+	}
 	if (!priv->var) {
 		DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
 		goto error;
Signature · 1 line
2.33.0
#7 lore raw

Re: [dpdk-dev] [PATCH 2/2] vdpa/mlx5: retry VAR allocation during vDPA restart

Quoted 26 lines · Xueming Li

VAR is the device memory space for the virtio queues doorbells, qemu could mmap it to directly to speed up doorbell push.

On a busy system, Qemu takes time to release VAR resources during driver shutdown. If vdpa restarted quickly, the VAR allocation failed with error 28 since the VAR is singleton resource per device.

This patch adds retry mechanism for VAR allocation.

---
  drivers/vdpa/mlx5/mlx5_vdpa.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +1 -1
index 6d17d7a6f3..991739e984 100644
@@ -693,7 +693,14 @@ mlx5_vdpa_dev_probe(struct rte_device *dev)
  	if (attr.num_lag_ports == 0)
  		priv->num_lag_ports = 1;
  	priv->ctx = ctx;
-	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+	for (retry = 0; retry < 7; retry++) {

drivers/vdpa/mlx5/mlx5_vdpa.c mlx5_vdpa_dev_probe(struct rte_device *dev) · line 706

Quoted 10 lines
drivers/vdpa/mlx5/mlx5_vdpa.c +7 -0
+		priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+		if (priv->var != NULL)
+			break;
+		DRV_LOG(WARNING, "Failed to allocate VAR, retry %d.\n", retry);
+		/* Wait Qemu release VAR during vdpa restart, 0.1 sec based. */
+		usleep(100000U << retry);
+	}
  	if (!priv->var) {
  		DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
  		goto error;

That looks fragile, but at least we have a warning we can rely on. Shouldn't we have a way to wait for Qemu to release the resources at vdpa driver shutdown time?

Also as on patch 1, please add a Fixes tag it you want it to be backported.

Regards,
Maxime

#8 lore raw

Re: [dpdk-dev] [PATCH 2/2] vdpa/mlx5: retry VAR allocation during vDPA restart

Quoted 34 lines · Maxime Coquelin
Quoted 32 lines · Xueming Li

VAR is the device memory space for the virtio queues doorbells, qemu could mmap it to directly to speed up doorbell push.

On a busy system, Qemu takes time to release VAR resources during driver shutdown. If vdpa restarted quickly, the VAR allocation failed with error 28 since the VAR is singleton resource per device.

This patch adds retry mechanism for VAR allocation.

---
  drivers/vdpa/mlx5/mlx5_vdpa.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +8 -1
index 6d17d7a6f3..991739e984 100644
@@ -693,7 +693,14 @@ mlx5_vdpa_dev_probe(struct rte_device *dev)
  	if (attr.num_lag_ports == 0)
  		priv->num_lag_ports = 1;
  	priv->ctx = ctx;
-	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+	for (retry = 0; retry < 7; retry++) {
+		priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+		if (priv->var != NULL)
+			break;
+		DRV_LOG(WARNING, "Failed to allocate VAR, retry %d.\n", retry);
+		/* Wait Qemu release VAR during vdpa restart, 0.1 sec based. */
+		usleep(100000U << retry);
+	}
Quoted 8 lines

drivers/vdpa/mlx5/mlx5_vdpa.c mlx5_vdpa_dev_probe(struct rte_device *dev) · line 706

Quoted 4 lines
drivers/vdpa/mlx5/mlx5_vdpa.c +0 -0
  	if (!priv->var) {
  		DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
  		goto error;

That looks fragile, but at least we have a warning we can rely on. Shouldn't we have a way to wait for Qemu to release the resources at vdpa driver shutdown time?

If dpdk-vdpa get killed and restart, qemu will shutdown device and unmap the resources independently.

Quoted 3 lines

Also as on patch 1, please add a Fixes tag it you want it to be backported.

Agree to backport, but not a fix, I'll add cc:[email protected], the patch will be noticed by maintainer, thanks for the suggestion!

Quoted 4 lines

Regards,
Maxime

author
#9 lore raw

PATCH v2 1/2 vdpa/mlx5: workaround FW first completion in start

In reply to Xueming Li

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

Fixes bff735011078 ("vdpa/mlx5: prepare virtio queues")
---
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +4 -0
index f530646058f..71470d23d9e 100644
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/mman.h>
+#include <sys/eventfd.h>
 
 #include <rte_malloc.h>
 #include <rte_errno.h>
@@ -367,6 +368,9 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
 		goto error;
 	}
 	virtq->stopped = false;
+	/* Initial notification to ask qemu handling completed buffers. */
+	if (virtq->eqp.cq.callfd != -1)
+		eventfd_write(virtq->eqp.cq.callfd, (eventfd_t)1);
 	DRV_LOG(DEBUG, "vid %u virtq %u was created successfully.", priv->vid,
 		index);
 	return 0;
Signature · 1 line
2.33.0
author
#10 lore raw

PATCH v2 2/2 vdpa/mlx5: retry VAR allocation during vDPA restart

VAR is the device memory space for the virtio queues doorbells, qemu could mmap it to directly to speed up doorbell push.

On a busy system, Qemu takes time to release VAR resources during driver shutdown. If vdpa restarted quickly, the VAR allocation failed with error 28 since the VAR is singleton resource per device.

This patch adds retry mechanism for VAR allocation.

Fixes 4cae722c1b06 ("vdpa/mlx5: move virtual doorbell alloc to probe")
---
 drivers/vdpa/mlx5/mlx5_vdpa.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +8 -1
index 6d17d7a6f3e..991739e9840 100644
@@ -693,7 +693,14 @@ mlx5_vdpa_dev_probe(struct rte_device *dev)
 	if (attr.num_lag_ports == 0)
 		priv->num_lag_ports = 1;
 	priv->ctx = ctx;
-	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+	for (retry = 0; retry < 7; retry++) {
+		priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+		if (priv->var != NULL)
+			break;
+		DRV_LOG(WARNING, "Failed to allocate VAR, retry %d.\n", retry);
+		/* Wait Qemu release VAR during vdpa restart, 0.1 sec based. */
+		usleep(100000U << retry);
+	}
 	if (!priv->var) {
 		DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
 		goto error;
Signature · 1 line
2.33.0
Reviewed-by on v2 2/2
#11 lore raw

Re: [dpdk-dev] [PATCH v2 2/2] vdpa/mlx5: retry VAR allocation during vDPA restart

Quoted 29 lines · Xueming Li

VAR is the device memory space for the virtio queues doorbells, qemu could mmap it to directly to speed up doorbell push.

On a busy system, Qemu takes time to release VAR resources during driver shutdown. If vdpa restarted quickly, the VAR allocation failed with error 28 since the VAR is singleton resource per device.

This patch adds retry mechanism for VAR allocation.

Fixes 4cae722c1b06 ("vdpa/mlx5: move virtual doorbell alloc to probe")
---
  drivers/vdpa/mlx5/mlx5_vdpa.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +1 -1
index 6d17d7a6f3e..991739e9840 100644
@@ -693,7 +693,14 @@ mlx5_vdpa_dev_probe(struct rte_device *dev)
  	if (attr.num_lag_ports == 0)
  		priv->num_lag_ports = 1;
  	priv->ctx = ctx;
-	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+	for (retry = 0; retry < 7; retry++) {

drivers/vdpa/mlx5/mlx5_vdpa.c mlx5_vdpa_dev_probe(struct rte_device *dev) · line 706

Quoted 10 lines
drivers/vdpa/mlx5/mlx5_vdpa.c +7 -0
+		priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
+		if (priv->var != NULL)
+			break;
+		DRV_LOG(WARNING, "Failed to allocate VAR, retry %d.\n", retry);
+		/* Wait Qemu release VAR during vdpa restart, 0.1 sec based. */
+		usleep(100000U << retry);
+	}
  	if (!priv->var) {
  		DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
  		goto error;

Thanks,
Maxime

#12 lore raw

Re: [dpdk-dev] [PATCH v2 2/2] vdpa/mlx5: retry VAR allocation during vDPA restart

In reply to Xueming Li
Quoted 9 lines · Xueming Li

VAR is the device memory space for the virtio queues doorbells, qemu could mmap it to directly to speed up doorbell push.

On a busy system, Qemu takes time to release VAR resources during driver shutdown. If vdpa restarted quickly, the VAR allocation failed with error 28 since the VAR is singleton resource per device.

This patch adds retry mechanism for VAR allocation.

Quoted 8 lines
Fixes 4cae722c1b06 ("vdpa/mlx5: move virtual doorbell alloc to probe")
---
  drivers/vdpa/mlx5/mlx5_vdpa.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

Applied to dpdk-next-virtio/main.

Thanks,
Maxime

Reviewed-by on v2 1/2
#13 lore raw
In reply to Xueming Li
Quoted 9 lines · Xueming Li

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

Quoted 9 lines
Fixes bff735011078 ("vdpa/mlx5: prepare virtio queues")
---
  drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
  1 file changed, 4 insertions(+)

Thanks,
Maxime

#14 lore raw
In reply to Xueming Li
Quoted 9 lines · Xueming Li

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

Quoted 9 lines
Fixes bff735011078 ("vdpa/mlx5: prepare virtio queues")
---
  drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
  1 file changed, 4 insertions(+)

Applied to dpdk-next-virtio/main.

Thanks,
Maxime

#15 lore raw
Quoted 22 lines · Maxime Coquelin
Quoted 9 lines · Xueming Li

After a vDPA application restart, qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting.

As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers.

Quoted 9 lines
Fixes bff735011078 ("vdpa/mlx5: prepare virtio queues")
---
  drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++
  1 file changed, 4 insertions(+)
Quoted 1 line

Applied to dpdk-next-virtio/main.

Thanks Maxime!

Quoted 4 lines

Thanks,
Maxime