#include <vppinfra/format.h>
#include <vnet/vnet.h>
#include <vnet/dev/types.h>
+#include <vnet/dev/args.h>
#define VNET_DEV_DEVICE_ID_PREFIX_DELIMITER "/"
_ (0, UNKNOWN) \
_ (1, ETHERNET)
-typedef char vnet_dev_device_id_t[32];
-
typedef enum
{
#define _(b, n) VNET_DEV_PORT_TYPE_##n = (1U << (b)),
#define foreach_vnet_dev_port_caps \
_ (interrupt_mode) \
- _ (rss)
+ _ (rss) \
+ _ (change_max_rx_frame_size)
typedef union
{
#define foreach_vnet_dev_port_cfg_type \
_ (PROMISC_MODE) \
- _ (MAX_FRAME_SIZE) \
+ _ (MAX_RX_FRAME_SIZE) \
_ (CHANGE_PRIMARY_HW_ADDR) \
_ (ADD_SECONDARY_HW_ADDR) \
- _ (REMOVE_SECONDARY_HW_ADDR)
+ _ (REMOVE_SECONDARY_HW_ADDR) \
+ _ (RXQ_INTR_MODE_ENABLE) \
+ _ (RXQ_INTR_MODE_DISABLE)
typedef enum
{
{
vnet_dev_port_cfg_type_t type;
u8 validated : 1;
+ u8 all_queues : 1;
union
{
u8 promisc : 1;
vnet_dev_hw_addr_t addr;
- u16 max_frame_size;
+ u16 max_rx_frame_size;
+ vnet_dev_queue_id_t queue_id;
};
} vnet_dev_port_cfg_change_req_t;
vnet_dev_hw_addr_t hw_addr;
u16 max_rx_queues;
u16 max_tx_queues;
- u16 max_supported_frame_size;
+ u16 max_supported_rx_frame_size;
vnet_dev_port_type_t type;
vnet_dev_port_caps_t caps;
} vnet_dev_port_attr_t;
u16 index;
vnet_dev_counter_main_t *counter_main;
CLIB_CACHE_LINE_ALIGN_MARK (runtime0);
+ vnet_dev_rx_queue_t *next_on_thread;
+ u8 interrupt_mode : 1;
u8 enabled : 1;
u8 started : 1;
u8 suspended : 1;
vnet_dev_rx_queue_rt_req_t runtime_request;
CLIB_CACHE_LINE_ALIGN_MARK (runtime1);
vlib_buffer_template_t buffer_template;
- CLIB_ALIGN_MARK (private_data, 16);
+ CLIB_CACHE_LINE_ALIGN_MARK (driver_data);
u8 data[];
} vnet_dev_rx_queue_t;
vnet_dev_queue_config_t rx_queue_config;
vnet_dev_queue_config_t tx_queue_config;
vnet_dev_port_attr_t attr;
- u32 max_frame_size;
+ u32 max_rx_frame_size;
vnet_dev_hw_addr_t primary_hw_addr;
vnet_dev_hw_addr_t *secondary_hw_addr;
u32 index;
vnet_dev_rx_queue_t **rx_queues;
vnet_dev_tx_queue_t **tx_queues;
vnet_dev_port_ops_t port_ops;
+ vnet_dev_arg_t *args;
vnet_dev_rx_queue_ops_t rx_queue_ops;
vnet_dev_tx_queue_ops_t tx_queue_ops;
vnet_dev_node_t rx_node;
u8 feature_arc_index;
u8 feature_arc : 1;
u8 redirect_to_node : 1;
+ u8 default_is_intr_mode : 1;
u32 tx_node_index;
u32 hw_if_index;
u32 sw_if_index;
vnet_dev_port_t **ports;
vnet_dev_periodic_op_t *periodic_ops;
u8 *description;
+ vnet_dev_arg_t *args;
u8 __clib_aligned (16)
data[];
} vnet_dev_t;
vnet_dev_match_t *match;
int priority;
vnet_dev_ops_t ops;
+ vnet_dev_arg_t *args;
};
typedef struct
{
vnet_dev_port_attr_t attr;
vnet_dev_port_ops_t ops;
+ vnet_dev_arg_t *args;
u16 data_size;
void *initial_data;
} port;
u32 link_speed;
} vnet_dev_port_state_changes_t;
+/* args.c */
+vnet_dev_rv_t vnet_dev_arg_parse (vlib_main_t *, vnet_dev_t *,
+ vnet_dev_arg_t *, u8 *);
+void vnet_dev_arg_free (vnet_dev_arg_t **);
+void vnet_dev_arg_clear_value (vnet_dev_arg_t *);
+format_function_t format_vnet_dev_arg_type;
+format_function_t format_vnet_dev_arg_value;
+format_function_t format_vnet_dev_args;
+
/* dev.c */
vnet_dev_t *vnet_dev_alloc (vlib_main_t *, vnet_dev_device_id_t,
vnet_dev_driver_t *);
vnet_hw_interface_t *,
clib_bitmap_t *);
void vnet_dev_clear_hw_interface_counters (u32);
-clib_error_t *vnet_dev_rx_mode_change_fn (vnet_main_t *, u32, u32,
- vnet_hw_if_rx_mode);
void vnet_dev_set_interface_next_node (vnet_main_t *, u32, u32);
/* port.c */
void vnet_dev_poll_port_remove (vlib_main_t *, vnet_dev_port_t *,
vnet_dev_port_op_no_rv_t *);
-/* runtime.c */
-typedef enum
-{
- VNET_DEV_RT_OP_TYPE_UNKNOWN,
- VNET_DEV_RT_OP_TYPE_RX_QUEUE,
-} __clib_packed vnet_dev_rt_op_type_t;
-
-typedef enum
-{
- VNET_DEV_RT_OP_ACTION_UNKNOWN,
- VNET_DEV_RT_OP_ACTION_START,
- VNET_DEV_RT_OP_ACTION_STOP,
-} __clib_packed vnet_dev_rt_op_action_t;
-
typedef struct
{
u16 thread_index;
- u8 type : 4;
- u8 action : 4;
u8 completed;
- vnet_dev_rx_queue_t *rx_queue;
+ u8 in_order;
+ vnet_dev_port_t *port;
} vnet_dev_rt_op_t;
vnet_dev_rv_t vnet_dev_rt_exec_ops (vlib_main_t *, vnet_dev_t *,
typedef struct
{
- u8 n_rx_queues;
- vnet_dev_rx_queue_t *rx_queues[4];
+ vnet_dev_rx_queue_t *first_rx_queue;
} vnet_dev_rx_node_runtime_t;
STATIC_ASSERT (sizeof (vnet_dev_rx_node_runtime_t) <=