[PACKET_IO]format comment
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
#include "../../sdk/include/utils.h"
|
||||
#include "../../sdk/include/util_errors.h"
|
||||
|
||||
#define MARSIO_BURST_PKT_MAX (256)
|
||||
|
||||
/* marsio dynamic link lib function entries */
|
||||
static struct marsio_dll_function_entries g_marsio_dll_func;
|
||||
|
||||
@@ -298,16 +300,26 @@ int pio_marsio_device_close(const struct packet_io_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pio_marsio_device_receive(struct packet_io_device *pdev, uint32_t rxq_id, struct packet *p[], int nr_p)
|
||||
int pio_marsio_device_receive(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts)
|
||||
{
|
||||
struct mr_vdev *mr_dev_handle = pdev->entity.marsio_dev->mr_dev_handle;
|
||||
return g_marsio_dll_func.marsio_recv_burst(mr_dev_handle, rxq_id, (marsio_buff_t **)p, nr_p);
|
||||
marsio_buff_t *rx_buff[MARSIO_BURST_PKT_MAX];
|
||||
|
||||
int recv_res = g_marsio_dll_func.marsio_recv_burst(mr_dev_handle, rxq_id, rx_buff, nr_pkts);
|
||||
/* receive some pkts, copy mbuf pointer to packet structure */
|
||||
if (recv_res > 0) {
|
||||
for (int i = 0; i < recv_res; i++) {
|
||||
pkts[i]= (struct packet *)rx_buff[i];
|
||||
}
|
||||
}
|
||||
|
||||
return recv_res;
|
||||
}
|
||||
|
||||
int pio_marsio_device_send(struct packet_io_device *pdev, uint32_t txq_id, struct packet *p[], int nr_p)
|
||||
int pio_marsio_device_send(struct packet_io_device *pdev, uint32_t txq_id, struct packet **pkts, int nr_pkts)
|
||||
{
|
||||
struct mr_sendpath *sendpath_handle = pdev->entity.marsio_dev->mr_sendpath_handle;
|
||||
return g_marsio_dll_func.marsio_send_burst(sendpath_handle, txq_id, (marsio_buff_t **)p, nr_p);
|
||||
return g_marsio_dll_func.marsio_send_burst(sendpath_handle, txq_id, (marsio_buff_t **)pkts, nr_pkts);
|
||||
}
|
||||
|
||||
static int marsio_instance_init(struct packet_io_instance *pinst, int wrk_thread_num)
|
||||
|
||||
Reference in New Issue
Block a user