Re: [PATCH RFC v2 for-next 2/7] RDMA/mlx5: remove deliver net device event

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

 



On Tue, Feb 04, 2020 at 04:24:03PM +0800, Weihang Li wrote:
> From: Lang Cheng <chenglang@xxxxxxxxxx>
> 
> The code that handles the link event of the net device has been moved into
> the core, and the related processing should been removed from the provider
> driver.

It has? How?

> @@ -219,52 +177,10 @@ static int mlx5_netdev_event(struct notifier_block *this,
>  		write_unlock(&roce->netdev_lock);
>  		break;
>  
> -	case NETDEV_CHANGE:
> -	case NETDEV_UP:
> -	case NETDEV_DOWN: {
> -		struct net_device *lag_ndev = mlx5_lag_get_roce_netdev(mdev);
> -		struct net_device *upper = NULL;
> -
> -		if (lag_ndev) {
> -			upper = netdev_master_upper_dev_get(lag_ndev);
> -			dev_put(lag_ndev);
> -		}
> -
> -		if (ibdev->is_rep)
> -			roce = mlx5_get_rep_roce(ibdev, ndev, &port_num);
> -		if (!roce)
> -			return NOTIFY_DONE;
> -		if ((upper == ndev || (!upper && ndev == roce->netdev))
> -		    && ibdev->ib_active) {
> -			struct ib_event ibev = { };
> -			enum ib_port_state port_state;
> -
> -			if (get_port_state(&ibdev->ib_dev, port_num,
> -					   &port_state))
> -				goto done;
> -
> -			if (roce->last_port_state == port_state)
> -				goto done;
> -
> -			roce->last_port_state = port_state;
> -			ibev.device = &ibdev->ib_dev;
> -			if (port_state == IB_PORT_DOWN)
> -				ibev.event = IB_EVENT_PORT_ERR;
> -			else if (port_state == IB_PORT_ACTIVE)
> -				ibev.event = IB_EVENT_PORT_ACTIVE;
> -			else
> -				goto done;
> -
> -			ibev.element.port_num = port_num;
> -			ib_dispatch_event(&ibev);

Where does the core code do this?

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