Re: [PATCH 26/32] opa_vnic: Convert vport_idr to XArray

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 01, 2019 at 09:50:59AM -0400, Dennis Dalessandro wrote:
> 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(...)

I made this change and applied to for-next Thanks

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux