aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx4
diff options
context:
space:
mode:
authorHadar Hen Zion <hadarh@mellanox.co.il>2012-07-05 00:03:44 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-07 19:23:05 -0400
commitc96d97f4d127b61def87b3ee056bec20cfc265d1 (patch)
tree84c89ead71dd4f7a0795aa703b60bb5c5eb2d5a4 /include/linux/mlx4
parent6d19993788e080edb557178cc6aba2d963edce4e (diff)
net/mlx4: Set steering mode according to device capabilities
Instead of checking the firmware supported steering mode in various places in the code, add a dedicated field in the mlx4 device capabilities structure which is written once during the initialization flow and read across the code. This also set the grounds for add new steering modes. Currently two modes are supported, and are named after the ConnectX HW versions A0 and B0. A0 steering uses mac_index, vlan_index and priority to steer traffic into pre-defined range of QPs. B0 steering uses Ethernet L2 hashing rules and is enabled only if the firmware supports both unicast and multicast B0 steering, The current steering modes are relevant for Ethernet traffic only, such that Infiniband steering remains untouched. Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r--include/linux/mlx4/device.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6a8f002b8ed3..7f5c9ee42f96 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -70,6 +70,29 @@ enum {
70 MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1) 70 MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1)
71}; 71};
72 72
73/* Driver supports 2 diffrent device methods to manage traffic steering:
74 * - B0 steering mode - Common low level API for ib and (if supported) eth.
75 * - A0 steering mode - Limited low level API for eth. In case of IB,
76 * B0 mode is in use.
77 */
78enum {
79 MLX4_STEERING_MODE_A0,
80 MLX4_STEERING_MODE_B0
81};
82
83static inline const char *mlx4_steering_mode_str(int steering_mode)
84{
85 switch (steering_mode) {
86 case MLX4_STEERING_MODE_A0:
87 return "A0 steering";
88
89 case MLX4_STEERING_MODE_B0:
90 return "B0 steering";
91 default:
92 return "Unrecognize steering mode";
93 }
94}
95
73enum { 96enum {
74 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 97 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
75 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 98 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
@@ -295,6 +318,7 @@ struct mlx4_caps {
295 int num_amgms; 318 int num_amgms;
296 int reserved_mcgs; 319 int reserved_mcgs;
297 int num_qp_per_mgm; 320 int num_qp_per_mgm;
321 int steering_mode;
298 int num_pds; 322 int num_pds;
299 int reserved_pds; 323 int reserved_pds;
300 int max_xrcds; 324 int max_xrcds;