From: Dust Li <dust.li@linux.alibaba.com>
To: Alexandra Winter <wintera@linux.ibm.com>,
"D. Wythe" <alibuda@linux.alibaba.com>,
Sidraya Jayagond <sidraya@linux.ibm.com>,
Wenjia Zhang <wenjia@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>
Cc: Julian Ruess <julianr@linux.ibm.com>,
Aswin Karuvally <aswin@linux.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>,
Mahanta Jambigi <mjambigi@linux.ibm.com>,
Tony Lu <tonylu@linux.alibaba.com>,
Wen Gu <guwen@linux.alibaba.com>,
linux-rdma@vger.kernel.org, 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>,
Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net-next 01/14] net/smc: Remove error handling of unregister_dmb()
Date: Tue, 9 Sep 2025 09:23:00 +0800 [thread overview]
Message-ID: <aL-BdPSnQTPUy5rc@linux.alibaba.com> (raw)
In-Reply-To: <20250905145428.1962105-2-wintera@linux.ibm.com>
On 2025-09-05 16:54:14, Alexandra Winter wrote:
>smcd_buf_free() calls smc_ism_unregister_dmb(lgr->smcd, buf_desc) and
>then unconditionally frees buf_desc.
>
>Remove the cleaning up of fields of buf_desc in
>smc_ism_unregister_dmb(), because it is not helpful.
>
>This removes the only usage of ISM_ERROR from the smc module. So move it
>to drivers/s390/net/ism.h.
>
>Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
>Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Best regards,
Dust
>---
> drivers/s390/net/ism.h | 1 +
> include/net/smc.h | 2 --
> net/smc/smc_ism.c | 14 +++++---------
> net/smc/smc_ism.h | 3 ++-
> 4 files changed, 8 insertions(+), 12 deletions(-)
>
>diff --git a/drivers/s390/net/ism.h b/drivers/s390/net/ism.h
>index 047fa6101555..b5b03db52fce 100644
>--- a/drivers/s390/net/ism.h
>+++ b/drivers/s390/net/ism.h
>@@ -10,6 +10,7 @@
> #include <asm/pci_insn.h>
>
> #define UTIL_STR_LEN 16
>+#define ISM_ERROR 0xFFFF
>
> /*
> * Do not use the first word of the DMB bits to ensure 8 byte aligned access.
>diff --git a/include/net/smc.h b/include/net/smc.h
>index db84e4e35080..a9c023dd1380 100644
>--- a/include/net/smc.h
>+++ b/include/net/smc.h
>@@ -44,8 +44,6 @@ struct smcd_dmb {
>
> #define ISM_RESERVED_VLANID 0x1FFF
>
>-#define ISM_ERROR 0xFFFF
>-
> struct smcd_dev;
>
> struct smcd_gid {
>diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
>index a58ffb7a0610..fca01b95b65a 100644
>--- a/net/smc/smc_ism.c
>+++ b/net/smc/smc_ism.c
>@@ -205,13 +205,13 @@ int smc_ism_put_vlan(struct smcd_dev *smcd, unsigned short vlanid)
> return rc;
> }
>
>-int smc_ism_unregister_dmb(struct smcd_dev *smcd, struct smc_buf_desc *dmb_desc)
>+void smc_ism_unregister_dmb(struct smcd_dev *smcd,
>+ struct smc_buf_desc *dmb_desc)
> {
> struct smcd_dmb dmb;
>- int rc = 0;
>
> if (!dmb_desc->dma_addr)
>- return rc;
>+ return;
>
> memset(&dmb, 0, sizeof(dmb));
> dmb.dmb_tok = dmb_desc->token;
>@@ -219,13 +219,9 @@ int smc_ism_unregister_dmb(struct smcd_dev *smcd, struct smc_buf_desc *dmb_desc)
> dmb.cpu_addr = dmb_desc->cpu_addr;
> dmb.dma_addr = dmb_desc->dma_addr;
> dmb.dmb_len = dmb_desc->len;
>- rc = smcd->ops->unregister_dmb(smcd, &dmb);
>- if (!rc || rc == ISM_ERROR) {
>- dmb_desc->cpu_addr = NULL;
>- dmb_desc->dma_addr = 0;
>- }
>+ smcd->ops->unregister_dmb(smcd, &dmb);
>
>- return rc;
>+ return;
> }
>
> int smc_ism_register_dmb(struct smc_link_group *lgr, int dmb_len,
>diff --git a/net/smc/smc_ism.h b/net/smc/smc_ism.h
>index 6763133dd8d0..765aa8fae6fa 100644
>--- a/net/smc/smc_ism.h
>+++ b/net/smc/smc_ism.h
>@@ -47,7 +47,8 @@ int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
> int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
> int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
> struct smc_buf_desc *dmb_desc);
>-int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
>+void smc_ism_unregister_dmb(struct smcd_dev *dev,
>+ struct smc_buf_desc *dmb_desc);
> bool smc_ism_support_dmb_nocopy(struct smcd_dev *smcd);
> int smc_ism_attach_dmb(struct smcd_dev *dev, u64 token,
> struct smc_buf_desc *dmb_desc);
>--
>2.48.1
next prev parent reply other threads:[~2025-09-09 1:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 14:54 [PATCH net-next 00/14] dibs - Direct Internal Buffer Sharing Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 01/14] net/smc: Remove error handling of unregister_dmb() Alexandra Winter
2025-09-09 1:23 ` Dust Li [this message]
2025-09-05 14:54 ` [PATCH net-next 02/14] net/smc: Decouple sf and attached send_buf in smc_loopback Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 03/14] net/dibs: Create net/dibs Alexandra Winter
2025-09-09 1:54 ` Dust Li
2025-09-09 7:36 ` Alexandra Winter
2025-09-10 7:34 ` Julian Ruess
2025-09-11 10:43 ` Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 04/14] net/dibs: Register smc as dibs_client Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 05/14] net/dibs: Register ism as dibs device Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 06/14] net/dibs: Define dibs loopback Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 07/14] net/dibs: Define dibs_client_ops and dibs_dev_ops Alexandra Winter
2025-09-08 7:00 ` Alexandra Winter
2025-09-11 14:08 ` Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 08/14] net/dibs: Move struct device to dibs_dev Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 09/14] net/dibs: Create class dibs Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 10/14] net/dibs: Local gid for dibs devices Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 11/14] net/dibs: Move vlan support to dibs_dev_ops Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 12/14] net/dibs: Move query_remote_gid() " Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 13/14] net/dibs: Move data path to dibs layer Alexandra Winter
2025-09-09 2:25 ` Dust Li
2025-09-09 7:27 ` Alexandra Winter
2025-09-09 7:47 ` Alexandra Winter
2025-09-05 14:54 ` [PATCH net-next 14/14] 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=aL-BdPSnQTPUy5rc@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=aswin@linux.ibm.com \
--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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox