Skip to contentSkip to conversation

mlx4: properly mask MGM entry members count

PATCH Superseded Eli Cohen 5 participants 15 messages Nov 15, 2010 – Nov 30, 2010 9 messages not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Eli Cohen

author
#0 lore raw

PATCH 1/1 mlx4: properly mask MGM entry members count

The members_count field size is 24 bits so mask it properly when reading it.

---
 drivers/net/mlx4/mcg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/mlx4/mcg.c +1 -1
index c4f88b7..fff20fc 100644
@@ -187,7 +187,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
 		memcpy(mgm->gid, gid, 16);
 	}
 
-	members_count = be32_to_cpu(mgm->members_count);
+	members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
 	if (members_count == MLX4_QP_PER_MGM) {
 		mlx4_err(dev, "MGM at index %x is full.\n", index);
 		err = -ENOMEM;
Signature · 6 lines
1.6.0.2

--
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
#1 lore raw
Quoted 21 lines · Eli Cohen

The members_count field size is 24 bits so mask it properly when reading it.

---
 drivers/net/mlx4/mcg.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/mlx4/mcg.c +1 -2
index c4f88b7..fff20fc 100644
@@ -187,7 +187,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
                memcpy(mgm->gid, gid, 16);
        }
 
-       members_count = be32_to_cpu(mgm->members_count);
+       members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
        if (members_count == MLX4_QP_PER_MGM) {
                mlx4_err(dev, "MGM at index %x is full.\n", index);
                err = -ENOMEM;
--
Quoted 2 lines

1.6.0.2

Don't you need to do the same when detaching?
--
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): AANLkTi=zJsFjbrZrpj-E65T49ewgqdia+MOPnqmgx5KW-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#6 lore raw
Quoted 5 lines · Roland Dreier
Quoted 1 line

The members_count field size is 24 bits so mask it properly when reading it.

what's the impact of this? Does this actually fix something seen in practice or is it just found by inspection?

We need this patch as the MS byte is used now to encode the protocol of the multicast address. I need to resend since the patch is missing handling in the dettach function.
--
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

#7 lore raw
Quoted 3 lines

We need this patch as the MS byte is used now to encode the protocol of the multicast address. I need to resend since the patch is missing handling in the dettach function.

Where is the change in handling in the members_count field? In the firmware?

- R.
--
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): [email protected]

author
#9 lore raw
Quoted 3 lines · Roland Dreier

Where is the change in handling in the members_count field? In the firmware?

The firmware now distinguishes between differnet multicast addresses according to a protocol field located in the high MS byte which previously was reserved. The patches that Alekseys will will probably send later make use of this.
--
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

#10 lore raw
Quoted 6 lines
Quoted 2 lines

Where is the change in handling in the members_count field? In the firmware?

The firmware now distinguishes between differnet multicast addresses according to a protocol field located in the high MS byte which previously was reserved. The patches that Alekseys will will probably send later make use of this.

OK, so what you seem to be saying is that this patch is not fixing anything until we add Alekseys patches?

- R.
--
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): [email protected]

author
#12 lore raw
Quoted 10 lines · Roland Dreier
Quoted 6 lines
Quoted 2 lines

Where is the change in handling in the members_count field? In the firmware?

The firmware now distinguishes between differnet multicast addresses according to a protocol field located in the high MS byte which previously was reserved. The patches that Alekseys will will probably send later make use of this.

OK, so what you seem to be saying is that this patch is not fixing anything until we add Alekseys patches?

It only keeps the code and the PRM in sync.
--
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

#13 lore raw
Quoted 8 lines · Eli Cohen
Quoted 7 lines · Roland Dreier

 > > Where is the change in handling in the members_count field?  In the firmware? > >
 > The firmware now distinguishes between differnet multicast addresses > according to a protocol field located in the high MS byte which
 > previously was reserved. The patches that Alekseys will will probably > send later make use of this.

Quoted 5 lines
Quoted 3 lines

OK, so what you seem to be saying is that this patch is not fixing anything until we add Alekseys patches?

It only keeps the code and the PRM in sync.
--

RAW_ETH patches cannot be applied without it, so we really need this masking. In addition, Yevgeny's mlx SRIOV patches
(http://marc.info/?l=linux-rdma&m=127619666403521&w=2 ),
also using this field - there are changes in find_mgm function. --
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): AANLkTinN43YgQW3ftbng-4f2NiNe9_oXPVCX5LPzh7uG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#15 lore raw
Quoted 1 line · Aleksey Senin

RAW_ETH patches cannot be applied without it, so we really need this masking.

So Maybe it would be easier to review and merge if you add this patch to the raw qp patch set you mentioned

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

A message that is not in the archive (sent off-list or not yet received): 4CEE200B.70106-hKgKHo2Ms0FWk0Htik3J/[email protected]

#17 lore raw
Quoted 7 lines · Or Gerlitz
Quoted 1 line · Aleksey Senin

RAW_ETH patches cannot be applied without it, so we really need this masking.

So Maybe it would be easier to review and merge if you add this patch to the raw qp patch set you mentioned

Or.

I don't think that RAW_ETH patches should contain fixes for Mellanox driver implementation and make it working according to Mellanox PRM. In any case, Eli sent patch that easy to review and merge.
In addition, even if I include this change to my series, there is a chance that from the whole set, will be accepted only this one, and the rest will be accepted later ;-)
--
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): 1290675387.4050.51.camel-uOVkuFIEnOODI2cvxHXf6UEOCMrvLtNR@public.gmane.org

#19 lore raw

Hello, Roland.

I afraid that you overloaded with dozen of e-mails and missed this question, so I'd ask you again. Is there any reason why this members_count patch cannot be applied?

Quoted 7 lines · Alekseys Senin
Quoted 6 lines · Or Gerlitz
Quoted 1 line · Aleksey Senin

RAW_ETH patches cannot be applied without it, so we really need this masking.

So Maybe it would be easier to review and merge if you add this patch to the raw qp patch set you mentioned

Quoted 9 lines
Quoted 1 line

Or.

I don't think that RAW_ETH patches should contain fixes for Mellanox driver implementation and make it working according to Mellanox PRM. In any case, Eli sent patch that easy to review and merge. In addition, even if I include this change to my series, there is a chance that from the whole set, will be accepted only this one, and the rest will be accepted later ;-)

--
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): AANLkTikWrQRcA62bkM=1zWQuyH6nABSvqnbAeaAjfgcP-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#21 lore raw
Quoted 3 lines

I afraid that you overloaded with dozen of e-mails and missed this question, so I'd ask you again. Is there any reason why this members_count patch cannot be applied?

No, it is fine. I will merge it for 2.6.38. However this long thread should (I hope) show how the changelog could be improved -- if the original patch had said why the patch was needed then we could have avoided all this long discussion.

- R.
--
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): [email protected]

#23 lore raw
Quoted 10 lines · Roland Dreier

 > I afraid that you  overloaded with dozen of e-mails and missed this > question, so I'd ask you again. Is there any reason why this > members_count patch cannot be applied?

No, it is fine.  I will merge it for 2.6.38.  However this long thread should (I hope) show how the changelog could be improved -- if the original patch had said why the patch was needed then we could have avoided all this long discussion.

 - R.

Excellent news, thanks.
--
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