Skip to content

Commit c458fa8

Browse files
author
Mamatha Inamdar
committed
ibmveth: Always stop tx queues during close
JIRA: https://issues.redhat.com/browse/RHEL-93830 commit 127b721 Author: Nick Child <[email protected]> Date: Thu Oct 20 16:40:52 2022 -0500 ibmveth: Always stop tx queues during close netif_stop_all_queues must be called before calling H_FREE_LOGICAL_LAN. As a result, we can remove the pool_config field from the ibmveth adapter structure. Some device configuration changes call ibmveth_close in order to free the current resources held by the device. These functions then make their changes and call ibmveth_open to reallocate and reserve resources for the device. Prior to this commit, the flag pool_config was used to tell ibmveth_close that it should not halt the transmit queue. pool_config was introduced in commit 860f242 ("[PATCH] ibmveth change buffer pools dynamically") to avoid interrupting the tx flow when making rx config changes. Since then, other commits adopted this approach, even if making tx config changes. The issue with this approach was that the hypervisor freed all of the devices control structures after the hcall H_FREE_LOGICAL_LAN was performed but the transmit queues were never stopped. So the higher layers in the network stack would continue transmission but any H_SEND_LOGICAL_LAN hcall would fail with H_PARAMETER until the hypervisor's structures for the device were allocated with the H_REGISTER_LOGICAL_LAN hcall in ibmveth_open. This resulted in no real networking harm but did cause several of these error messages to be logged: "h_send_logical_lan failed with rc=-4" So, instead of trying to keep the transmit queues alive during network configuration changes, just stop the queues, make necessary changes then restart the queues. Signed-off-by: Nick Child <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Mamatha Inamdar <[email protected]>
1 parent bad5fea commit c458fa8

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

drivers/net/ethernet/ibm/ibmveth.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,7 @@ static int ibmveth_close(struct net_device *netdev)
667667

668668
napi_disable(&adapter->napi);
669669

670-
if (!adapter->pool_config)
671-
netif_tx_stop_all_queues(netdev);
670+
netif_tx_stop_all_queues(netdev);
672671

673672
h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
674673

@@ -776,9 +775,7 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data)
776775

777776
if (netif_running(dev)) {
778777
restart = 1;
779-
adapter->pool_config = 1;
780778
ibmveth_close(dev);
781-
adapter->pool_config = 0;
782779
}
783780

784781
set_attr = 0;
@@ -860,9 +857,7 @@ static int ibmveth_set_tso(struct net_device *dev, u32 data)
860857

861858
if (netif_running(dev)) {
862859
restart = 1;
863-
adapter->pool_config = 1;
864860
ibmveth_close(dev);
865-
adapter->pool_config = 0;
866861
}
867862

868863
set_attr = 0;
@@ -1512,9 +1507,7 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu)
15121507
only the buffer pools necessary to hold the new MTU */
15131508
if (netif_running(adapter->netdev)) {
15141509
need_restart = 1;
1515-
adapter->pool_config = 1;
15161510
ibmveth_close(adapter->netdev);
1517-
adapter->pool_config = 0;
15181511
}
15191512

15201513
/* Look for an active buffer pool that can hold the new MTU */
@@ -1678,7 +1671,6 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
16781671
adapter->vdev = dev;
16791672
adapter->netdev = netdev;
16801673
adapter->mcastFilterSize = be32_to_cpu(*mcastFilterSize_p);
1681-
adapter->pool_config = 0;
16821674
ibmveth_init_link_settings(netdev);
16831675

16841676
netif_napi_add_weight(netdev, &adapter->napi, ibmveth_poll, 16);
@@ -1819,9 +1811,7 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,
18191811
return -ENOMEM;
18201812
}
18211813
pool->active = 1;
1822-
adapter->pool_config = 1;
18231814
ibmveth_close(netdev);
1824-
adapter->pool_config = 0;
18251815
if ((rc = ibmveth_open(netdev)))
18261816
return rc;
18271817
} else {
@@ -1847,10 +1837,8 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,
18471837
}
18481838

18491839
if (netif_running(netdev)) {
1850-
adapter->pool_config = 1;
18511840
ibmveth_close(netdev);
18521841
pool->active = 0;
1853-
adapter->pool_config = 0;
18541842
if ((rc = ibmveth_open(netdev)))
18551843
return rc;
18561844
}
@@ -1861,9 +1849,7 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,
18611849
return -EINVAL;
18621850
} else {
18631851
if (netif_running(netdev)) {
1864-
adapter->pool_config = 1;
18651852
ibmveth_close(netdev);
1866-
adapter->pool_config = 0;
18671853
pool->size = value;
18681854
if ((rc = ibmveth_open(netdev)))
18691855
return rc;
@@ -1876,9 +1862,7 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,
18761862
return -EINVAL;
18771863
} else {
18781864
if (netif_running(netdev)) {
1879-
adapter->pool_config = 1;
18801865
ibmveth_close(netdev);
1881-
adapter->pool_config = 0;
18821866
pool->buff_size = value;
18831867
if ((rc = ibmveth_open(netdev)))
18841868
return rc;

drivers/net/ethernet/ibm/ibmveth.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ struct ibmveth_adapter {
147147
dma_addr_t filter_list_dma;
148148
struct ibmveth_buff_pool rx_buff_pool[IBMVETH_NUM_BUFF_POOLS];
149149
struct ibmveth_rx_q rx_queue;
150-
int pool_config;
151150
int rx_csum;
152151
int large_send;
153152
bool is_active_trunk;

0 commit comments

Comments
 (0)