All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dust Li <dust.li@linux.alibaba.com>
To: Alexandra Winter <wintera@linux.ibm.com>,
	David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"D. Wythe" <alibuda@linux.alibaba.com>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Julian Ruess <julianr@linux.ibm.com>
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Thorsten Winkler <twinkler@linux.ibm.com>,
	Simon Horman <horms@kernel.org>,
	Mahanta Jambigi <mjambigi@linux.ibm.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Wen Gu <guwen@linux.alibaba.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	linux-rdma@vger.kernel.org
Subject: Re: [RFC net-next 10/17] net/dibs: Define dibs_client_ops and dibs_dev_ops
Date: Sun, 10 Aug 2025 22:53:47 +0800	[thread overview]
Message-ID: <aJiye8W_giWiWWpI@linux.alibaba.com> (raw)
In-Reply-To: <20250806154122.3413330-11-wintera@linux.ibm.com>

On 2025-08-06 17:41:15, Alexandra Winter wrote:
>Move the device add() and remove() functions from ism_client to
>dibs_client_ops and call add_dev()/del_dev() for ism devices and
>dibs_loopback devices. dibs_client_ops->add_dev() = smcd_register_dev() for
>the smc_dibs_client. This is the first step to handle ism and loopback
>devices alike (as dibs devices) in the smc dibs client.
>
>Define dibs_dev->ops and move smcd_ops->get_chid to
>dibs_dev_ops->get_fabric_id() for ism and loopback devices. See below for
>why this needs to be in the same patch as dibs_client_ops->add_dev().
>
>The following changes contain intermediate steps, that will be obsoleted by
>follow-on patches, once more functionality has been moved to dibs:
>
>Use different smcd_ops and max_dmbs for ism and loopback. Follow-on patches
>will change SMC-D to directly use dibs_ops instead of smcd_ops.
>
>In smcd_register_dev() it is now necessary to identify a dibs_loopback
>device before smcd_dev and smcd_ops->get_chid() are available. So provide
>dibs_dev_ops->get_fabric_id() in this patch and evaluate it in
>smc_ism_is_loopback().
>
>Call smc_loopback_init() in smcd_register_dev() and call
>smc_loopback_exit() in smcd_unregister_dev() to handle the functionality
>that is still in smc_loopback. Follow-on patches will move all smc_loopback
>code to dibs_loopback.
>
>In smcd_unregister_dev() use only ism device name, this will be replaced by
>dibs device name by a follow-on patch.
>
>End of changes with intermediate parts.
>
>Allocate an smcd event workqueue for all dibs devices, although
>dibs_loopback does not generate events.
>
>Use kernel memory instead of devres memory for smcd_dev and smcd->conn.
>Since commit a72178cfe855 ("net/smc: Fix dependency of SMC on ISM") an ism
>device and its driver can have a longer lifetime than the smc module, so
>smc should not rely on devres to free its resources [1]. It is now the
>responsibility of the smc client to free smcd and smcd->conn for all dibs
>devices, ism devices as well as loopback. Call client->ops->del_dev() for
>all existing dibs devices in dibs_unregister_client(), so all device
>related structures can be freed in the client.
>
>When dibs_unregister_client() is called in the context of smc_exit() or
>smc_core_reboot_event(), these functions have already called
>smc_lgrs_shutdown() which calls smc_smcd_terminate_all(smcd) and sets
>going_away. This is done a second time in smcd_unregister_dev(). This is
>analogous to how smcr is handled in these functions, by calling first
>smc_lgrs_shutdown() and then smc_ib_unregister_client() >
>smc_ib_remove_dev(), so leave it that way. It may be worth investigating,
>whether smc_lgrs_shutdown() is still required or useful.
>
>Remove CONFIG_SMC_LO. CONFIG_DIBS_LO now controls whether a dibs loopback
>device exists or not.
>
>Link: https://www.kernel.org/doc/Documentation/driver-model/devres.txt [1]
>Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
>Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>

Hi Winter,

