* [PATCH 01/25 v2] mlx4_core: identify function as pf or vf
@ 2009-11-06 3:07 Yevgeny Petrilin
[not found] ` <4AF3930E.90904-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Yevgeny Petrilin @ 2009-11-06 3:07 UTC (permalink / raw)
To: rdreier-FYB4Gu1CFyUAvxtiuMwx3w
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
liranl-VPRAkNaXOzVS1MOuV/RT9w, tziporet-VPRAkNaXOzVS1MOuV/RT9w,
yevgenyp-VPRAkNaXOzVS1MOuV/RT9w
From: Liran Liss <liranl-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Signed-off-by: Liran Liss <liranl-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Signed-off-by: Yevgeny Petrilin <yevgenyp-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
include/linux/mlx4/device.h | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index ce7cc6c..f35703d 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -42,6 +42,9 @@
enum {
MLX4_FLAG_MSI_X = 1 << 0,
MLX4_FLAG_OLD_PORT_CMDS = 1 << 1,
+ MLX4_FLAG_MASTER = 1 << 2,
+ MLX4_FLAG_SLAVE = 1 << 3,
+ MLX4_FLAG_SRIOV = 1 << 4,
};
enum {
@@ -375,6 +378,7 @@ struct mlx4_av {
struct mlx4_dev {
struct pci_dev *pdev;
unsigned long flags;
+ unsigned long num_slaves;
struct mlx4_caps caps;
struct radix_tree_root qp_table_tree;
u32 rev_id;
@@ -400,6 +404,21 @@ struct mlx4_init_port_param {
if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \
~(dev)->caps.port_mask) & 1 << ((port) - 1))
+static inline int mlx4_is_slave(struct mlx4_dev *dev)
+{
+ return dev->flags & MLX4_FLAG_SLAVE;
+}
+
+static inline int mlx4_is_master(struct mlx4_dev *dev)
+{
+ return dev->flags & MLX4_FLAG_MASTER;
+}
+
+static inline int mlx4_is_mfunc(struct mlx4_dev *dev)
+{
+ return dev->flags & (MLX4_FLAG_MASTER | MLX4_FLAG_SLAVE);
+}
+
int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
struct mlx4_buf *buf);
void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
--
1.5.3.7
--
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] 4+ messages in thread
* Re: [PATCH 01/25 v2] mlx4_core: identify function as pf or vf
[not found] ` <4AF3930E.90904-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
@ 2010-01-25 19:20 ` Roland Dreier
[not found] ` <adar5peouu3.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2010-01-25 19:20 UTC (permalink / raw)
To: Yevgeny Petrilin
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
liranl-VPRAkNaXOzVS1MOuV/RT9w, tziporet-VPRAkNaXOzVS1MOuV/RT9w
> enum {
> MLX4_FLAG_MSI_X = 1 << 0,
> MLX4_FLAG_OLD_PORT_CMDS = 1 << 1,
> + MLX4_FLAG_MASTER = 1 << 2,
> + MLX4_FLAG_SLAVE = 1 << 3,
> + MLX4_FLAG_SRIOV = 1 << 4,
> };
I'm a bit confused by these flags. As far as I can tell, the SRIOV flag
will be set if and only if MASTER is set too... so in other words we
might as well just have the MASTER and SLAVE flags and not have the
SRIOV flag at all.
- R.
--
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] 4+ messages in thread
* RE: [PATCH 01/25 v2] mlx4_core: identify function as pf or vf
[not found] ` <adar5peouu3.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
@ 2010-01-26 8:21 ` Yevgeny Petrilin
[not found] ` <E113D394D7C5DB4F8FF691FA7EE9DB44384E3CAC3F-WQlSmcKwN8Te+A/uUDamNg@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Yevgeny Petrilin @ 2010-01-26 8:21 UTC (permalink / raw)
To: Roland Dreier
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Liran Liss,
Tziporet Koren
> I'm a bit confused by these flags. As far as I can tell, the SRIOV flag will be set if and > only if MASTER is set too... so in other words we might as well just have the MASTER and > > SLAVE flags and not have the SRIOV flag at all.
We could have a situation where we have multiple physical functions, without SRIOV.
In this case one of the functions would be MASTER, but not SRIOV
Yevgeny
--
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] 4+ messages in thread
* Re: [PATCH 01/25 v2] mlx4_core: identify function as pf or vf
[not found] ` <E113D394D7C5DB4F8FF691FA7EE9DB44384E3CAC3F-WQlSmcKwN8Te+A/uUDamNg@public.gmane.org>
@ 2010-01-26 23:49 ` Roland Dreier
0 siblings, 0 replies; 4+ messages in thread
From: Roland Dreier @ 2010-01-26 23:49 UTC (permalink / raw)
To: Yevgeny Petrilin
Cc: linux-rdma@vger.kernel.org, netdev@vger.kernel.org, Liran Liss,
Tziporet Koren
> > I'm a bit confused by these flags. As far as I can tell, the SRIOV flag will be set if and > only if MASTER is set too... so in other words we might as well just have the MASTER and > > SLAVE flags and not have the SRIOV flag at all.
> We could have a situation where we have multiple physical functions, without SRIOV.
> In this case one of the functions would be MASTER, but not SRIOV
Where in the code could that happen? The only place I see the SRIOV or
MASTER flag get set is a line like:
dev->flags |= MLX4_FLAG_SRIOV | MLX4_FLAG_MASTER;
so they are never used separately.
- R.
--
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] 4+ messages in thread
end of thread, other threads:[~2010-01-26 23:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-06 3:07 [PATCH 01/25 v2] mlx4_core: identify function as pf or vf Yevgeny Petrilin
[not found] ` <4AF3930E.90904-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-01-25 19:20 ` Roland Dreier
[not found] ` <adar5peouu3.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
2010-01-26 8:21 ` Yevgeny Petrilin
[not found] ` <E113D394D7C5DB4F8FF691FA7EE9DB44384E3CAC3F-WQlSmcKwN8Te+A/uUDamNg@public.gmane.org>
2010-01-26 23:49 ` Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox