Skip to content

Commit 5f2675d

Browse files
committed
do not close device, do not re-allocate queues, simply assign new vmbus channels to pre-existing queues
1 parent 423d932 commit 5f2675d

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

drivers/net/netvsc/hn_ethdev.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,8 @@ static int
11021102
hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
11031103
{
11041104
struct hn_data *hv = dev->data->dev_private;
1105+
struct hn_rx_queue *rxq = dev->data->rx_queues[0];
1106+
struct hn_tx_queue *txq = dev->data->tx_queues[0];
11051107
struct rte_eth_dev *vf_dev;
11061108
unsigned int orig_mtu = dev->data->mtu;
11071109
uint32_t rndis_mtu;
@@ -1112,10 +1114,6 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
11121114
return -EIO;
11131115
}
11141116

1115-
ret = hn_dev_close(dev);
1116-
if (ret)
1117-
return ret;
1118-
11191117
/* Change MTU of underlying VF netdev first, if it exists */
11201118
rte_rwlock_read_lock(&hv->vf_lock);
11211119
vf_dev = hn_get_vf_dev(hv);
@@ -1131,6 +1129,8 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
11311129
/* Release channel resources */
11321130
hn_detach(hv);
11331131
hn_chim_uninit(dev);
1132+
1133+
/* Close primary channel */
11341134
rte_vmbus_chan_close(hv->channels[0]);
11351135

11361136
/* Unmap and re-map vmbus device */
@@ -1155,20 +1155,18 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
11551155

11561156
rte_vmbus_set_latency(hv->vmbus, hv->channels[0], hv->latency);
11571157

1158-
hv->primary = hn_rx_queue_alloc(hv, 0,
1159-
dev->device->numa_node);
1160-
1161-
if (!hv->primary) {
1162-
/* This is a catastrophic error - the device is unusable */
1163-
PMD_DRV_LOG(ERR, "No memory to allocate rx queue!");
1164-
return -ENOMEM;
1165-
}
1158+
rxq->chan = hv->channels[0];
1159+
txq->chan = hv->channels[0];
11661160

11671161
ret = hn_attach(hv, mtu);
11681162
if (ret)
11691163
goto error;
11701164

11711165
ret = hn_chim_init(dev);
1166+
if (ret)
1167+
goto error;
1168+
1169+
ret = hn_dev_configure(dev);
11721170
if (!ret)
11731171
goto out;
11741172

0 commit comments

Comments
 (0)