Re: [RFC PATCH 1/1] mlx4: trigger IB events needed by SMC

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

 



On Tue, Aug 07, 2018 at 10:53:13AM +0200, Ursula Braun wrote:
> The mlx4 driver does not trigger an IB_EVENT_PORT_ACTIVE when the
> RoCE network interface is activated. When SMC determines the RoCE
> device port to be used, it checks the port states.
> This patch triggers IB events for NETDEV_UP and NETDEV_DOWN.
>
> Signed-off-by: Ursula Braun <ubraun@xxxxxxxxxxxxx>
> ---
>  drivers/infiniband/hw/mlx4/main.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> index 4ec519afc45b..81a1fd9e8615 100644
> --- a/drivers/infiniband/hw/mlx4/main.c
> +++ b/drivers/infiniband/hw/mlx4/main.c
> @@ -2447,6 +2447,26 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
>  		     event == NETDEV_UP || event == NETDEV_CHANGE))
>  			update_qps_port = port;
>
> +		if (dev == iboe->netdevs[port - 1] &&
> +		    event == NETDEV_UP) {
> +			struct ib_event ibev = { };
> +
> +			ibev.device = &ibdev->ib_dev;
> +			ibev.element.port_num = port;
> +			ibev.event = IB_EVENT_PORT_ACTIVE;
> +			ib_dispatch_event(&ibev);
> +		}
> +
> +		if (dev == iboe->netdevs[port - 1] &&
> +		    event == NETDEV_DOWN) {
> +			struct ib_event ibev = { };
> +
> +			ibev.device = &ibdev->ib_dev;
> +			ibev.element.port_num = port;
> +			ibev.event = IB_EVENT_PORT_ERR;
> +			ib_dispatch_event(&ibev);
> +		}
> +

Thanks Ursula,

I think that you need to take into account previous port states
(IB_PORT_DOWN vs. IB_PORT_ACTIVE).

Thanks

Attachment: signature.asc
Description: PGP signature


[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