From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Patrisious Haddad <phaddad@nvidia.com>,
linux-rdma@vger.kernel.org, Mark Zhang <markzhang@nvidia.com>
Subject: Re: [PATCH rdma-next v1 2/2] RDMA/core: Add a netevent notifier to cma
Date: Fri, 20 May 2022 13:53:18 -0300 [thread overview]
Message-ID: <20220520165318.GA2313538@nvidia.com> (raw)
In-Reply-To: <c9febb1bbd678058a2b98933305ce8e3bca47dfb.1652935014.git.leonro@nvidia.com>
On Thu, May 19, 2022 at 07:41:23AM +0300, Leon Romanovsky wrote:
> From: Patrisious Haddad <phaddad@nvidia.com>
>
> 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@nvidia.com>
> Reviewed-by: Mark Zhang <markzhang@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> 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
prev parent reply other threads:[~2022-05-20 16:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 4:41 [PATCH rdma-next v1 0/2] Add gratuitous ARP support to RDMA-CM Leon Romanovsky
2022-05-19 4:41 ` [PATCH rdma-next v1 1/2] RDMA/core: Add an rb_tree that stores cm_ids sorted by ifindex and remote IP Leon Romanovsky
2022-05-20 16:50 ` Jason Gunthorpe
2022-05-19 4:41 ` [PATCH rdma-next v1 2/2] RDMA/core: Add a netevent notifier to cma Leon Romanovsky
2022-05-20 16:53 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220520165318.GA2313538@nvidia.com \
--to=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=markzhang@nvidia.com \
--cc=phaddad@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).