Skip to contentSkip to conversation

IB/cache: Restore compatibility for ib_query_gid

PATCH In review Jason Gunthorpe 3 participants 5 messages Jul 27, 2018 – Jul 29, 2018

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

PATCH 1/1 IB/cache: Restore compatibility for ib_query_gid

Code changes in smc have become so complicated this cycle that the RDMA patches to remove ib_query_gid in smc create too complex merge conflicts. Allow those conflicts to be resolved by using the net/smc hunks by providing a compatibility wrapper. During the second phase of the merge window this wrapper will be deleted and smc updated to use the new API.

---
 include/rdma/ib_cache.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

The resolution Stephen had to make is too complicated, I think we should go this way instead. Parav can send a patch to DaveM during the 2nd half of the merge window to safely update SMC and delete this wrapper.

Parav, can you check this?

Ursula, this is only for SMC, are you able to test SMC with it? You will need to apply it to the RDMA tree here:

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h=for-next

Thanks,
Jason

include/rdma/ib_cache.h +24 -0
index 1108d422027696..c7e9b42b96e5b8 100644
@@ -132,4 +132,28 @@ const struct ib_gid_attr *rdma_get_gid_attr(struct ib_device *device,
 					    u8 port_num, int index);
 void rdma_put_gid_attr(const struct ib_gid_attr *attr);
 void rdma_hold_gid_attr(const struct ib_gid_attr *attr);
+
+/*
+ * This is to be removed. It only exists to make merging rdma and smc simpler.
+ */
+static inline __deprecated int ib_query_gid(struct ib_device *device,
+					    u8 port_num, int index,
+					    union ib_gid *gid,
+					    struct ib_gid_attr *attr_out)
+{
+	const struct ib_gid_attr *attr;
+
+	attr = rdma_get_gid_attr(device,port_num,index);
+	if (IS_ERR(attr))
+		return PTR_ERR(attr);
+
+	if (attr->ndev)
+		dev_hold(attr->ndev);
+	*attr_out = *attr;
+
+	rdma_put_gid_attr(attr);
+
+	return 0;
+}
+
 #endif /* _IB_CACHE_H */
Signature · 1 line
2.18.0
#1 lore raw
Quoted 22 lines

-----Original Message-----
From: Jason Gunthorpe
Sent: Friday, July 27, 2018 10:54 AM
To: [email protected]; Stephen Rothwell <[email protected]>
Cc: David Miller <[email protected]>; Networking <[email protected]>; Doug Ledford <[email protected]>; Linux-Next Mailing List <[email protected]>; Linux Kernel Mailing List <linux- [email protected]>; Parav Pandit <[email protected]>; Ursula Braun <[email protected]>; Leon Romanovsky <[email protected]>; linux- [email protected]
Subject: [PATCH rdma] IB/cache: Restore compatibility for ib_query_gid

Code changes in smc have become so complicated this cycle that the RDMA patches to remove ib_query_gid in smc create too complex merge conflicts. Allow those conflicts to be resolved by using the net/smc hunks by providing a compatibility wrapper. During the second phase of the merge window this wrapper will be deleted and smc updated to use the new API.

Quoted 8 lines
---
 include/rdma/ib_cache.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

The resolution Stephen had to make is too complicated, I think we should go this way instead. Parav can send a patch to DaveM during the 2nd half of the merge window to safely update SMC and delete this wrapper.

Last night Stephen send the changes, if Ursula can test it, its preferred but if that is not possible, I am with below approach too.

Quoted 21 lines

Parav, can you check this?

Ursula, this is only for SMC, are you able to test SMC with it? You will need to apply it to the RDMA tree here:

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h=for-next

Thanks,
Jason

include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +0 -0

1108d422027696..c7e9b42b96e5b8 100644

include/rdma/ib_cache.h +2 -0
@@ -132,4 +132,28 @@ const struct ib_gid_attr *rdma_get_gid_attr(struct
 ib_device *device,
 					    u8 port_num, int index);
 void rdma_put_gid_attr(const struct ib_gid_attr *attr);  void
 rdma_hold_gid_attr(const struct ib_gid_attr *attr);
+
+/*

include/rdma/ib_cache.h const struct ib_gid_attr *rdma_get_gid_attr(struct · line 147

Quoted 10 lines
include/rdma/ib_cache.h +10 -0
+ * This is to be removed. It only exists to make merging rdma and smc simpler.
+ */
+static inline __deprecated int ib_query_gid(struct ib_device *device,
+					    u8 port_num, int index,
+					    union ib_gid *gid,
+					    struct ib_gid_attr *attr_out)
+{
+	const struct ib_gid_attr *attr;
+
+	attr = rdma_get_gid_attr(device,port_num,index);

White space after each variable is needed to avoid warnings.

Quoted 12 lines
include/rdma/ib_cache.h +12 -0
+	if (IS_ERR(attr))
+		return PTR_ERR(attr);
+
+	if (attr->ndev)
+		dev_hold(attr->ndev);
+	*attr_out = *attr;
+
+	rdma_put_gid_attr(attr);
+
+	return 0;
+}
+
Quoted 1 line

#endif /* _IB_CACHE_H */

Rest looks fine.
RB: [email protected]

#2 lore raw
Quoted 24 lines · Parav Pandit
Quoted 24 lines

From: Jason Gunthorpe
Sent: Friday, July 27, 2018 10:54 AM
To: [email protected]; Stephen Rothwell <[email protected]>
Cc: David Miller <[email protected]>; Networking <[email protected]>; Doug Ledford <[email protected]>; Linux-Next Mailing List <[email protected]>; Linux Kernel Mailing List <linux- [email protected]>; Parav Pandit <[email protected]>; Ursula Braun <[email protected]>; Leon Romanovsky <[email protected]>; linux- [email protected]
Subject: [PATCH rdma] IB/cache: Restore compatibility for ib_query_gid

Code changes in smc have become so complicated this cycle that the RDMA patches to remove ib_query_gid in smc create too complex merge conflicts. Allow those conflicts to be resolved by using the net/smc hunks by providing a compatibility wrapper. During the second phase of the merge window this wrapper will be deleted and smc updated to use the new API.

 include/rdma/ib_cache.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
Quoted 6 lines
Quoted 4 lines

The resolution Stephen had to make is too complicated, I think we should go this way instead. Parav can send a patch to DaveM during the 2nd half of the merge window to safely update SMC and delete this wrapper.

Last night Stephen send the changes, if Ursula can test it, its preferred but if that is not possible, I am with below approach too.

Thing is one of us has to explain to Linus how to handle this conflict, as Stephen's resolutions do not automatically go him.

Given how much new code the resolution introduces, I prefer to not send it to Linus..

Quoted 23 lines
Quoted 23 lines

Parav, can you check this?

Ursula, this is only for SMC, are you able to test SMC with it? You will need to apply it to the RDMA tree here:

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h=for-next

Thanks,
Jason

include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +0 -0

1108d422027696..c7e9b42b96e5b8 100644
+++ b/include/rdma/ib_cache.h

include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +5 -0
@@ -132,4 +132,28 @@ const struct ib_gid_attr *rdma_get_gid_attr(struct
 ib_device *device,
 					    u8 port_num, int index);
 void rdma_put_gid_attr(const struct ib_gid_attr *attr);  void
 rdma_hold_gid_attr(const struct ib_gid_attr *attr);
