From: "yanjun.zhu" <yanjun.zhu@linux.dev>
To: Stefan Metzmacher <metze@samba.org>, linux-rdma@vger.kernel.org
Cc: Bernard Metzler <bmt@zurich.ibm.com>
Subject: Re: [PATCH 2/8] RDMA/siw: remove unused loopback_enabled = true
Date: Thu, 3 Jul 2025 18:14:05 -0700 [thread overview]
Message-ID: <b8cda822-f863-4cb2-a46d-c60eaa6ac005@linux.dev> (raw)
In-Reply-To: <d0f0ddbf86e2570f51d32ccacb612336a820f855.1751561826.git.metze@samba.org>
On 7/3/25 10:26 AM, Stefan Metzmacher wrote:
> Devices are created explicitly by the administrator using
> 'rdma link add siw_lo type siw netdev lo'.
In the file drivers/infiniband/core/addr.c:
496 static int rdma_set_src_addr_rcu(struct rdma_dev_addr *dev_addr,
497 unsigned int *ndev_flags,
498 const struct sockaddr *dst_in,
499 const struct dst_entry *dst)
500 {
501 struct net_device *ndev = READ_ONCE(dst->dev);
502
503 *ndev_flags = ndev->flags;
504 /* A physical device must be the RDMA device to use */
505 if (ndev->flags & IFF_LOOPBACK) {
506 /*
507 * RDMA (IB/RoCE, iWarp) doesn't run on lo interface or
508 * loopback IP address. So if route is resolved to
loopback
509 * interface, translate that to a real ndev based on non
510 * loopback IP address.
511 */
512 ndev = rdma_find_ndev_for_src_ip_rcu(dev_net(ndev),
dst_in);
513 if (IS_ERR(ndev))
514 return -ENODEV;
515 }
516
517 return copy_src_l2_addr(dev_addr, dst_in, dst, ndev);
518 }
I am not sure whether the above comments are correct or not because you
are creating a siw device on lo netdev.
Yanjun.Zhu
>
> Cc: Bernard Metzler <bmt@zurich.ibm.com>
> Cc: linux-rdma@vger.kernel.org
> Signed-off-by: Stefan Metzmacher <metze@samba.org>
> ---
> drivers/infiniband/sw/siw/siw.h | 1 -
> drivers/infiniband/sw/siw/siw_main.c | 5 +----
> 2 files changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/infiniband/sw/siw/siw.h b/drivers/infiniband/sw/siw/siw.h
> index 3e04357ab197..3bdc17eedbe7 100644
> --- a/drivers/infiniband/sw/siw/siw.h
> +++ b/drivers/infiniband/sw/siw/siw.h
> @@ -490,7 +490,6 @@ struct siw_user_mmap_entry {
> /* Global siw parameters. Currently set in siw_main.c */
> extern const bool zcopy_tx;
> extern const bool try_gso;
> -extern const bool loopback_enabled;
> extern const bool mpa_crc_required;
> extern const bool mpa_crc_strict;
> extern const bool siw_tcp_nagle;
> diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c
> index 4e1d29832ac8..ba238b0b43a3 100644
> --- a/drivers/infiniband/sw/siw/siw_main.c
> +++ b/drivers/infiniband/sw/siw/siw_main.c
> @@ -38,8 +38,6 @@ const bool zcopy_tx = true;
> */
> const bool try_gso;
>
> -/* Attach siw also with loopback devices */
> -const bool loopback_enabled = true;
>
> /* We try to negotiate CRC on, if true */
> const bool mpa_crc_required;
> @@ -94,8 +92,7 @@ static int siw_dev_qualified(struct net_device *netdev)
> * <linux/if_arp.h> for type identifiers.
> */
> if (netdev->type == ARPHRD_ETHER || netdev->type == ARPHRD_IEEE802 ||
> - netdev->type == ARPHRD_NONE ||
> - (netdev->type == ARPHRD_LOOPBACK && loopback_enabled))
> + netdev->type == ARPHRD_NONE || netdev->type == ARPHRD_LOOPBACK)
> return 1;
>
> return 0;
next prev parent reply other threads:[~2025-07-04 1:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 17:26 [PATCH 0/8] RDMA/siw: [re-]introduce module parameters and add MPA V1 Stefan Metzmacher
2025-07-03 17:26 ` [PATCH 1/8] RDMA/siw: make mpa_version = MPA_REVISION_2 const Stefan Metzmacher
2025-07-03 17:26 ` [PATCH 2/8] RDMA/siw: remove unused loopback_enabled = true Stefan Metzmacher
2025-07-04 1:14 ` yanjun.zhu [this message]
2025-07-03 17:26 ` [PATCH 3/8] RDMA/siw: add and remember siw_device_options per device Stefan Metzmacher
2025-07-03 17:26 ` [PATCH 4/8] RDMA/siw: make use of sdev->options.* and avoid globals Stefan Metzmacher
2025-07-03 17:26 ` [PATCH 5/8] RDMA/siw: combine global options into siw_default_options Stefan Metzmacher
2025-07-03 17:26 ` [PATCH 6/8] RDMA/siw: move rtr_type to siw_device_options Stefan Metzmacher
2025-07-03 17:26 ` [PATCH 7/8] RDMA/siw: [re-]introduce module parameters to alter the behavior at runtime Stefan Metzmacher
2025-07-03 17:26 ` [PATCH 8/8] RDMA/siw: add support for MPA V1 and IRD/ORD negotiation based on [MS-SMBD] Stefan Metzmacher
2025-07-03 19:16 ` [PATCH 0/8] RDMA/siw: [re-]introduce module parameters and add MPA V1 Chuck Lever
2025-07-04 14:13 ` Bernard Metzler
2025-07-06 7:56 ` Leon Romanovsky
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=b8cda822-f863-4cb2-a46d-c60eaa6ac005@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=bmt@zurich.ibm.com \
--cc=linux-rdma@vger.kernel.org \
--cc=metze@samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.