Skip to contentSkip to conversation

smc: Updates 2023-03-01

PATCH Applied Wenjia Zhang 3 participants 6 messages Mar 13, 2023 – Mar 15, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover smc: Updates 2023-03-01

The 1st patch is to make implements later do not need to adhere to a specific SEID format. The 2nd patch does some cleanup.

Stefan Raspl (2):
net/smc: Introduce explicit check for v2 support net/ism: Remove extra include

 drivers/s390/net/ism_drv.c | 8 +++++++-
 include/net/smc.h          | 1 +
 net/smc/smc_ism.c          | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)
Signature · 1 line
2.37.2
#1 lore raw

PATCH 1/2 net/smc: Introduce explicit check for v2 support

From: Stefan Raspl <[email protected]>

Previously, v2 support was derived from a very specific format of the SEID as part of the SMC-D codebase. Make this part of the SMC-D device API, so implementers do not need to adhere to a specific SEID format.

---
 drivers/s390/net/ism_drv.c | 7 +++++++
 include/net/smc.h          | 1 +
 net/smc/smc_ism.c          | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/s390/net/ism_drv.c +7 -0
index eb7e13486087..1c73d32966f1 100644
@@ -842,6 +842,12 @@ static int smcd_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,
 	return ism_move(smcd->priv, dmb_tok, idx, sf, offset, data, size);
 }
 
