aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2014-12-11 03:57:57 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-11 14:47:35 -0500
commitd57febe1a47801ef8a55dbf10672850523dfaa60 (patch)
treed5a9cfb4c5c57c147e8ce61f5738337b03ea458a /include/linux
parent7a89399ffad7b7c47b43afda010309b3b88538c0 (diff)
net/mlx4: Add A0 hybrid steering
A0 hybrid steering is a form of high performance flow steering. By using this mode, mlx4 cards use a fast limited table based steering, in order to enable fast steering of unicast packets to a QP. In order to implement A0 hybrid steering we allocate resources from different zones: (1) General range (2) Special MAC-assigned QPs [RSS, Raw-Ethernet] each has its own region. When we create a rss QP or a raw ethernet (A0 steerable and BF ready) QP, we try hard to allocate the QP from range (2). Otherwise, we try hard not to allocate from this range. However, when the system is pushed to its limits and one needs every resource, the allocator uses every region it can. Meaning, when we run out of raw-eth qps, the allocator allocates from the general range (and the special-A0 area is no longer active). If we run out of RSS qps, the mechanism tries to allocate from the raw-eth QP zone. If that is also exhausted, the allocator will allocate from the general range (and the A0 region is no longer active). Note that if a raw-eth qp is allocated from the general range, it attempts to allocate the range such that bits 6 and 7 (blueflame bits) in the QP number are not set. When the feature is used in SRIOV, the VF has to notify the PF what kind of QP attributes it needs. In order to do that, along with the "Eth QP blueflame" bit, we reserve a new "A0 steerable QP". According to the combination of these bits, the PF tries to allocate a suitable QP. In order to maintain backward compatibility (with older PFs), the PF notifies which QP attributes it supports via QUERY_FUNC_CAP command. Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx4/device.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 272aa258c036..39890cddc5fa 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -195,7 +195,8 @@ enum {
195}; 195};
196 196
197enum { 197enum {
198 MLX4_QUERY_FUNC_FLAGS_BF_RES_QP = 1LL << 0 198 MLX4_QUERY_FUNC_FLAGS_BF_RES_QP = 1LL << 0,
199 MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1
199}; 200};
200 201
201/* bit enums for an 8-bit flags field indicating special use 202/* bit enums for an 8-bit flags field indicating special use
@@ -207,6 +208,7 @@ enum {
207 * This enum may use only bits 0..7. 208 * This enum may use only bits 0..7.
208 */ 209 */
209enum { 210enum {
211 MLX4_RESERVE_A0_QP = 1 << 6,
210 MLX4_RESERVE_ETH_BF_QP = 1 << 7, 212 MLX4_RESERVE_ETH_BF_QP = 1 << 7,
211}; 213};
212 214
@@ -349,6 +351,8 @@ enum {
349 351
350enum mlx4_qp_region { 352enum mlx4_qp_region {
351 MLX4_QP_REGION_FW = 0, 353 MLX4_QP_REGION_FW = 0,
354 MLX4_QP_REGION_RSS_RAW_ETH,
355 MLX4_QP_REGION_BOTTOM = MLX4_QP_REGION_RSS_RAW_ETH,
352 MLX4_QP_REGION_ETH_ADDR, 356 MLX4_QP_REGION_ETH_ADDR,
353 MLX4_QP_REGION_FC_ADDR, 357 MLX4_QP_REGION_FC_ADDR,
354 MLX4_QP_REGION_FC_EXCH, 358 MLX4_QP_REGION_FC_EXCH,
@@ -891,7 +895,9 @@ static inline int mlx4_num_reserved_sqps(struct mlx4_dev *dev)
891static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) 895static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn)
892{ 896{
893 return (qpn < dev->phys_caps.base_sqpn + 8 + 897 return (qpn < dev->phys_caps.base_sqpn + 8 +
894 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev)); 898 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev) &&
899 qpn >= dev->phys_caps.base_sqpn) ||
900 (qpn < dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]);
895} 901}
896 902
897static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn) 903static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn)