GET_CARRIER, GET_STATS, GET_FEATURES, GET_STATUS, RXQ_RECV) \
{ \
NAME, \
+ true, /* is_pmd */ \
INIT, /* init */ \
NULL, /* netdev_dpdk_run */ \
NULL, /* netdev_dpdk_wait */ \
* the system. */
const char *type;
+ /* If 'true' then this netdev should be polled by PMD threads. */
+ bool is_pmd;
+
/* ## ------------------- ## */
/* ## Top-Level Functions ## */
/* ## ------------------- ## */
#define TUNNEL_CLASS(NAME, DPIF_PORT, BUILD_HEADER, PUSH_HEADER, POP_HEADER) \
{ DPIF_PORT, \
- { NAME, VPORT_FUNCTIONS(get_tunnel_config, \
- set_tunnel_config, \
- get_netdev_tunnel_config, \
- tunnel_get_status, \
- BUILD_HEADER, PUSH_HEADER, POP_HEADER) }}
+ { NAME, false, \
+ VPORT_FUNCTIONS(get_tunnel_config, \
+ set_tunnel_config, \
+ get_netdev_tunnel_config, \
+ tunnel_get_status, \
+ BUILD_HEADER, PUSH_HEADER, POP_HEADER) }}
void
netdev_vport_tunnel_register(void)
{
static const struct vport_class patch_class =
{ NULL,
- { "patch", VPORT_FUNCTIONS(get_patch_config,
- set_patch_config,
- NULL,
- NULL, NULL, NULL, NULL) }};
+ { "patch", false,
+ VPORT_FUNCTIONS(get_patch_config,
+ set_patch_config,
+ NULL,
+ NULL, NULL, NULL, NULL) }};
netdev_register_provider(&patch_class.netdev_class);
}
#define NETDEV_WINDOWS_CLASS(NAME, CONSTRUCT) \
{ \
.type = NAME, \
+ .is_pmd = false, \
.alloc = netdev_windows_alloc, \
.construct = CONSTRUCT, \
.destruct = netdev_windows_destruct, \
bool
netdev_is_pmd(const struct netdev *netdev)
{
- return (!strcmp(netdev->netdev_class->type, "dpdk") ||
- !strcmp(netdev->netdev_class->type, "dpdkr") ||
- !strcmp(netdev->netdev_class->type, "dpdkvhostcuse") ||
- !strcmp(netdev->netdev_class->type, "dpdkvhostuser"));
+ return netdev->netdev_class->is_pmd;
}
static void