Raw Packet QP Fixes for 4.8
Subsystems (2)
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
PATCH 1/3 IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR
In reply to a message not in the archiveFrom: 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.
--- drivers/infiniband/core/verbs.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/core/verbs.c +1 -0
@@ -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
PATCH 2/3 IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP
In reply to a message not in the archiveFrom: 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.
--- drivers/infiniband/core/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/verbs.c +1 -1
@@ -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
PATCH 3/3 IB/mlx5: Fix mlx5_set_path for Raw Packet QP
In reply to a message not in the archiveFrom: 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.
--- drivers/infiniband/hw/mlx5/qp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
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,
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
Re: [PATCH for-next 2/3] IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP
In reply to a message not in the archiveQuoted 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_dmacto fail.Since no release address resolution is needed, don't do anything in
ib_resolve_eth_dmacfor 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
Re: [PATCH for-next 1/3] IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR
In reply to a message not in the archiveQuoted 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
Re: [PATCH for-next 3/3] IB/mlx5: Fix mlx5_set_path for Raw Packet QP
In reply to a message not in the archivedrivers/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
Re: [PATCH for-next 3/3] IB/mlx5: Fix mlx5_set_path for Raw Packet QP
In reply to a message not in the archiveQuoted 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
-1if (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
Re: [PATCH for-next 2/3] IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP
In reply to a message not in the archiveSent 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_dmacto fail.Since no release address resolution is needed, don't do anything in
ib_resolve_eth_dmacfor 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
Re: [PATCH for-next 3/3] IB/mlx5: Fix mlx5_set_path for Raw Packet QP
In reply to a message not in the archiveQuoted 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
Re: [PATCH for-next 2/3] IB/core: Fix ib_resolve_eth_dmac for Raw Packet QP
In reply to a message not in the archiveQuoted 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
Re: [PATCH for-next 1/3] IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR
In reply to a message not in the archiveQuoted 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
Re: [PATCH for-next 1/3] IB/core: Add optional AV attribute for Raw Packet QP in INIT to RTR
In reply to a message not in the archiveQuoted 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
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.