Skip to contentSkip to conversation

Raw Packet QP Fixes for 4.8

PATCH In review Leon Romanovsky 5 participants 14 messages Jul 3, 2016 – Jul 5, 2016 10 messages not in the archive

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

cover Raw Packet QP Fixes for 4.8

Hi Doug,

This patch series includes raw packet QP fixes which are targeted for 4.8. They apply cleanly on top of your k.o/for-4.8 branch.

These patches are available in the "topic/fix_raw_eth_qos" branch of this git repo:
git://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git

Or for browsing:
https://git.kernel.org/cgit/linux/kernel/git/leon/linux-rdma.git/log/?h=topic/fix_raw_eth_qos

Thanks

Talat Batheesh (3):
IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP IB/mlx5: Fix mlx5_set_path for Raw Packet QP

 drivers/infiniband/core/verbs.c | 3 ++-
 drivers/infiniband/hw/mlx5/qp.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1467549727-23479-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw

PATCH 1/3 IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

In order to configure QoS for Raw Packet QP, the user passes the SL in the AV attribute when modifying the QP from INIT to RTR state.

This SL is used later on to set the Ethernet Priority of the QP.

Until today, we couldn't pass the AV attribute for Raw Packet QP because it was blocked in the QP state transition matrix. This patch adds the AV as optional in INIT to RTR.

Fixes 8a51866f0810 ('IB: Add ib_modify_qp_is_ok() library function')
---
 drivers/infiniband/core/verbs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/core/verbs.c +1 -0
index 2e813ed..ba75780 100644
@@ -932,6 +932,7 @@ static const struct {
 						 IB_QP_QKEY),
 				 [IB_QPT_GSI] = (IB_QP_PKEY_INDEX		|
 						 IB_QP_QKEY),
+				 [IB_QPT_RAW_PACKET] = IB_QP_AV,
 			 },
 		},
 	},
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1467549727-23479-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#4 lore raw

Re: [PATCH for-next 1/3] IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR

Quoted 5 lines · Leon Romanovsky

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

In order to configure QoS for Raw Packet QP, the user passes the SL in the AV attribute when modifying the QP from INIT to RTR state.

Quoted 7 lines

This SL is used later on to set the Ethernet Priority of the QP.

Until today, we couldn't pass the AV attribute for Raw Packet QP because it was blocked in the QP state transition matrix. This patch adds the AV as optional in INIT to RTR.

Fixes 8a51866f0810 ('IB: Add ib_modify_qp_is_ok() library function')

This commit is 10y old and was done way before RAW Packet QP was added to the kernel, please fix your Fixes: line...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAJ3xEMiaD99d96RKGwD3OpgEOn0RXjXoaRuFWT6PJdXQSOo5rQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw

Re: [PATCH for-next 1/3] IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR

Quoted 8 lines · Or Gerlitz
Quoted 7 lines · Leon Romanovsky

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

In order to configure QoS for Raw Packet QP, the user passes the SL in the AV attribute when modifying the QP from INIT to RTR state.

This SL is used later on to set the Ethernet Priority of the QP.

Quoted 8 lines
Quoted 5 lines

Until today, we couldn't pass the AV attribute for Raw Packet QP because it was blocked in the QP state transition matrix. This patch adds the AV as optional in INIT to RTR.

Fixes 8a51866f0810 ('IB: Add ib_modify_qp_is_ok() library function')

This commit is 10y old and was done way before RAW Packet QP was added to the kernel, please fix your Fixes: line...

It isn't a fixes if you are adding a new feature.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20160704153337.GB23122-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org

#8 lore raw

Re: [PATCH for-next 1/3] IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR

Quoted 13 lines · Jason Gunthorpe
Quoted 12 lines · Or Gerlitz
Quoted 11 lines · Leon Romanovsky

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

In order to configure QoS for Raw Packet QP, the user passes the SL in the AV attribute when modifying the QP from INIT to RTR state.

This SL is used later on to set the Ethernet Priority of the QP.

Until today, we couldn't pass the AV attribute for Raw Packet QP because it was blocked in the QP state transition matrix. This patch adds the AV as optional in INIT to RTR.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Fixes 8a51866f0810 ('IB: Add ib_modify_qp_is_ok() library function')

This commit is 10y old and was done way before RAW Packet QP was added to the kernel, please fix your Fixes: line...

It isn't a fixes if you are adding a new feature.

You are right, I'll resubmit.

Quoted 6 lines

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw

PATCH 2/3 IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP

In reply to a message not in the archive

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

For Raw Packet QP, the AV attribute is passed in INIT to RTR in order to set the Ethernet Priority using the SL. The rest of the fields aren't necessarily valid, which causes the ib_resolve_eth_dmac to fail.

Since no release address resolution is needed, don't do anything in ib_resolve_eth_dmac for Raw Packet QP.

Fixes dbf727de7440 ('IB/core: Use GID table in AH creation and ...')
---
 drivers/infiniband/core/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/verbs.c +1 -1
index ba75780..d41e403 100644
@@ -1171,7 +1171,7 @@ int ib_resolve_eth_dmac(struct ib_qp *qp,
 {
 	int           ret = 0;
 
-	if (*qp_attr_mask & IB_QP_AV) {
+	if ((*qp_attr_mask & IB_QP_AV) && (qp->qp_type != IB_QPT_RAW_PACKET)) {
 		if (qp_attr->ah_attr.port_num < rdma_start_port(qp->device) ||
 		    qp_attr->ah_attr.port_num > rdma_end_port(qp->device))
 			return -EINVAL;
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1467549727-23479-3-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#11 lore raw

Re: [PATCH for-next 2/3] IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP

Quoted 8 lines · Leon Romanovsky

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

For Raw Packet QP, the AV attribute is passed in INIT to RTR in order to set the Ethernet Priority using the SL. The rest of the fields aren't necessarily valid, which causes the ib_resolve_eth_dmac to fail.

Since no release address resolution is needed, don't do anything in ib_resolve_eth_dmac for Raw Packet QP.

What "release address resolution" means?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAJ3xEMg+kqmEQ7B_JAKGnu3ubwu5f-40jbeL4Wg9udUeoxEZJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#13 lore raw

Re: [PATCH for-next 2/3] IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP

Sent from my iPhone

Quoted 5 lines · Or Gerlitz
Quoted 4 lines · Leon Romanovsky

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

Quoted 8 lines
Quoted 6 lines

For Raw Packet QP, the AV attribute is passed in INIT to RTR in order to set the Ethernet Priority using the SL. The rest of the fields aren't necessarily valid, which causes the ib_resolve_eth_dmac to fail.

Since no release address resolution is needed, don't do anything in ib_resolve_eth_dmac for Raw Packet QP.

What "release address resolution" means?

Oops sorry for the typo error, "real" not "release".

Yours,
Talat
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): C8D4A0D8-4D97-4BAB-8FE4-DDEDDDAF9775-VPRAkNaXOzVWk0Htik3J/[email protected]

#15 lore raw

Re: [PATCH for-next 2/3] IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP

Quoted 5 lines · Talat Batheesh
Quoted 3 lines · Or Gerlitz

What "release address resolution" means?

Oops sorry for the typo error, "real" not "release".

whatever, fix it for V2, unless you really (really?) want that to be for ever in the kernel log in this confusing way
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#16 lore raw

PATCH 3/3 IB/mlx5: Fix mlx5_set_path for Raw Packet QP

In reply to a message not in the archive

From: Talat Batheesh <talatb-VPRAkNaXOzVWk0Htik3J/[email protected]>

mlx5_set_path returns error when called without GRH in Ethernet link layer. Since this is not mandatory for Raw Packet QP, it shouldn't fail in this case.

Added additional check of QP type to make the decision.

Fixes 2811ba51b049 ('IB/mlx5: Add RoCE fields to Address Vector')
---
 drivers/infiniband/hw/mlx5/qp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +2 -1
index e9b3a1f..fbd94a9 100644
@@ -2175,7 +2175,8 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
 	}
 
 	if (ll == IB_LINK_LAYER_ETHERNET) {
-		if (!(ah->ah_flags & IB_AH_GRH))
+		if (!(ah->ah_flags & IB_AH_GRH) &&
+		    (qp->ibqp.qp_type != IB_QPT_RAW_PACKET))
 			return -EINVAL;
 		memcpy(path->rmac, ah->dmac, sizeof(ah->dmac));
 		path->udp_sport = mlx5_get_roce_udp_sport(dev, port,
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1467549727-23479-4-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#18 lore raw

Re: [PATCH for-next 3/3] IB/mlx5: Fix mlx5_set_path for Raw Packet QP

drivers/infiniband/hw/mlx5/qp.c static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · line 2182

Quoted 12 lines · Leon Romanovsky
drivers/infiniband/hw/mlx5/qp.c +2 -1
@@ -2175,7 +2175,8 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
        }
 
        if (ll == IB_LINK_LAYER_ETHERNET) {
-               if (!(ah->ah_flags & IB_AH_GRH))
+               if (!(ah->ah_flags & IB_AH_GRH) &&
+                   (qp->ibqp.qp_type != IB_QPT_RAW_PACKET))
                        return -EINVAL;
                memcpy(path->rmac, ah->dmac, sizeof(ah->dmac));
                path->udp_sport = mlx5_get_roce_udp_sport(dev, port,

As you can see here, that code was written with RoCE state of mind, e.g they set the remote mac and udp source port, with both being irrelevant for RAW packet QPs. So in that respect, your fix is wrong. Make the code clear and correct in what they set to RoCE QPs, to RAW Packet QPs and to both.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAJ3xEMhZiBjQwjgXj8peLYW4wETEE96UJ8BC7TLyO0G_jn-iBg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#20 lore raw

Re: [PATCH for-next 3/3] IB/mlx5: Fix mlx5_set_path for Raw Packet QP

Quoted 7 lines · Or Gerlitz
Quoted 5 lines · Leon Romanovsky
drivers/infiniband/hw/mlx5/qp.c +0 -0
@@ -2175,7 +2175,8 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
        }
 
Quoted 13 lines

drivers/infiniband/hw/mlx5/qp.c static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · line 2182

Quoted 7 lines
drivers/infiniband/hw/mlx5/qp.c +2 -1
        if (ll == IB_LINK_LAYER_ETHERNET) {
-               if (!(ah->ah_flags & IB_AH_GRH))
+               if (!(ah->ah_flags & IB_AH_GRH) &&
+                   (qp->ibqp.qp_type != IB_QPT_RAW_PACKET))
                        return -EINVAL;
                memcpy(path->rmac, ah->dmac, sizeof(ah->dmac));
                path->udp_sport = mlx5_get_roce_udp_sport(dev, port,

As you can see here, that code was written with RoCE state of mind, e.g they set the remote mac and udp source port, with both being irrelevant for RAW packet QPs. So in that respect, your fix is wrong. Make the code clear and correct in what they set to RoCE QPs, to RAW Packet QPs and to both.

If I read your response and code correctly, we can safely drop this patch. Am I right?

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20160704051403.GB5289-2ukJVAZIZ/[email protected]

#22 lore raw

Re: [PATCH for-next 3/3] IB/mlx5: Fix mlx5_set_path for Raw Packet QP

Quoted 4 lines · Leon Romanovsky

On Mon, Jul 04, 2016 at 12:55:36AM +0300, Or Gerlitz wrote:

If I read your response and code correctly, we can safely drop this patch. Am I right?

Of course no. You are fixing a bug and I pointed you that you need to extend the fix a bit.

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#23 lore raw
In reply to a message not in the archive
Quoted 4 lines · Leon Romanovsky

Hi Doug,

This patch series includes raw packet QP fixes which are targeted for 4.8. They apply cleanly on top of your k.o/for-4.8 branch.

Doug,
Please drop this series, "fixes line" misled me.
Sorry for inconvenience.