public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Shiraz Saleem <shiraz.saleem@intel.com>
Cc: jgg@nvidia.com, linux-rdma@vger.kernel.org,
	Mustafa Ismail <mustafa.ismail@intel.com>
Subject: Re: [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's
Date: Thu, 24 Feb 2022 21:29:27 +0200	[thread overview]
Message-ID: <Yhfclznsv2Y2ZUmp@unreal> (raw)
In-Reply-To: <20220224005842.1707-2-shiraz.saleem@intel.com>

On Wed, Feb 23, 2022 at 06:58:40PM -0600, Shiraz Saleem wrote:
> From: Mustafa Ismail <mustafa.ismail@intel.com>
> 
> Currently, events on vlan netdevs are being ignored. Fix
> this by finding the real netdev and processing the
> notifications for vlan netdevs.
> 
> Fixes: 915cc7ac0f8e ("RDMA/irdma: Add miscellaneous utility definitions")
> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
>  drivers/infiniband/hw/irdma/utils.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)

It is better to use the existing coding pattern.

real_dev = rdma_vlan_dev_real_dev(netdev);
if (!real_dev)
   real_dev = netdev;

> 
> diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c
> index 398736d..26407d8 100644
> --- a/drivers/infiniband/hw/irdma/utils.c
> +++ b/drivers/infiniband/hw/irdma/utils.c
> @@ -155,6 +155,8 @@ int irdma_inetaddr_event(struct notifier_block *notifier, unsigned long event,
>  	struct ib_device *ibdev;
>  	u32 local_ipaddr;
>  
> +	if (is_vlan_dev(netdev))
> +		netdev = vlan_dev_real_dev(netdev);
>  	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
>  	if (!ibdev)
>  		return NOTIFY_DONE;
> @@ -201,6 +203,8 @@ int irdma_inet6addr_event(struct notifier_block *notifier, unsigned long event,
>  	struct ib_device *ibdev;
>  	u32 local_ipaddr6[4];
>  
> +	if (is_vlan_dev(netdev))
> +		netdev = vlan_dev_real_dev(netdev);
>  	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
>  	if (!ibdev)
>  		return NOTIFY_DONE;
> @@ -243,14 +247,16 @@ int irdma_net_event(struct notifier_block *notifier, unsigned long event,
>  		    void *ptr)
>  {
>  	struct neighbour *neigh = ptr;
> +	struct net_device *netdev = (struct net_device *)neigh->dev;
>  	struct irdma_device *iwdev;
>  	struct ib_device *ibdev;
>  	__be32 *p;
>  	u32 local_ipaddr[4] = {};
>  	bool ipv4 = true;
>  
> -	ibdev = ib_device_get_by_netdev((struct net_device *)neigh->dev,
> -					RDMA_DRIVER_IRDMA);
> +	if (is_vlan_dev(netdev))
> +		netdev = vlan_dev_real_dev(netdev);
> +	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
>  	if (!ibdev)
>  		return NOTIFY_DONE;
>  
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2022-02-24 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24  0:58 [PATCH rdma-rc 0/3] irdma driver updates Shiraz Saleem
2022-02-24  0:58 ` [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's Shiraz Saleem
2022-02-24 19:29   ` Leon Romanovsky [this message]
2022-02-24  0:58 ` [PATCH rdma-rc 2/3] RDMA/irdma: Fix Passthrough mode in VM Shiraz Saleem
2022-02-24  0:58 ` [PATCH rdma-rc 3/3] RDMA/irdma: Remove incorrect masking of PD Shiraz Saleem

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=Yhfclznsv2Y2ZUmp@unreal \
    --to=leon@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=shiraz.saleem@intel.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