mirror of
https://github.com/openvswitch/ovs
synced 2025-09-05 00:35:33 +00:00
dpif-netdev: Add ovs-appctl dpif-netdev/pmd-rxq-rebalance.
Rxqs consumed processing cycles are used to improve the balance of how rxqs are assigned to pmds. Currently some reconfiguration is needed to perform a reassignment. Add an ovs-appctl command to perform a new assignment in order to balance based on the latest rxq processing cycle information. Note: Jan requested this for testing purposes. Suggested-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Kevin Traynor <ktraynor@redhat.com> Signed-off-by: Darrell Ball <dlu998@gmail.com>
This commit is contained in:
committed by
Darrell Ball
parent
79da1e411b
commit
cd995c739a
@@ -725,6 +725,8 @@ static int dpif_netdev_xps_get_tx_qid(const struct dp_netdev_pmd_thread *pmd,
|
||||
static inline bool emc_entry_alive(struct emc_entry *ce);
|
||||
static void emc_clear_entry(struct emc_entry *ce);
|
||||
|
||||
static void dp_netdev_request_reconfigure(struct dp_netdev *dp);
|
||||
|
||||
static void
|
||||
emc_cache_init(struct emc_cache *flow_cache)
|
||||
{
|
||||
@@ -1017,6 +1019,36 @@ sorted_poll_thread_list(struct dp_netdev *dp,
|
||||
*n = k;
|
||||
}
|
||||
|
||||
static void
|
||||
dpif_netdev_pmd_rebalance(struct unixctl_conn *conn, int argc,
|
||||
const char *argv[], void *aux OVS_UNUSED)
|
||||
{
|
||||
struct ds reply = DS_EMPTY_INITIALIZER;
|
||||
struct dp_netdev *dp = NULL;
|
||||
|
||||
ovs_mutex_lock(&dp_netdev_mutex);
|
||||
|
||||
if (argc == 2) {
|
||||
dp = shash_find_data(&dp_netdevs, argv[1]);
|
||||
} else if (shash_count(&dp_netdevs) == 1) {
|
||||
/* There's only one datapath */
|
||||
dp = shash_first(&dp_netdevs)->data;
|
||||
}
|
||||
|
||||
if (!dp) {
|
||||
ovs_mutex_unlock(&dp_netdev_mutex);
|
||||
unixctl_command_reply_error(conn,
|
||||
"please specify an existing datapath");
|
||||
return;
|
||||
}
|
||||
|
||||
dp_netdev_request_reconfigure(dp);
|
||||
ovs_mutex_unlock(&dp_netdev_mutex);
|
||||
ds_put_cstr(&reply, "pmd rxq rebalance requested.\n");
|
||||
unixctl_command_reply(conn, ds_cstr(&reply));
|
||||
ds_destroy(&reply);
|
||||
}
|
||||
|
||||
static void
|
||||
dpif_netdev_pmd_info(struct unixctl_conn *conn, int argc, const char *argv[],
|
||||
void *aux)
|
||||
@@ -1095,6 +1127,9 @@ dpif_netdev_init(void)
|
||||
unixctl_command_register("dpif-netdev/pmd-rxq-show", "[dp]",
|
||||
0, 1, dpif_netdev_pmd_info,
|
||||
(void *)&poll_aux);
|
||||
unixctl_command_register("dpif-netdev/pmd-rxq-rebalance", "[dp]",
|
||||
0, 1, dpif_netdev_pmd_rebalance,
|
||||
NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user