mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 22:35:15 +00:00
netdev-dpdk: Add coverage counter to count vhost IRQs.
When the dpdk vhost library executes an eventfd_write() call, i.e. waking up the guest, a new callback will be called. This patch adds the callback to count the number of interrupts sent to the VM to track the number of times interrupts where generated. This might be of interest to find out system-calls were called in the DPDK fast path. The coverage counter is called "vhost_notification" and can be read with: $ ovs-appctl coverage/read-counter vhost_notification 13238319 Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
committed by
Ilya Maximets
parent
6d77abf4f7
commit
3d56e4ac44
@@ -75,6 +75,7 @@ VLOG_DEFINE_THIS_MODULE(netdev_dpdk);
|
||||
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
|
||||
|
||||
COVERAGE_DEFINE(vhost_tx_contention);
|
||||
COVERAGE_DEFINE(vhost_notification);
|
||||
|
||||
#define DPDK_PORT_WATCHDOG_INTERVAL 5
|
||||
|
||||
@@ -169,6 +170,8 @@ static int new_device(int vid);
|
||||
static void destroy_device(int vid);
|
||||
static int vring_state_changed(int vid, uint16_t queue_id, int enable);
|
||||
static void destroy_connection(int vid);
|
||||
static void vhost_guest_notified(int vid);
|
||||
|
||||
static const struct vhost_device_ops virtio_net_device_ops =
|
||||
{
|
||||
.new_device = new_device,
|
||||
@@ -177,6 +180,7 @@ static const struct vhost_device_ops virtio_net_device_ops =
|
||||
.features_changed = NULL,
|
||||
.new_connection = NULL,
|
||||
.destroy_connection = destroy_connection,
|
||||
.guest_notified = vhost_guest_notified,
|
||||
};
|
||||
|
||||
/* Custom software stats for dpdk ports */
|
||||
@@ -3881,6 +3885,12 @@ destroy_connection(int vid)
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void vhost_guest_notified(int vid OVS_UNUSED)
|
||||
{
|
||||
COVERAGE_INC(vhost_notification);
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve the DPDK virtio device ID (vid) associated with a vhostuser
|
||||
* or vhostuserclient netdev.
|
||||
|
Reference in New Issue
Block a user