[PACKET_IO]unallocated memory related bugfix for marsio mode
This commit is contained in:
@@ -49,16 +49,16 @@ struct packet_io_instance {
|
||||
|
||||
union
|
||||
{
|
||||
struct pio_pcap_file_instance *pcap_file_inst;
|
||||
struct pio_pcap_live_instance *pcap_live_inst;
|
||||
struct pio_marsio_instance *marsio_inst;
|
||||
struct pio_pcap_file_instance_context *pcap_file_inst_ctx;
|
||||
struct pio_pcap_live_instance_context *pcap_live_inst_ctx;
|
||||
struct pio_marsio_instance_context *marsio_inst_ctx;
|
||||
} entity;
|
||||
};
|
||||
|
||||
struct pio_device_operations {
|
||||
int (*open)(struct packet_io_device *pinst, const char *dev_name, uint32_t nr_rxq, uint32_t nr_txq);
|
||||
|
||||
int (*close)(const struct packet_io_device *pdev);
|
||||
int (*close)(struct packet_io_device *pdev);
|
||||
|
||||
int (*recv)(struct packet_io_device *pdev, uint32_t rxq_id, struct packet **pkts, int nr_pkts);
|
||||
|
||||
@@ -74,14 +74,12 @@ struct packet_io_device {
|
||||
/* device operations */
|
||||
struct pio_device_operations *dev_ops;
|
||||
|
||||
union {
|
||||
struct pio_pcap_file_device *pcap_file_dev;
|
||||
struct pio_pcap_live_device *pcap_live_dev;
|
||||
struct pio_marsio_device *marsio_dev;
|
||||
} entity;
|
||||
|
||||
/* packet io device context */
|
||||
void *dev_ctx;
|
||||
union {
|
||||
struct pio_pcap_file_device_context *pcap_file_dev_ctx;
|
||||
struct pio_pcap_live_device_context *pcap_live_dev_ctx;
|
||||
struct pio_marsio_device_context *marsio_dev_ctx;
|
||||
} entity;
|
||||
|
||||
/* packet_io instance which the device belongs to */
|
||||
struct packet_io_instance *ppio_inst;
|
||||
@@ -92,7 +90,8 @@ struct packet_io_device {
|
||||
*
|
||||
* @param instance_name: packet_io instance name
|
||||
* @param mode: packet_io run mode
|
||||
* @param wrk_thread_num: expected number of packet receiving threads, which will be created by packet_io
|
||||
* @param wrk_thread_num: expected number of packet receiving threads, which will be created by packet_io,
|
||||
* this param is useful only in marsio mode
|
||||
**/
|
||||
struct packet_io_instance *
|
||||
packet_io_instance_create(const char *instance_name, const enum packet_io_run_mode mode, const int wrk_thread_num);
|
||||
|
||||
Reference in New Issue
Block a user