[PACKET_IO]marsio mode add pkt_free function

This commit is contained in:
liuwentan
2022-07-29 17:29:33 +08:00
parent 7a52bf3c60
commit 523748e05a
9 changed files with 58 additions and 14 deletions

View File

@@ -60,9 +60,11 @@ struct pio_device_operations {
int (*close)(const struct packet_io_device *pdev);
int (*recv)(struct packet_io_device *pdev, uint32_t rxq_id, struct packet *p[], int pkt_cnt);
int (*recv)(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts);
int (*send)(struct packet_io_device *pdev, uint32_t txq_id, struct packet *p[], int pkt_cnt);
int (*send)(struct packet_io_device *pdev, uint32_t txq_id, struct packet **pkts, int nr_pkts);
void (*pkt_free)(struct packet_io_device *pdev, uint32_t qid, struct packet **pkts, int nr_pkts);
};
struct packet_io_device {
@@ -120,7 +122,7 @@ void packet_io_device_close(struct packet_io_device *dev);
* @param p: received packet's pointer array
* @param nr_p: number of received packets
**/
int packet_io_device_rx(struct packet_io_device *pdev, uint32_t rxq_id, struct packet *p[], int nr_p);
int packet_io_device_rx(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts);
/*
* @brief packet_io device send function
@@ -130,4 +132,9 @@ int packet_io_device_rx(struct packet_io_device *pdev, uint32_t rxq_id, struct p
* @param p: prepare to send packet's pointer array
* @param nr_p: number of packets which prepare to send
**/
int packet_io_device_tx(struct packet_io_device *pdev, uint32_t txq_id, struct packet *p[], int nr_p);
int packet_io_device_tx(struct packet_io_device *pdev, uint32_t txq_id, struct packet **pkts, int nr_pkts);
/*
* @brief packet_io free packet buff
**/
void packet_io_pkts_free(struct packet_io_device *pdev, uint32_t qid, struct packet **pkts, int nr_pkts);