2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

netdev-dpdk: Assign socket id according to device's numa id

We can hotplug attach DPDK ports specified via the 'dpdk-devargs'
option now.

But the socket id of DPDK ports can't be assigned correctly,
it is always 0. The socket id of DPDK ports should be assigned
according to the numa id of the device.

Fixes: 55e075e65e ("netdev-dpdk: Arbitrary 'dpdk' port naming")
Signed-off-by: Binbin Xu <xu.binbin1@zte.com.cn>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
xu.binbin1@zte.com.cn
2017-01-12 22:18:13 +08:00
committed by Daniele Di Proietto
parent 353fe1e149
commit bd4e172b28

View File

@@ -1241,6 +1241,8 @@ netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args)
netdev_get_name(&dup_dev->up));
err = EADDRINUSE;
} else {
int sid = rte_eth_dev_socket_id(new_port_id);
dev->requested_socket_id = sid < 0 ? SOCKET0 : sid;
dev->devargs = xstrdup(new_devargs);
dev->port_id = new_port_id;
netdev_request_reconfigure(&dev->up);
@@ -3140,7 +3142,8 @@ netdev_dpdk_reconfigure(struct netdev *netdev)
&& netdev->n_rxq == dev->requested_n_rxq
&& dev->mtu == dev->requested_mtu
&& dev->rxq_size == dev->requested_rxq_size
&& dev->txq_size == dev->requested_txq_size) {
&& dev->txq_size == dev->requested_txq_size
&& dev->socket_id == dev->requested_socket_id) {
/* Reconfiguration is unnecessary */
goto out;
@@ -3148,7 +3151,8 @@ netdev_dpdk_reconfigure(struct netdev *netdev)
rte_eth_dev_stop(dev->port_id);
if (dev->mtu != dev->requested_mtu) {
if (dev->mtu != dev->requested_mtu
|| dev->socket_id != dev->requested_socket_id) {
netdev_dpdk_mempool_configure(dev);
}