summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2023-06-05 09:01:45 +0000
committersongyanchao <[email protected]>2023-06-05 09:01:45 +0000
commit1b45a4cfaefcfd18b2e396ffb86fd3fb024c9f81 (patch)
tree4d4fd3830dc4a86309cd653145a02d40071e9295
parent1e5c394b081bd21a235f9c7d3e9a0e93573b6235 (diff)
🐞 fix(TSG-15352): fix the marsio_recv_burstv4.6.25-20230605
fix the marsio_recv_burst
-rw-r--r--app/include/tap.h2
-rw-r--r--app/src/rawio.c10
-rw-r--r--app/src/tap.c14
3 files changed, 13 insertions, 13 deletions
diff --git a/app/include/tap.h b/app/include/tap.h
index 249304a..56a9f77 100644
--- a/app/include/tap.h
+++ b/app/include/tap.h
@@ -3,4 +3,4 @@
#include <mrapp.h>
int tap_representor_init(struct mr_instance * mr_instance, struct mr_vdev * vdev);
-int tap_representor_entry(struct mr_vdev * vdev, unsigned int qid, marsio_buff_t * buffs[], unsigned int nr_buffs); \ No newline at end of file
+int tap_representor_entry(struct mr_vdev * vdev, unsigned int qid, struct rte_mbuf * buffs[], unsigned int nr_buffs);
diff --git a/app/src/rawio.c b/app/src/rawio.c
index f900f62..4eaba21 100644
--- a/app/src/rawio.c
+++ b/app/src/rawio.c
@@ -5,12 +5,12 @@
#include <mrapp.h>
#include <protect.h>
#include <rte_epoll.h>
-#include <sys/epoll.h>
#include <rte_ip.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_udp.h>
#include <sendpath.h>
+#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <unistd.h>
@@ -63,7 +63,7 @@ int marsio_recv_burst(struct mr_vdev * vdev, queue_id_t qid, marsio_buff_t * mbu
int nr_rx_mbufs = vnode_mirror_dequeue_burst(vdi->vnode_rx_cons, qid, rx_buffer->mbufs, (int)rx_buffer->size);
if (vdev->tap_representor != NULL)
{
- tap_representor_entry(vdev, qid, mbufs, nr_rx_mbufs);
+ tap_representor_entry(vdev, qid, rx_buffer->mbufs, nr_rx_mbufs);
}
for (int i = 0; i < nr_rx_mbufs; i++)
@@ -233,7 +233,7 @@ int marsio_poll_wait(struct mr_instance * instance, struct mr_vdev * vdevs[], un
eventfd_t _not_use_eventfd_value;
- if(instance->en_notify == 0)
+ if (instance->en_notify == 0)
{
return 0;
}
@@ -248,7 +248,7 @@ int marsio_poll_wait(struct mr_instance * instance, struct mr_vdev * vdevs[], un
}
/* flush the vdev */
- for(unsigned int i = 0; i < nr_vdevs; i++)
+ for (unsigned int i = 0; i < nr_vdevs; i++)
{
marsio_send_buffer_flush(vdevs[i], tid);
}
@@ -302,4 +302,4 @@ int marsio_poll_wait(struct mr_instance * instance, struct mr_vdev * vdevs[], un
}
return 0;
-} \ No newline at end of file
+}
diff --git a/app/src/tap.c b/app/src/tap.c
index bb0c131..e389a90 100644
--- a/app/src/tap.c
+++ b/app/src/tap.c
@@ -5,9 +5,9 @@
#include <rte_ether.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
+#include <sys/epoll.h>
#include <sys/socket.h>
#include <sys/types.h>
-#include <sys/epoll.h>
#include <assert.h>
#include <fcntl.h>
@@ -192,7 +192,8 @@ static int tap_device_rx(struct tap_device * tap_dev, unsigned int queue_id, mar
return 1;
}
-static struct tap_device * tap_device_create(struct mr_instance * mr_instance, const char * name, struct rte_ether_addr * hwaddr)
+static struct tap_device * tap_device_create(struct mr_instance * mr_instance, const char * name,
+ struct rte_ether_addr * hwaddr)
{
struct tap_device * tap_dev_inst = rte_zmalloc(NULL, sizeof(struct tap_device), 0);
MR_VERIFY_MALLOC(tap_dev_inst);
@@ -345,21 +346,20 @@ errout:
return (void *)NULL;
}
-int tap_representor_entry(struct mr_vdev * vdev, unsigned int qid, marsio_buff_t * buffs[], unsigned int nr_buffs)
+int tap_representor_entry(struct mr_vdev * vdev, unsigned int qid, struct rte_mbuf * buffs[], unsigned int nr_buffs)
{
static rte_spinlock_t tap_dev_write_lock = {0};
for (unsigned int i = 0; i < nr_buffs; i++)
{
- struct rte_mbuf * mbuf = (struct rte_mbuf *)buffs[i];
- if (tap_resp_dev_filter(vdev->vdi->vdev, mbuf) <= 0)
+ if (tap_resp_dev_filter(vdev->vdi->vdev, buffs[i]) <= 0)
{
continue;
}
/* spinlock at here */
rte_spinlock_lock(&tap_dev_write_lock);
- tap_device_tx(vdev->tap_representor, mbuf);
+ tap_device_tx(vdev->tap_representor, buffs[i]);
rte_spinlock_unlock(&tap_dev_write_lock);
}
@@ -395,4 +395,4 @@ int tap_representor_init(struct mr_instance * mr_instance, struct mr_vdev * vdev
MR_INFO("tap representor for %s created. ", vdev->devsym);
return 0;
-} \ No newline at end of file
+}