I feel a bit hard for me to review the code especially with so many
intermediate parts. I may need more time to review these.

Seperate such a big refine patch is hard. Maybe put the
small parts in the front and the final one in the last to reduce
the intermediate part as much as possible ? I'm not sure.

Best regards,
Dust


  parent reply	other threads:[~2025-08-10 14:53 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 15:41 [RFC net-next 00/17] dibs - Direct Internal Buffer Sharing Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 01/17] net/smc: Remove __init marker from smc_core_init() Alexandra Winter
2025-08-07  3:34   ` Dust Li
2025-08-07  7:01     ` Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 02/17] s390/ism: Log module load/unload Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 03/17] net/smc: Remove error handling of unregister_dmb() Alexandra Winter
2025-08-10 11:03   ` Dust Li
2025-08-11 11:28     ` Alexandra Winter
2025-08-12 22:53       ` Dust Li
2025-08-06 15:41 ` [RFC net-next 04/17] net/smc: Decouple sf and attached send_buf in smc_loopback Alexandra Winter
2025-08-10 14:00   ` Dust Li
2025-08-11 11:35     ` Alexandra Winter
2025-08-11 12:03       ` Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 05/17] net/smc: Improve log message for devices w/o pnetid Alexandra Winter
2025-08-10 14:07   ` Dust Li
2025-08-11 14:10     ` Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 06/17] net/dibs: Create net/dibs Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 07/17] net/dibs: Register smc as dibs_client Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 08/17] net/dibs: Register ism as dibs device Alexandra Winter
2025-08-07 15:05   ` kernel test robot
2025-08-07 16:37   ` Simon Horman
2025-08-07 18:19     ` Simon Horman
2025-08-08 18:36       ` Alexandra Winter
2025-08-07 16:57   ` kernel test robot
2025-08-10 14:46   ` Dust Li
2025-08-11 14:27     ` Alexandra Winter
2025-08-12 22:52       ` Dust Li
2025-08-06 15:41 ` [RFC net-next 09/17] net/dibs: Define dibs loopback Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 10/17] net/dibs: Define dibs_client_ops and dibs_dev_ops Alexandra Winter
2025-08-07 19:47   ` Simon Horman
2025-08-08 18:38     ` Alexandra Winter
2025-08-10 14:53   ` Dust Li [this message]
2025-08-11 15:12     ` Alexandra Winter
2025-08-12 22:58       ` Dust Li
2025-08-06 15:41 ` [RFC net-next 11/17] net/dibs: Move struct device to dibs_dev Alexandra Winter
2025-08-07 16:32   ` kernel test robot
2025-08-14  8:51   ` Alexandra Winter
2025-08-15  1:56     ` Dust Li
2025-08-15 11:59       ` Alexandra Winter
2025-08-15 15:18         ` Dust Li
2025-09-01 12:46           ` Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 12/17] net/dibs: Create class dibs Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 13/17] net/dibs: Local gid for dibs devices Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 14/17] net/dibs: Move vlan support to dibs_dev_ops Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 15/17] net/dibs: Move query_remote_gid() " Alexandra Winter
2025-08-11  9:34   ` Julian Ruess
2025-08-14 14:49     ` Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 16/17] net/dibs: Move data path to dibs layer Alexandra Winter
2025-08-07 17:20   ` kernel test robot
2025-08-07 20:34   ` Simon Horman
2025-08-08 18:38     ` Alexandra Winter
2025-08-06 15:41 ` [RFC net-next 17/17] net/dibs: Move event handling " Alexandra Winter

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=aJiye8W_giWiWWpI@linux.alibaba.com \
    --to=dust.li@linux.alibaba.com \
    --cc=agordeev@linux.ibm.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=borntraeger@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gor@linux.ibm.com \
    --cc=guwen@linux.alibaba.com \
    --cc=hca@linux.ibm.com \
    --cc=horms@kernel.org \
    --cc=julianr@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjambigi@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=sidraya@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=twinkler@linux.ibm.com \
    --cc=wenjia@linux.ibm.com \
    --cc=wintera@linux.ibm.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 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.