+
+/*
+ * This is to be removed. It only exists to make merging rdma and smc simpler.
+ */
+static inline __deprecated int ib_query_gid(struct ib_device *device,
Quoted 8 lines

include/rdma/ib_cache.h index const struct ib_gid_attr *rdma_get_gid_attr(struct · line 147

Quoted 7 lines
include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +7 -0
+					    u8 port_num, int index,
+					    union ib_gid *gid,
+					    struct ib_gid_attr *attr_out)
+{
+	const struct ib_gid_attr *attr;
+
+	attr = rdma_get_gid_attr(device,port_num,index);

White space after each variable is needed to avoid warnings.

Woops, no problem.

Quoted 8 lines
Quoted 8 lines
include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +8 -0
+	if (IS_ERR(attr))
+		return PTR_ERR(attr);
+
+	if (attr->ndev)
+		dev_hold(attr->ndev);
+	*attr_out = *attr;
+
+	rdma_put_gid_attr(attr);
Quoted 8 lines
Quoted 5 lines
include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +4 -0
+
+	return 0;
+}
+

#endif /* _IB_CACHE_H */

Rest looks fine.
RB: [email protected]

In future please spell out the Reviewed-by - patchworks will automate collecting the tags and add it to the patch, otherwise maintainers have to do it by hand.

Thanks,
Jason

#3 lore raw
Quoted 48 lines

-----Original Message-----
From: Jason Gunthorpe <[email protected]>
Sent: Friday, July 27, 2018 11:09 AM
To: Parav Pandit <[email protected]>
Cc: [email protected]; Stephen Rothwell <[email protected]>; David Miller <[email protected]>; Networking <[email protected]>; Doug Ledford <[email protected]>; Linux-Next Mailing List <linux- [email protected]>; Linux Kernel Mailing List <linux- [email protected]>; Ursula Braun <[email protected]>; Leon Romanovsky <[email protected]>
Subject: Re: [PATCH rdma] IB/cache: Restore compatibility for ib_query_gid

Quoted 15 lines · Parav Pandit
Quoted 15 lines

From: Jason Gunthorpe
Sent: Friday, July 27, 2018 10:54 AM
To: [email protected]; Stephen Rothwell <[email protected]>
Cc: David Miller <[email protected]>; Networking <[email protected]>; Doug Ledford <[email protected]>; Linux-Next Mailing List <[email protected]>; Linux Kernel Mailing List <linux- [email protected]>; Parav Pandit <[email protected]>; Ursula Braun <[email protected]>; Leon Romanovsky <[email protected]>; linux- [email protected]
Subject: [PATCH rdma] IB/cache: Restore compatibility for ib_query_gid

Quoted 2 lines
Quoted 2 lines

Code changes in smc have become so complicated this cycle that the RDMA patches to remove ib_query_gid in smc create too complex merge

conflicts.

Quoted 3 lines
Quoted 3 lines

Allow those conflicts to be resolved by using the net/smc hunks by providing a compatibility wrapper. During the second phase of the merge window this wrapper will be deleted and smc updated to use the new

API.

Quoted 9 lines
Quoted 9 lines

include/rdma/ib_cache.h | 24 ++++++++++++++++++++++++

 1 file changed, 24 insertions(+)

The resolution Stephen had to make is too complicated, I think we should go this way instead. Parav can send a patch to DaveM during the 2nd half of the merge window to safely update SMC and delete this

wrapper.

Quoted 1 line
Quoted 1 line
Quoted 9 lines
Quoted 2 lines

Last night Stephen send the changes, if Ursula can test it, its preferred but if that is not possible, I am with below approach too.

Thing is one of us has to explain to Linus how to handle this conflict, as Stephen's resolutions do not automatically go him.

Given how much new code the resolution introduces, I prefer to not send it to Linus..

Ok. Sounds good.

Quoted 52 lines
Quoted 11 lines
Quoted 11 lines

Parav, can you check this?

Ursula, this is only for SMC, are you able to test SMC with it? You will need to apply it to the RDMA tree here:

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h
=for-next

Thanks,
Jason

Quoted 11 lines

include/rdma/ib_cache.h index const struct ib_gid_attr · line 138

Quoted 11 lines
include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +0 -0

1108d422027696..c7e9b42b96e5b8 100644
+++ b/include/rdma/ib_cache.h

include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +3 -0
@@ -132,4 +132,28 @@ const struct ib_gid_attr
 *rdma_get_gid_attr(struct ib_device *device,
 					    u8 port_num, int index);
 void rdma_put_gid_attr(const struct ib_gid_attr *attr);  void
 rdma_hold_gid_attr(const struct ib_gid_attr *attr);
+
+/*
+ * This is to be removed. It only exists to make merging rdma and smc

simpler.

Quoted 9 lines

include/rdma/ib_cache.h index const struct ib_gid_attr · line 146

Quoted 8 lines
include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +8 -0
+ */
+static inline __deprecated int ib_query_gid(struct ib_device *device,
+					    u8 port_num, int index,
+					    union ib_gid *gid,
+					    struct ib_gid_attr *attr_out) {
+	const struct ib_gid_attr *attr;
+
+	attr = rdma_get_gid_attr(device,port_num,index);

White space after each variable is needed to avoid warnings.

Woops, no problem.

Quoted 8 lines
Quoted 8 lines
include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +8 -0
+	if (IS_ERR(attr))
+		return PTR_ERR(attr);
+
+	if (attr->ndev)
+		dev_hold(attr->ndev);
+	*attr_out = *attr;
+
+	rdma_put_gid_attr(attr);
Quoted 8 lines

include/rdma/ib_cache.h index const struct ib_gid_attr

Quoted 5 lines
include/rdma/ib_cache.h index renamed from include/rdma/ib_cache.h +4 -0
+
+	return 0;
+}
+
 #endif /* _IB_CACHE_H */

Rest looks fine.
RB: [email protected]

Quoted 3 lines

In future please spell out the Reviewed-by - patchworks will automate collecting the tags and add it to the patch, otherwise maintainers have to do it by hand.

I see. I will do it correctly now on using Reviewed-by.

Quoted 2 lines

Thanks,
Jason

#4 lore raw
In reply to Jason Gunthorpe
Quoted 18 lines · Jason Gunthorpe

Code changes in smc have become so complicated this cycle that the RDMA patches to remove ib_query_gid in smc create too complex merge conflicts. Allow those conflicts to be resolved by using the net/smc hunks by providing a compatibility wrapper. During the second phase of the merge window this wrapper will be deleted and smc updated to use the new API.

 include/rdma/ib_cache.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

The resolution Stephen had to make is too complicated, I think we should go this way instead. Parav can send a patch to DaveM during the 2nd half of the merge window to safely update SMC and delete this wrapper.

Parav, can you check this?

Quoted 7 lines

Ursula, this is only for SMC, are you able to test SMC with it? You will need to apply it to the RDMA tree here:

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h=for-next

Thanks,
Jason

I applied this to rdma for-next with Parav's notes.

Jason