@@ -558,6 +558,11 @@ is_dpdk_class(const struct netdev_class *class)
|| class->destruct == netdev_dpdk_vhost_destruct;
}
+bool is_dpdk_vhost_netdev(struct netdev *netdev)
+{
+ return netdev->netdev_class->destruct == netdev_dpdk_vhost_destruct;
+}
+
/* DPDK NIC drivers allocate RX buffers at a particular granularity, typically
* aligned at 1k or less. If a declared mbuf size is not a multiple of this
* value, insufficient buffers are allocated to accomodate the packet in its
@@ -37,6 +37,7 @@ void netdev_dpdk_register(void);
void free_dpdk_buf(struct dp_packet *);
bool netdev_dpdk_flow_api_supported(struct netdev *);
+bool is_dpdk_vhost_netdev(struct netdev *);
int
netdev_dpdk_rte_flow_destroy(struct netdev *netdev,
This patch adds a function to determine if a given netdev belongs to the dpdk-vhost class, using the netdev_class specific data. Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com> --- lib/netdev-dpdk.c | 5 +++++ lib/netdev-dpdk.h | 1 + 2 files changed, 6 insertions(+)