diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/mlx4/en_ethtool.c | 9 | ||||
-rw-r--r-- | drivers/net/mlx4/en_main.c | 3 | ||||
-rw-r--r-- | drivers/net/mlx4/en_netdev.c | 5 | ||||
-rw-r--r-- | drivers/net/mlx4/en_port.c | 6 | ||||
-rw-r--r-- | drivers/net/mlx4/en_selftest.c | 3 | ||||
-rw-r--r-- | drivers/net/mlx4/fw.c | 24 | ||||
-rw-r--r-- | drivers/net/mlx4/fw.h | 5 | ||||
-rw-r--r-- | drivers/net/mlx4/main.c | 5 | ||||
-rw-r--r-- | drivers/net/mlx4/mcg.c | 17 | ||||
-rw-r--r-- | drivers/net/mlx4/port.c | 8 |
10 files changed, 41 insertions, 44 deletions
diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c index 2e858e4dcf4d..eb096253d781 100644 --- a/drivers/net/mlx4/en_ethtool.c +++ b/drivers/net/mlx4/en_ethtool.c | |||
@@ -104,7 +104,7 @@ static void mlx4_en_get_wol(struct net_device *netdev, | |||
104 | int err = 0; | 104 | int err = 0; |
105 | u64 config = 0; | 105 | u64 config = 0; |
106 | 106 | ||
107 | if (!priv->mdev->dev->caps.wol) { | 107 | if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL)) { |
108 | wol->supported = 0; | 108 | wol->supported = 0; |
109 | wol->wolopts = 0; | 109 | wol->wolopts = 0; |
110 | return; | 110 | return; |
@@ -134,7 +134,7 @@ static int mlx4_en_set_wol(struct net_device *netdev, | |||
134 | u64 config = 0; | 134 | u64 config = 0; |
135 | int err = 0; | 135 | int err = 0; |
136 | 136 | ||
137 | if (!priv->mdev->dev->caps.wol) | 137 | if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL)) |
138 | return -EOPNOTSUPP; | 138 | return -EOPNOTSUPP; |
139 | 139 | ||
140 | if (wol->supported & ~WAKE_MAGIC) | 140 | if (wol->supported & ~WAKE_MAGIC) |
@@ -170,7 +170,8 @@ static int mlx4_en_get_sset_count(struct net_device *dev, int sset) | |||
170 | return NUM_ALL_STATS + | 170 | return NUM_ALL_STATS + |
171 | (priv->tx_ring_num + priv->rx_ring_num) * 2; | 171 | (priv->tx_ring_num + priv->rx_ring_num) * 2; |
172 | case ETH_SS_TEST: | 172 | case ETH_SS_TEST: |
173 | return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.loopback_support) * 2; | 173 | return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags |
174 | & MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2; | ||
174 | default: | 175 | default: |
175 | return -EOPNOTSUPP; | 176 | return -EOPNOTSUPP; |
176 | } | 177 | } |
@@ -220,7 +221,7 @@ static void mlx4_en_get_strings(struct net_device *dev, | |||
220 | case ETH_SS_TEST: | 221 | case ETH_SS_TEST: |
221 | for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++) | 222 | for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++) |
222 | strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]); | 223 | strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]); |
223 | if (priv->mdev->dev->caps.loopback_support) | 224 | if (priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UC_LOOPBACK) |
224 | for (; i < MLX4_EN_NUM_SELF_TEST; i++) | 225 | for (; i < MLX4_EN_NUM_SELF_TEST; i++) |
225 | strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]); | 226 | strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]); |
226 | break; | 227 | break; |
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c index 9276b1b25586..6bfea233a9f2 100644 --- a/drivers/net/mlx4/en_main.c +++ b/drivers/net/mlx4/en_main.c | |||
@@ -106,7 +106,8 @@ static int mlx4_en_get_profile(struct mlx4_en_dev *mdev) | |||
106 | 106 | ||
107 | params->tcp_rss = tcp_rss; | 107 | params->tcp_rss = tcp_rss; |
108 | params->udp_rss = udp_rss; | 108 | params->udp_rss = udp_rss; |
109 | if (params->udp_rss && !mdev->dev->caps.udp_rss) { | 109 | if (params->udp_rss && !(mdev->dev->caps.flags |
110 | & MLX4_DEV_CAP_FLAG_UDP_RSS)) { | ||
110 | mlx4_warn(mdev, "UDP RSS is not supported on this device.\n"); | 111 | mlx4_warn(mdev, "UDP RSS is not supported on this device.\n"); |
111 | params->udp_rss = 0; | 112 | params->udp_rss = 0; |
112 | } | 113 | } |
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 61850adae6f7..aa6e73e7b6bb 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
@@ -239,7 +239,8 @@ static void mlx4_en_do_set_multicast(struct work_struct *work) | |||
239 | priv->flags |= MLX4_EN_FLAG_PROMISC; | 239 | priv->flags |= MLX4_EN_FLAG_PROMISC; |
240 | 240 | ||
241 | /* Enable promiscouos mode */ | 241 | /* Enable promiscouos mode */ |
242 | if (!mdev->dev->caps.vep_uc_steering) | 242 | if (!(mdev->dev->caps.flags & |
243 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER)) | ||
243 | err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port, | 244 | err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port, |
244 | priv->base_qpn, 1); | 245 | priv->base_qpn, 1); |
245 | else | 246 | else |
@@ -285,7 +286,7 @@ static void mlx4_en_do_set_multicast(struct work_struct *work) | |||
285 | priv->flags &= ~MLX4_EN_FLAG_PROMISC; | 286 | priv->flags &= ~MLX4_EN_FLAG_PROMISC; |
286 | 287 | ||
287 | /* Disable promiscouos mode */ | 288 | /* Disable promiscouos mode */ |
288 | if (!mdev->dev->caps.vep_uc_steering) | 289 | if (!(mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)) |
289 | err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port, | 290 | err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port, |
290 | priv->base_qpn, 0); | 291 | priv->base_qpn, 0); |
291 | else | 292 | else |
diff --git a/drivers/net/mlx4/en_port.c b/drivers/net/mlx4/en_port.c index f2a4f5dd313d..be861fbc1a4d 100644 --- a/drivers/net/mlx4/en_port.c +++ b/drivers/net/mlx4/en_port.c | |||
@@ -119,9 +119,11 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, | |||
119 | struct mlx4_set_port_rqp_calc_context *context; | 119 | struct mlx4_set_port_rqp_calc_context *context; |
120 | int err; | 120 | int err; |
121 | u32 in_mod; | 121 | u32 in_mod; |
122 | u32 m_promisc = (dev->caps.vep_mc_steering) ? MCAST_DIRECT : MCAST_DEFAULT; | 122 | u32 m_promisc = (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) ? |
123 | MCAST_DIRECT : MCAST_DEFAULT; | ||
123 | 124 | ||
124 | if (dev->caps.vep_mc_steering && dev->caps.vep_uc_steering) | 125 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER && |
126 | dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) | ||
125 | return 0; | 127 | return 0; |
126 | 128 | ||
127 | mailbox = mlx4_alloc_cmd_mailbox(dev); | 129 | mailbox = mlx4_alloc_cmd_mailbox(dev); |
diff --git a/drivers/net/mlx4/en_selftest.c b/drivers/net/mlx4/en_selftest.c index 191a8dcd8a93..9fdbcecd499d 100644 --- a/drivers/net/mlx4/en_selftest.c +++ b/drivers/net/mlx4/en_selftest.c | |||
@@ -159,7 +159,8 @@ retry_tx: | |||
159 | goto retry_tx; | 159 | goto retry_tx; |
160 | } | 160 | } |
161 | 161 | ||
162 | if (priv->mdev->dev->caps.loopback_support){ | 162 | if (priv->mdev->dev->caps.flags & |
163 | MLX4_DEV_CAP_FLAG_UC_LOOPBACK) { | ||
163 | buf[3] = mlx4_en_test_registers(priv); | 164 | buf[3] = mlx4_en_test_registers(priv); |
164 | buf[4] = mlx4_en_test_loopback(priv); | 165 | buf[4] = mlx4_en_test_loopback(priv); |
165 | } | 166 | } |
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index 346d8b3d03df..1d3fc6d7689b 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c | |||
@@ -99,7 +99,12 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags) | |||
99 | [21] = "UD multicast support", | 99 | [21] = "UD multicast support", |
100 | [24] = "Demand paging support", | 100 | [24] = "Demand paging support", |
101 | [25] = "Router support", | 101 | [25] = "Router support", |
102 | [30] = "IBoE support" | 102 | [30] = "IBoE support", |
103 | [32] = "Unicast loopback support", | ||
104 | [38] = "Wake On LAN support", | ||
105 | [40] = "UDP RSS support", | ||
106 | [41] = "Unicast VEP steering support", | ||
107 | [42] = "Multicast VEP steering support" | ||
103 | }; | 108 | }; |
104 | int i; | 109 | int i; |
105 | 110 | ||
@@ -142,7 +147,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
142 | struct mlx4_cmd_mailbox *mailbox; | 147 | struct mlx4_cmd_mailbox *mailbox; |
143 | u32 *outbox; | 148 | u32 *outbox; |
144 | u8 field; | 149 | u8 field; |
145 | u32 field32, flags; | 150 | u32 field32, flags, ext_flags; |
146 | u16 size; | 151 | u16 size; |
147 | u16 stat_rate; | 152 | u16 stat_rate; |
148 | int err; | 153 | int err; |
@@ -180,8 +185,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
180 | #define QUERY_DEV_CAP_MAX_GID_OFFSET 0x3b | 185 | #define QUERY_DEV_CAP_MAX_GID_OFFSET 0x3b |
181 | #define QUERY_DEV_CAP_RATE_SUPPORT_OFFSET 0x3c | 186 | #define QUERY_DEV_CAP_RATE_SUPPORT_OFFSET 0x3c |
182 | #define QUERY_DEV_CAP_MAX_PKEY_OFFSET 0x3f | 187 | #define QUERY_DEV_CAP_MAX_PKEY_OFFSET 0x3f |
183 | #define QUERY_DEV_CAP_UDP_RSS_OFFSET 0x42 | 188 | #define QUERY_DEV_CAP_EXT_FLAGS_OFFSET 0x40 |
184 | #define QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET 0x43 | ||
185 | #define QUERY_DEV_CAP_FLAGS_OFFSET 0x44 | 189 | #define QUERY_DEV_CAP_FLAGS_OFFSET 0x44 |
186 | #define QUERY_DEV_CAP_RSVD_UAR_OFFSET 0x48 | 190 | #define QUERY_DEV_CAP_RSVD_UAR_OFFSET 0x48 |
187 | #define QUERY_DEV_CAP_UAR_SZ_OFFSET 0x49 | 191 | #define QUERY_DEV_CAP_UAR_SZ_OFFSET 0x49 |
@@ -272,15 +276,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
272 | dev_cap->max_msg_sz = 1 << (field & 0x1f); | 276 | dev_cap->max_msg_sz = 1 << (field & 0x1f); |
273 | MLX4_GET(stat_rate, outbox, QUERY_DEV_CAP_RATE_SUPPORT_OFFSET); | 277 | MLX4_GET(stat_rate, outbox, QUERY_DEV_CAP_RATE_SUPPORT_OFFSET); |
274 | dev_cap->stat_rate_support = stat_rate; | 278 | dev_cap->stat_rate_support = stat_rate; |
275 | MLX4_GET(field, outbox, QUERY_DEV_CAP_UDP_RSS_OFFSET); | 279 | MLX4_GET(ext_flags, outbox, QUERY_DEV_CAP_EXT_FLAGS_OFFSET); |
276 | dev_cap->udp_rss = field & 0x1; | ||
277 | dev_cap->vep_uc_steering = field & 0x2; | ||
278 | dev_cap->vep_mc_steering = field & 0x4; | ||
279 | MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET); | ||
280 | dev_cap->loopback_support = field & 0x1; | ||
281 | dev_cap->wol = field & 0x40; | ||
282 | MLX4_GET(flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET); | 280 | MLX4_GET(flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET); |
283 | dev_cap->flags = flags; | 281 | dev_cap->flags = flags | (u64)ext_flags << 32; |
284 | MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET); | 282 | MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET); |
285 | dev_cap->reserved_uars = field >> 4; | 283 | dev_cap->reserved_uars = field >> 4; |
286 | MLX4_GET(field, outbox, QUERY_DEV_CAP_UAR_SZ_OFFSET); | 284 | MLX4_GET(field, outbox, QUERY_DEV_CAP_UAR_SZ_OFFSET); |
@@ -802,7 +800,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) | |||
802 | MLX4_PUT(inbox, param->mc_base, INIT_HCA_MC_BASE_OFFSET); | 800 | MLX4_PUT(inbox, param->mc_base, INIT_HCA_MC_BASE_OFFSET); |
803 | MLX4_PUT(inbox, param->log_mc_entry_sz, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET); | 801 | MLX4_PUT(inbox, param->log_mc_entry_sz, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET); |
804 | MLX4_PUT(inbox, param->log_mc_hash_sz, INIT_HCA_LOG_MC_HASH_SZ_OFFSET); | 802 | MLX4_PUT(inbox, param->log_mc_hash_sz, INIT_HCA_LOG_MC_HASH_SZ_OFFSET); |
805 | if (dev->caps.vep_mc_steering) | 803 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) |
806 | MLX4_PUT(inbox, (u8) (1 << 3), INIT_HCA_UC_STEERING_OFFSET); | 804 | MLX4_PUT(inbox, (u8) (1 << 3), INIT_HCA_UC_STEERING_OFFSET); |
807 | MLX4_PUT(inbox, param->log_mc_table_sz, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET); | 805 | MLX4_PUT(inbox, param->log_mc_table_sz, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET); |
808 | 806 | ||
diff --git a/drivers/net/mlx4/fw.h b/drivers/net/mlx4/fw.h index 2a8d11008c51..56ed1646cced 100644 --- a/drivers/net/mlx4/fw.h +++ b/drivers/net/mlx4/fw.h | |||
@@ -78,11 +78,6 @@ struct mlx4_dev_cap { | |||
78 | u16 wavelength[MLX4_MAX_PORTS + 1]; | 78 | u16 wavelength[MLX4_MAX_PORTS + 1]; |
79 | u64 trans_code[MLX4_MAX_PORTS + 1]; | 79 | u64 trans_code[MLX4_MAX_PORTS + 1]; |
80 | u16 stat_rate_support; | 80 | u16 stat_rate_support; |
81 | int udp_rss; | ||
82 | int loopback_support; | ||
83 | int vep_uc_steering; | ||
84 | int vep_mc_steering; | ||
85 | int wol; | ||
86 | u64 flags; | 81 | u64 flags; |
87 | int reserved_uars; | 82 | int reserved_uars; |
88 | int uar_size; | 83 | int uar_size; |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 3814fc9b1145..650f4ca8606e 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -226,11 +226,6 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
226 | dev->caps.bmme_flags = dev_cap->bmme_flags; | 226 | dev->caps.bmme_flags = dev_cap->bmme_flags; |
227 | dev->caps.reserved_lkey = dev_cap->reserved_lkey; | 227 | dev->caps.reserved_lkey = dev_cap->reserved_lkey; |
228 | dev->caps.stat_rate_support = dev_cap->stat_rate_support; | 228 | dev->caps.stat_rate_support = dev_cap->stat_rate_support; |
229 | dev->caps.udp_rss = dev_cap->udp_rss; | ||
230 | dev->caps.loopback_support = dev_cap->loopback_support; | ||
231 | dev->caps.vep_uc_steering = dev_cap->vep_uc_steering; | ||
232 | dev->caps.vep_mc_steering = dev_cap->vep_mc_steering; | ||
233 | dev->caps.wol = dev_cap->wol; | ||
234 | dev->caps.max_gso_sz = dev_cap->max_gso_sz; | 229 | dev->caps.max_gso_sz = dev_cap->max_gso_sz; |
235 | 230 | ||
236 | dev->caps.log_num_macs = log_num_mac; | 231 | dev->caps.log_num_macs = log_num_mac; |
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c index e63c37d6a115..cd1784593a3c 100644 --- a/drivers/net/mlx4/mcg.c +++ b/drivers/net/mlx4/mcg.c | |||
@@ -559,7 +559,8 @@ static int find_entry(struct mlx4_dev *dev, u8 port, | |||
559 | struct mlx4_mgm *mgm = mgm_mailbox->buf; | 559 | struct mlx4_mgm *mgm = mgm_mailbox->buf; |
560 | u8 *mgid; | 560 | u8 *mgid; |
561 | int err; | 561 | int err; |
562 | u8 op_mod = (prot == MLX4_PROT_ETH) ? !!(dev->caps.vep_mc_steering) : 0; | 562 | u8 op_mod = (prot == MLX4_PROT_ETH) ? |
563 | !!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) : 0; | ||
563 | 564 | ||
564 | mailbox = mlx4_alloc_cmd_mailbox(dev); | 565 | mailbox = mlx4_alloc_cmd_mailbox(dev); |
565 | if (IS_ERR(mailbox)) | 566 | if (IS_ERR(mailbox)) |
@@ -834,7 +835,8 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
834 | 835 | ||
835 | steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER; | 836 | steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER; |
836 | 837 | ||
837 | if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering) | 838 | if (prot == MLX4_PROT_ETH && |
839 | !(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) | ||
838 | return 0; | 840 | return 0; |
839 | 841 | ||
840 | if (prot == MLX4_PROT_ETH) | 842 | if (prot == MLX4_PROT_ETH) |
@@ -853,7 +855,8 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
853 | 855 | ||
854 | steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER; | 856 | steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER; |
855 | 857 | ||
856 | if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering) | 858 | if (prot == MLX4_PROT_ETH && |
859 | !(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) | ||
857 | return 0; | 860 | return 0; |
858 | 861 | ||
859 | if (prot == MLX4_PROT_ETH) { | 862 | if (prot == MLX4_PROT_ETH) { |
@@ -867,7 +870,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_detach); | |||
867 | 870 | ||
868 | int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port) | 871 | int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port) |
869 | { | 872 | { |
870 | if (!dev->caps.vep_mc_steering) | 873 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) |
871 | return 0; | 874 | return 0; |
872 | 875 | ||
873 | 876 | ||
@@ -877,7 +880,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc_add); | |||
877 | 880 | ||
878 | int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port) | 881 | int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port) |
879 | { | 882 | { |
880 | if (!dev->caps.vep_mc_steering) | 883 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) |
881 | return 0; | 884 | return 0; |
882 | 885 | ||
883 | 886 | ||
@@ -887,7 +890,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc_remove); | |||
887 | 890 | ||
888 | int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port) | 891 | int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port) |
889 | { | 892 | { |
890 | if (!dev->caps.vep_mc_steering) | 893 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) |
891 | return 0; | 894 | return 0; |
892 | 895 | ||
893 | 896 | ||
@@ -897,7 +900,7 @@ EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_add); | |||
897 | 900 | ||
898 | int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port) | 901 | int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port) |
899 | { | 902 | { |
900 | if (!dev->caps.vep_mc_steering) | 903 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) |
901 | return 0; | 904 | return 0; |
902 | 905 | ||
903 | return remove_promisc_qp(dev, 0, port, MLX4_UC_STEER, qpn); | 906 | return remove_promisc_qp(dev, 0, port, MLX4_UC_STEER, qpn); |
diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c index 8856659fb43c..1f95afda6841 100644 --- a/drivers/net/mlx4/port.c +++ b/drivers/net/mlx4/port.c | |||
@@ -146,7 +146,7 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn, u8 wrap) | |||
146 | int i, err = 0; | 146 | int i, err = 0; |
147 | int free = -1; | 147 | int free = -1; |
148 | 148 | ||
149 | if (dev->caps.vep_uc_steering) { | 149 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) { |
150 | err = mlx4_uc_steer_add(dev, port, mac, qpn, 1); | 150 | err = mlx4_uc_steer_add(dev, port, mac, qpn, 1); |
151 | if (!err) { | 151 | if (!err) { |
152 | entry = kmalloc(sizeof *entry, GFP_KERNEL); | 152 | entry = kmalloc(sizeof *entry, GFP_KERNEL); |
@@ -203,7 +203,7 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn, u8 wrap) | |||
203 | goto out; | 203 | goto out; |
204 | } | 204 | } |
205 | 205 | ||
206 | if (!dev->caps.vep_uc_steering) | 206 | if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)) |
207 | *qpn = info->base_qpn + free; | 207 | *qpn = info->base_qpn + free; |
208 | ++table->total; | 208 | ++table->total; |
209 | out: | 209 | out: |
@@ -243,7 +243,7 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int qpn) | |||
243 | int index = qpn - info->base_qpn; | 243 | int index = qpn - info->base_qpn; |
244 | struct mlx4_mac_entry *entry; | 244 | struct mlx4_mac_entry *entry; |
245 | 245 | ||
246 | if (dev->caps.vep_uc_steering) { | 246 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) { |
247 | entry = radix_tree_lookup(&info->mac_tree, qpn); | 247 | entry = radix_tree_lookup(&info->mac_tree, qpn); |
248 | if (entry) { | 248 | if (entry) { |
249 | mlx4_uc_steer_release(dev, port, entry->mac, qpn, 1); | 249 | mlx4_uc_steer_release(dev, port, entry->mac, qpn, 1); |
@@ -274,7 +274,7 @@ int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac, u8 wra | |||
274 | struct mlx4_mac_entry *entry; | 274 | struct mlx4_mac_entry *entry; |
275 | int err; | 275 | int err; |
276 | 276 | ||
277 | if (dev->caps.vep_uc_steering) { | 277 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) { |
278 | entry = radix_tree_lookup(&info->mac_tree, qpn); | 278 | entry = radix_tree_lookup(&info->mac_tree, qpn); |
279 | if (!entry) | 279 | if (!entry) |
280 | return -EINVAL; | 280 | return -EINVAL; |