* [PATCH] mlx4_core: num reserved eqs presented as log and actual
@ 2010-02-15 8:58 Yevgeny Petrilin
[not found] ` <4B790CAD.2070007-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Yevgeny Petrilin @ 2010-02-15 8:58 UTC (permalink / raw)
To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Multifunctional firmware should present number of reserved EQs as
an actual number (number of reserved eqs is not necessarily a power
of 2).
Older drivers treat this field as log, so when there are relatively big
number of reserved eqs, they would fail.
The firmware would present the number of EQs as log in a single function mode
(which would also work for older driver versions) and as actual number (in other field)
in multifunctional mode. The new code would check both fields.
Fixes commit be504b0b9fbe9ba447c93ef0f5789f377102d555
Signed-off-by: Yevgeny Petrilin <yevgenyp-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
drivers/net/mlx4/fw.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index 04f42ae..b5b4799 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -155,11 +155,12 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
#define QUERY_DEV_CAP_MAX_SRQ_OFFSET 0x15
#define QUERY_DEV_CAP_RSVD_EEC_OFFSET 0x16
#define QUERY_DEV_CAP_MAX_EEC_OFFSET 0x17
+#define QUERY_DEV_CAP_RSVD_EQ_OFFSET 0x18
#define QUERY_DEV_CAP_MAX_CQ_SZ_OFFSET 0x19
#define QUERY_DEV_CAP_RSVD_CQ_OFFSET 0x1a
#define QUERY_DEV_CAP_MAX_CQ_OFFSET 0x1b
#define QUERY_DEV_CAP_MAX_MPT_OFFSET 0x1d
-#define QUERY_DEV_CAP_RSVD_EQ_OFFSET 0x1e
+#define QUERY_DEV_CAP_LOG_RSVD_EQ_OFFSET 0x1e
#define QUERY_DEV_CAP_MAX_EQ_OFFSET 0x1f
#define QUERY_DEV_CAP_RSVD_MTT_OFFSET 0x20
#define QUERY_DEV_CAP_MAX_MRW_SZ_OFFSET 0x21
@@ -236,7 +237,11 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MPT_OFFSET);
dev_cap->max_mpts = 1 << (field & 0x3f);
MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_EQ_OFFSET);
- dev_cap->reserved_eqs = field & 0xf;
+ if (!field) {
+ MLX4_GET(field, outbox, QUERY_DEV_CAP_LOG_RSVD_EQ_OFFSET);
+ dev_cap->reserved_eqs = 1 << (field & 0xf);
+ } else
+ dev_cap->reserved_eqs = field;
MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_EQ_OFFSET);
dev_cap->max_eqs = 1 << (field & 0xf);
MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MTT_OFFSET);
--
1.6.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mlx4_core: num reserved eqs presented as log and actual
[not found] ` <4B790CAD.2070007-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
@ 2010-02-19 19:10 ` Roland Dreier
0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2010-02-19 19:10 UTC (permalink / raw)
To: Yevgeny Petrilin; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
> Multifunctional firmware should present number of reserved EQs as
> an actual number (number of reserved eqs is not necessarily a power
> of 2).
> Older drivers treat this field as log, so when there are relatively big
> number of reserved eqs, they would fail.
> The firmware would present the number of EQs as log in a single function mode
> (which would also work for older driver versions) and as actual number (in other field)
> in multifunctional mode. The new code would check both fields.
> Fixes commit be504b0b9fbe9ba447c93ef0f5789f377102d555
I can't really follow this changelog. The (very old) ConnextX PRM I
have states that the field returned by the firmware is the actual
number, so the old driver behavior was wrong. Or was the PRM wrong?
Are you changing the firmware behavior to make that field into a log?
Is this really the best way to clean this up, having the same
information twice in two different formats?
--
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-19 19:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 8:58 [PATCH] mlx4_core: num reserved eqs presented as log and actual Yevgeny Petrilin
[not found] ` <4B790CAD.2070007-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-02-19 19:10 ` Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox