Re: [PATCH rdma-next v1 2/2] RDMA/core: Add a netevent notifier to cma

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

 



On Thu, May 19, 2022 at 07:41:23AM +0300, Leon Romanovsky wrote:
> From: Patrisious Haddad <phaddad@xxxxxxxxxx>
> 
> Add a netevent callback for cma, mainly to catch NETEVENT_NEIGH_UPDATE.
> 
> Previously, when a system with failover MAC mechanism change its MAC address
> during a CM connection attempt, the RDMA-CM would take a lot of time till
> it disconnects and timesout due to the incorrect MAC address.
> 
> Now when we get a NETEVENT_NEIGH_UPDATE we check if it is due to a failover
> MAC change and if so, we instantly destroy the CM and notify the user in order
> to spare the unnecessary waiting for the timeout.
> 
> Signed-off-by: Patrisious Haddad <phaddad@xxxxxxxxxx>
> Reviewed-by: Mark Zhang <markzhang@xxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
>  drivers/infiniband/core/cma.c | 83 +++++++++++++++++++++++++++++++++++
>  include/rdma/rdma_cm.h        |  6 +++
>  2 files changed, 89 insertions(+)
> 
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 08bc3ea19716..644f5f1e1f46 100644
> +++ b/drivers/infiniband/core/cma.c
> @@ -21,6 +21,7 @@
>  
>  #include <net/net_namespace.h>
>  #include <net/netns/generic.h>
> +#include <net/netevent.h>
>  #include <net/tcp.h>
>  #include <net/ipv6.h>
>  #include <net/ip_fib.h>
> @@ -5049,10 +5050,89 @@ static int cma_netdev_callback(struct notifier_block *self, unsigned long event,
>  	return ret;
>  }
>  
> +static void cma_netevent_work_handler(struct work_struct *_work)
> +{
> +	struct cma_netevent_work *network =
> +		container_of(_work, struct cma_netevent_work, work);

This is just

	struct rdma_id_private *id_priv =
		container_of(_work, struct rdma_id_private, id.net_work);

> +struct cma_netevent_work {
> +	struct work_struct work;
> +	struct rdma_id_private *id_priv;
> +};

And this isn't needed.

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