On 2/20/2019 7:21 PM, Matthew Wilcox wrote:
Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>
---
.../infiniband/ulp/opa_vnic/opa_vnic_vema.c | 60 +++++++------------
1 file changed, 23 insertions(+), 37 deletions(-)
.
.
.
@@ -891,10 +869,16 @@ static void opa_vnic_event(struct ib_event_handler *handler,
record->event, dev_name(&record->device->dev),
record->element.port_num);
- if (record->event == IB_EVENT_PORT_ERR)
- idr_for_each(&port->vport_idr, vema_disable_vport, NULL);
- if (record->event == IB_EVENT_PORT_ACTIVE)
- idr_for_each(&port->vport_idr, vema_enable_vport, NULL);
+ if (record->event != IB_EVENT_PORT_ERR ||
+ record->event != IB_EVENT_PORT_ACTIVE)
+ return;
+
+ xa_for_each(&port->vports, index, adapter) {
+ if (record->event == IB_EVENT_PORT_ERR)
+ netif_carrier_off(adapter->netdev);
+ else
+ netif_carrier_on(adapter->netdev);
This might be better written as:
if (record->event == IB_EVENT_PORT_ACTIVE)
netif_carrier_on(...)
else
netif_carrier_off(...)
-Denny