+static int smcd_supports_v2(void)
+{
+	return SYSTEM_EID.serial_number[0] != '0' ||
+		SYSTEM_EID.type[0] != '0';
+}
+
 static u64 smcd_get_local_gid(struct smcd_dev *smcd)
 {
 	return ism_get_local_gid(smcd->priv);
@@ -869,6 +875,7 @@ static const struct smcd_ops ism_ops = {
 	.reset_vlan_required = smcd_reset_vlan_required,
 	.signal_event = smcd_signal_ieq,
 	.move_data = smcd_move,
+	.supports_v2 = smcd_supports_v2,
 	.get_system_eid = ism_get_seid,
 	.get_local_gid = smcd_get_local_gid,
 	.get_chid = smcd_get_chid,
include/net/smc.h +1 -0
index 597cb9381182..a002552be29c 100644
@@ -67,6 +67,7 @@ struct smcd_ops {
 	int (*move_data)(struct smcd_dev *dev, u64 dmb_tok, unsigned int idx,
 			 bool sf, unsigned int offset, void *data,
 			 unsigned int size);
+	int (*supports_v2)(void);
 	u8* (*get_system_eid)(void);
 	u64 (*get_local_gid)(struct smcd_dev *dev);
 	u16 (*get_chid)(struct smcd_dev *dev);
net/smc/smc_ism.c +1 -1
index 3b0b7710c6b0..fbee2493091f 100644
@@ -429,7 +429,7 @@ static void smcd_register_dev(struct ism_dev *ism)
 		u8 *system_eid = NULL;
 
 		system_eid = smcd->ops->get_system_eid();
-		if (system_eid[24] != '0' || system_eid[28] != '0') {
+		if (smcd->ops->supports_v2()) {
 			smc_ism_v2_capable = true;
 			memcpy(smc_ism_v2_system_eid, system_eid,
 			       SMC_MAX_EID_LEN);
Signature · 1 line
2.37.2
reviewer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH net-next 1/2] net/smc: Introduce explicit check for v2 support

Quoted 10 lines · Wenjia Zhang

From: Stefan Raspl <[email protected]>

Previously, v2 support was derived from a very specific format of the SEID as part of the SMC-D codebase. Make this part of the SMC-D device API, so implementers do not need to adhere to a specific SEID format.

This solved my doubts about the magic number, and helps the extensions of SMC-D. Thank you.

Quoted 58 lines
---
 drivers/s390/net/ism_drv.c | 7 +++++++
 include/net/smc.h          | 1 +
 net/smc/smc_ism.c          | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/s390/net/ism_drv.c +7 -0
index eb7e13486087..1c73d32966f1 100644
@@ -842,6 +842,12 @@ static int smcd_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,
 	return ism_move(smcd->priv, dmb_tok, idx, sf, offset, data, size);
 }
 
+static int smcd_supports_v2(void)
+{
+	return SYSTEM_EID.serial_number[0] != '0' ||
+		SYSTEM_EID.type[0] != '0';
+}
+
 static u64 smcd_get_local_gid(struct smcd_dev *smcd)
 {
 	return ism_get_local_gid(smcd->priv);
@@ -869,6 +875,7 @@ static const struct smcd_ops ism_ops = {
 	.reset_vlan_required = smcd_reset_vlan_required,
 	.signal_event = smcd_signal_ieq,
 	.move_data = smcd_move,
+	.supports_v2 = smcd_supports_v2,
 	.get_system_eid = ism_get_seid,
 	.get_local_gid = smcd_get_local_gid,
 	.get_chid = smcd_get_chid,
include/net/smc.h +1 -0
index 597cb9381182..a002552be29c 100644
@@ -67,6 +67,7 @@ struct smcd_ops {
 	int (*move_data)(struct smcd_dev *dev, u64 dmb_tok, unsigned int idx,
 			 bool sf, unsigned int offset, void *data,
 			 unsigned int size);
+	int (*supports_v2)(void);
 	u8* (*get_system_eid)(void);
 	u64 (*get_local_gid)(struct smcd_dev *dev);
 	u16 (*get_chid)(struct smcd_dev *dev);
net/smc/smc_ism.c +1 -1
index 3b0b7710c6b0..fbee2493091f 100644
@@ -429,7 +429,7 @@ static void smcd_register_dev(struct ism_dev *ism)
 		u8 *system_eid = NULL;
 
 		system_eid = smcd->ops->get_system_eid();
-		if (system_eid[24] != '0' || system_eid[28] != '0') {
+		if (smcd->ops->supports_v2()) {
 			smc_ism_v2_capable = true;
 			memcpy(smc_ism_v2_system_eid, system_eid,
 			       SMC_MAX_EID_LEN);
Signature · 1 line
2.37.2
#3 lore raw

PATCH 2/2 net/ism: Remove extra include

In reply to Wenjia Zhang

From: Stefan Raspl <[email protected]>

---
 drivers/s390/net/ism_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/s390/net/ism_drv.c +0 -1
index 1c73d32966f1..05749c877990 100644
@@ -11,7 +11,6 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>
-#include <linux/pci.h>
 #include <linux/err.h>
 #include <linux/ctype.h>
 #include <linux/processor.h>
Signature · 1 line
2.37.2
reviewer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH net-next 2/2] net/ism: Remove extra include

Quoted 4 lines · Wenjia Zhang

From: Stefan Raspl <[email protected]>

Quoted 18 lines
---
 drivers/s390/net/ism_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/s390/net/ism_drv.c +0 -1
index 1c73d32966f1..05749c877990 100644
@@ -11,7 +11,6 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>
-#include <linux/pci.h>
 #include <linux/err.h>
 #include <linux/ctype.h>
 #include <linux/processor.h>
Signature · 1 line
2.37.2
#5 lore raw
In reply to Wenjia Zhang
This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 8 lines · On Mon, 13 Mar 2023 11:10:30 +0100 you wrote:

The 1st patch is to make implements later do not need to adhere to a specific SEID format. The 2nd patch does some cleanup.

Stefan Raspl (2):
net/smc: Introduce explicit check for v2 support net/ism: Remove extra include

[...]

Here is the summary with links:
- [net-next,1/2] net/smc: Introduce explicit check for v2 support

    https://git.kernel.org/netdev/net-next/c/f947568e2580
  - [net-next,2/2] net/ism: Remove extra include
    https://git.kernel.org/netdev/net-next/c/298c91dc40e5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html