diff options
author | David S. Miller <davem@davemloft.net> | 2014-03-28 16:30:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-28 16:30:05 -0400 |
commit | 5256d7e46a3e6d52212fe3cad2a30ca6965e85f7 (patch) | |
tree | 321fa0738eb04cffe07abb89b7f06759f062f64c | |
parent | dae98cadf743daa480c357b7ba4410423c5f905f (diff) | |
parent | 1b136de120dda625109f2afe1e3d04e256be9ec1 (diff) |
Merge branch 'mlx4_vxlan'
Or Gerlitz says:
====================
Implement vxlan ndo calls
This short series adds support for the vxlan ndo calls, the udp
port is programmed to the firmware using a new command we introduce
here which is called "config device".
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/cmd.c | 26 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 86 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 40 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/mlx4.h | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/port.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 10 | ||||
-rw-r--r-- | include/linux/mlx4/cmd.h | 1 | ||||
-rw-r--r-- | include/linux/mlx4/device.h | 4 |
9 files changed, 147 insertions, 33 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 516c1dd4963b..78099eab7673 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c | |||
@@ -800,16 +800,7 @@ static int mlx4_MAD_IFC_wrapper(struct mlx4_dev *dev, int slave, | |||
800 | vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); | 800 | vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); |
801 | } | 801 | } |
802 | 802 | ||
803 | static int MLX4_CMD_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, | 803 | static int mlx4_CMD_EPERM_wrapper(struct mlx4_dev *dev, int slave, |
804 | struct mlx4_vhcr *vhcr, | ||
805 | struct mlx4_cmd_mailbox *inbox, | ||
806 | struct mlx4_cmd_mailbox *outbox, | ||
807 | struct mlx4_cmd_info *cmd) | ||
808 | { | ||
809 | return -EPERM; | ||
810 | } | ||
811 | |||
812 | static int MLX4_CMD_GET_OP_REQ_wrapper(struct mlx4_dev *dev, int slave, | ||
813 | struct mlx4_vhcr *vhcr, | 804 | struct mlx4_vhcr *vhcr, |
814 | struct mlx4_cmd_mailbox *inbox, | 805 | struct mlx4_cmd_mailbox *inbox, |
815 | struct mlx4_cmd_mailbox *outbox, | 806 | struct mlx4_cmd_mailbox *outbox, |
@@ -964,6 +955,15 @@ static struct mlx4_cmd_info cmd_info[] = { | |||
964 | .wrapper = NULL | 955 | .wrapper = NULL |
965 | }, | 956 | }, |
966 | { | 957 | { |
958 | .opcode = MLX4_CMD_CONFIG_DEV, | ||
959 | .has_inbox = false, | ||
960 | .has_outbox = false, | ||
961 | .out_is_imm = false, | ||
962 | .encode_slave_id = false, | ||
963 | .verify = NULL, | ||
964 | .wrapper = mlx4_CMD_EPERM_wrapper | ||
965 | }, | ||
966 | { | ||
967 | .opcode = MLX4_CMD_ALLOC_RES, | 967 | .opcode = MLX4_CMD_ALLOC_RES, |
968 | .has_inbox = false, | 968 | .has_inbox = false, |
969 | .has_outbox = false, | 969 | .has_outbox = false, |
@@ -1258,7 +1258,7 @@ static struct mlx4_cmd_info cmd_info[] = { | |||
1258 | .out_is_imm = false, | 1258 | .out_is_imm = false, |
1259 | .encode_slave_id = false, | 1259 | .encode_slave_id = false, |
1260 | .verify = NULL, | 1260 | .verify = NULL, |
1261 | .wrapper = MLX4_CMD_UPDATE_QP_wrapper | 1261 | .wrapper = mlx4_CMD_EPERM_wrapper |
1262 | }, | 1262 | }, |
1263 | { | 1263 | { |
1264 | .opcode = MLX4_CMD_GET_OP_REQ, | 1264 | .opcode = MLX4_CMD_GET_OP_REQ, |
@@ -1267,7 +1267,7 @@ static struct mlx4_cmd_info cmd_info[] = { | |||
1267 | .out_is_imm = false, | 1267 | .out_is_imm = false, |
1268 | .encode_slave_id = false, | 1268 | .encode_slave_id = false, |
1269 | .verify = NULL, | 1269 | .verify = NULL, |
1270 | .wrapper = MLX4_CMD_GET_OP_REQ_wrapper, | 1270 | .wrapper = mlx4_CMD_EPERM_wrapper, |
1271 | }, | 1271 | }, |
1272 | { | 1272 | { |
1273 | .opcode = MLX4_CMD_CONF_SPECIAL_QP, | 1273 | .opcode = MLX4_CMD_CONF_SPECIAL_QP, |
@@ -1378,7 +1378,7 @@ static struct mlx4_cmd_info cmd_info[] = { | |||
1378 | .out_is_imm = false, | 1378 | .out_is_imm = false, |
1379 | .encode_slave_id = false, | 1379 | .encode_slave_id = false, |
1380 | .verify = NULL, | 1380 | .verify = NULL, |
1381 | .wrapper = mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper | 1381 | .wrapper = mlx4_CMD_EPERM_wrapper |
1382 | }, | 1382 | }, |
1383 | }; | 1383 | }; |
1384 | 1384 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index fa5ee719e04b..82d7eb5b79cc 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/hash.h> | 39 | #include <linux/hash.h> |
40 | #include <net/ip.h> | 40 | #include <net/ip.h> |
41 | #include <net/busy_poll.h> | 41 | #include <net/busy_poll.h> |
42 | #include <net/vxlan.h> | ||
42 | 43 | ||
43 | #include <linux/mlx4/driver.h> | 44 | #include <linux/mlx4/driver.h> |
44 | #include <linux/mlx4/device.h> | 45 | #include <linux/mlx4/device.h> |
@@ -1665,7 +1666,7 @@ int mlx4_en_start_port(struct net_device *dev) | |||
1665 | } | 1666 | } |
1666 | 1667 | ||
1667 | if (mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { | 1668 | if (mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { |
1668 | err = mlx4_SET_PORT_VXLAN(mdev->dev, priv->port, VXLAN_STEER_BY_OUTER_MAC); | 1669 | err = mlx4_SET_PORT_VXLAN(mdev->dev, priv->port, VXLAN_STEER_BY_OUTER_MAC, 1); |
1669 | if (err) { | 1670 | if (err) { |
1670 | en_err(priv, "Failed setting port L2 tunnel configuration, err %d\n", | 1671 | en_err(priv, "Failed setting port L2 tunnel configuration, err %d\n", |
1671 | err); | 1672 | err); |
@@ -1697,6 +1698,8 @@ int mlx4_en_start_port(struct net_device *dev) | |||
1697 | 1698 | ||
1698 | mlx4_set_stats_bitmap(mdev->dev, &priv->stats_bitmap); | 1699 | mlx4_set_stats_bitmap(mdev->dev, &priv->stats_bitmap); |
1699 | 1700 | ||
1701 | if (priv->mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS) | ||
1702 | vxlan_get_rx_port(dev); | ||
1700 | priv->port_up = true; | 1703 | priv->port_up = true; |
1701 | netif_tx_start_all_queues(dev); | 1704 | netif_tx_start_all_queues(dev); |
1702 | netif_device_attach(dev); | 1705 | netif_device_attach(dev); |
@@ -2264,6 +2267,81 @@ static int mlx4_en_get_phys_port_id(struct net_device *dev, | |||
2264 | return 0; | 2267 | return 0; |
2265 | } | 2268 | } |
2266 | 2269 | ||
2270 | static void mlx4_en_add_vxlan_offloads(struct work_struct *work) | ||
2271 | { | ||
2272 | int ret; | ||
2273 | struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, | ||
2274 | vxlan_add_task); | ||
2275 | |||
2276 | ret = mlx4_config_vxlan_port(priv->mdev->dev, priv->vxlan_port); | ||
2277 | if (ret) | ||
2278 | goto out; | ||
2279 | |||
2280 | ret = mlx4_SET_PORT_VXLAN(priv->mdev->dev, priv->port, | ||
2281 | VXLAN_STEER_BY_OUTER_MAC, 1); | ||
2282 | out: | ||
2283 | if (ret) | ||
2284 | en_err(priv, "failed setting L2 tunnel configuration ret %d\n", ret); | ||
2285 | } | ||
2286 | |||
2287 | static void mlx4_en_del_vxlan_offloads(struct work_struct *work) | ||
2288 | { | ||
2289 | int ret; | ||
2290 | struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, | ||
2291 | vxlan_del_task); | ||
2292 | |||
2293 | ret = mlx4_SET_PORT_VXLAN(priv->mdev->dev, priv->port, | ||
2294 | VXLAN_STEER_BY_OUTER_MAC, 0); | ||
2295 | if (ret) | ||
2296 | en_err(priv, "failed setting L2 tunnel configuration ret %d\n", ret); | ||
2297 | |||
2298 | priv->vxlan_port = 0; | ||
2299 | } | ||
2300 | |||
2301 | static void mlx4_en_add_vxlan_port(struct net_device *dev, | ||
2302 | sa_family_t sa_family, __be16 port) | ||
2303 | { | ||
2304 | struct mlx4_en_priv *priv = netdev_priv(dev); | ||
2305 | __be16 current_port; | ||
2306 | |||
2307 | if (!(priv->mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS)) | ||
2308 | return; | ||
2309 | |||
2310 | if (sa_family == AF_INET6) | ||
2311 | return; | ||
2312 | |||
2313 | current_port = priv->vxlan_port; | ||
2314 | if (current_port && current_port != port) { | ||
2315 | en_warn(priv, "vxlan port %d configured, can't add port %d\n", | ||
2316 | ntohs(current_port), ntohs(port)); | ||
2317 | return; | ||
2318 | } | ||
2319 | |||
2320 | priv->vxlan_port = port; | ||
2321 | queue_work(priv->mdev->workqueue, &priv->vxlan_add_task); | ||
2322 | } | ||
2323 | |||
2324 | static void mlx4_en_del_vxlan_port(struct net_device *dev, | ||
2325 | sa_family_t sa_family, __be16 port) | ||
2326 | { | ||
2327 | struct mlx4_en_priv *priv = netdev_priv(dev); | ||
2328 | __be16 current_port; | ||
2329 | |||
2330 | if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) | ||
2331 | return; | ||
2332 | |||
2333 | if (sa_family == AF_INET6) | ||
2334 | return; | ||
2335 | |||
2336 | current_port = priv->vxlan_port; | ||
2337 | if (current_port != port) { | ||
2338 | en_dbg(DRV, priv, "vxlan port %d isn't configured, ignoring\n", ntohs(port)); | ||
2339 | return; | ||
2340 | } | ||
2341 | |||
2342 | queue_work(priv->mdev->workqueue, &priv->vxlan_del_task); | ||
2343 | } | ||
2344 | |||
2267 | static const struct net_device_ops mlx4_netdev_ops = { | 2345 | static const struct net_device_ops mlx4_netdev_ops = { |
2268 | .ndo_open = mlx4_en_open, | 2346 | .ndo_open = mlx4_en_open, |
2269 | .ndo_stop = mlx4_en_close, | 2347 | .ndo_stop = mlx4_en_close, |
@@ -2290,6 +2368,8 @@ static const struct net_device_ops mlx4_netdev_ops = { | |||
2290 | .ndo_busy_poll = mlx4_en_low_latency_recv, | 2368 | .ndo_busy_poll = mlx4_en_low_latency_recv, |
2291 | #endif | 2369 | #endif |
2292 | .ndo_get_phys_port_id = mlx4_en_get_phys_port_id, | 2370 | .ndo_get_phys_port_id = mlx4_en_get_phys_port_id, |
2371 | .ndo_add_vxlan_port = mlx4_en_add_vxlan_port, | ||
2372 | .ndo_del_vxlan_port = mlx4_en_del_vxlan_port, | ||
2293 | }; | 2373 | }; |
2294 | 2374 | ||
2295 | static const struct net_device_ops mlx4_netdev_ops_master = { | 2375 | static const struct net_device_ops mlx4_netdev_ops_master = { |
@@ -2381,6 +2461,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
2381 | INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); | 2461 | INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); |
2382 | INIT_DELAYED_WORK(&priv->stats_task, mlx4_en_do_get_stats); | 2462 | INIT_DELAYED_WORK(&priv->stats_task, mlx4_en_do_get_stats); |
2383 | INIT_DELAYED_WORK(&priv->service_task, mlx4_en_service_task); | 2463 | INIT_DELAYED_WORK(&priv->service_task, mlx4_en_service_task); |
2464 | INIT_WORK(&priv->vxlan_add_task, mlx4_en_add_vxlan_offloads); | ||
2465 | INIT_WORK(&priv->vxlan_del_task, mlx4_en_del_vxlan_offloads); | ||
2384 | #ifdef CONFIG_MLX4_EN_DCB | 2466 | #ifdef CONFIG_MLX4_EN_DCB |
2385 | if (!mlx4_is_slave(priv->mdev->dev)) { | 2467 | if (!mlx4_is_slave(priv->mdev->dev)) { |
2386 | if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) { | 2468 | if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) { |
@@ -2514,7 +2596,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
2514 | } | 2596 | } |
2515 | 2597 | ||
2516 | if (mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { | 2598 | if (mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { |
2517 | err = mlx4_SET_PORT_VXLAN(mdev->dev, priv->port, VXLAN_STEER_BY_OUTER_MAC); | 2599 | err = mlx4_SET_PORT_VXLAN(mdev->dev, priv->port, VXLAN_STEER_BY_OUTER_MAC, 1); |
2518 | if (err) { | 2600 | if (err) { |
2519 | en_err(priv, "Failed setting port L2 tunnel configuration, err %d\n", | 2601 | en_err(priv, "Failed setting port L2 tunnel configuration, err %d\n", |
2520 | err); | 2602 | err); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 6bd33e2fc17c..d16a4d118903 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -1779,6 +1779,46 @@ int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic) | |||
1779 | MLX4_CMD_NATIVE); | 1779 | MLX4_CMD_NATIVE); |
1780 | } | 1780 | } |
1781 | 1781 | ||
1782 | struct mlx4_config_dev { | ||
1783 | __be32 update_flags; | ||
1784 | __be32 rsdv1[3]; | ||
1785 | __be16 vxlan_udp_dport; | ||
1786 | __be16 rsvd2; | ||
1787 | }; | ||
1788 | |||
1789 | #define MLX4_VXLAN_UDP_DPORT (1 << 0) | ||
1790 | |||
1791 | static int mlx4_CONFIG_DEV(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev) | ||
1792 | { | ||
1793 | int err; | ||
1794 | struct mlx4_cmd_mailbox *mailbox; | ||
1795 | |||
1796 | mailbox = mlx4_alloc_cmd_mailbox(dev); | ||
1797 | if (IS_ERR(mailbox)) | ||
1798 | return PTR_ERR(mailbox); | ||
1799 | |||
1800 | memcpy(mailbox->buf, config_dev, sizeof(*config_dev)); | ||
1801 | |||
1802 | err = mlx4_cmd(dev, mailbox->dma, 0, 0, MLX4_CMD_CONFIG_DEV, | ||
1803 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); | ||
1804 | |||
1805 | mlx4_free_cmd_mailbox(dev, mailbox); | ||
1806 | return err; | ||
1807 | } | ||
1808 | |||
1809 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port) | ||
1810 | { | ||
1811 | struct mlx4_config_dev config_dev; | ||
1812 | |||
1813 | memset(&config_dev, 0, sizeof(config_dev)); | ||
1814 | config_dev.update_flags = cpu_to_be32(MLX4_VXLAN_UDP_DPORT); | ||
1815 | config_dev.vxlan_udp_dport = udp_port; | ||
1816 | |||
1817 | return mlx4_CONFIG_DEV(dev, &config_dev); | ||
1818 | } | ||
1819 | EXPORT_SYMBOL_GPL(mlx4_config_vxlan_port); | ||
1820 | |||
1821 | |||
1782 | int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages) | 1822 | int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages) |
1783 | { | 1823 | { |
1784 | int ret = mlx4_cmd_imm(dev, icm_size, aux_pages, 0, 0, | 1824 | int ret = mlx4_cmd_imm(dev, icm_size, aux_pages, 0, 0, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index 9fca6c150de3..cf8be41abb36 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h | |||
@@ -1247,11 +1247,6 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, | |||
1247 | struct mlx4_cmd_mailbox *inbox, | 1247 | struct mlx4_cmd_mailbox *inbox, |
1248 | struct mlx4_cmd_mailbox *outbox, | 1248 | struct mlx4_cmd_mailbox *outbox, |
1249 | struct mlx4_cmd_info *cmd); | 1249 | struct mlx4_cmd_info *cmd); |
1250 | int mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper(struct mlx4_dev *dev, int slave, | ||
1251 | struct mlx4_vhcr *vhcr, | ||
1252 | struct mlx4_cmd_mailbox *inbox, | ||
1253 | struct mlx4_cmd_mailbox *outbox, | ||
1254 | struct mlx4_cmd_info *cmd); | ||
1255 | 1250 | ||
1256 | int mlx4_get_mgm_entry_size(struct mlx4_dev *dev); | 1251 | int mlx4_get_mgm_entry_size(struct mlx4_dev *dev); |
1257 | int mlx4_get_qp_per_mgm(struct mlx4_dev *dev); | 1252 | int mlx4_get_qp_per_mgm(struct mlx4_dev *dev); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 69e1f36858e0..36fc2a2b24c3 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -559,6 +559,8 @@ struct mlx4_en_priv { | |||
559 | struct work_struct linkstate_task; | 559 | struct work_struct linkstate_task; |
560 | struct delayed_work stats_task; | 560 | struct delayed_work stats_task; |
561 | struct delayed_work service_task; | 561 | struct delayed_work service_task; |
562 | struct work_struct vxlan_add_task; | ||
563 | struct work_struct vxlan_del_task; | ||
562 | struct mlx4_en_perf_stats pstats; | 564 | struct mlx4_en_perf_stats pstats; |
563 | struct mlx4_en_pkt_stats pkstats; | 565 | struct mlx4_en_pkt_stats pkstats; |
564 | struct mlx4_en_port_stats port_stats; | 566 | struct mlx4_en_port_stats port_stats; |
@@ -585,6 +587,7 @@ struct mlx4_en_priv { | |||
585 | struct hlist_head filter_hash[1 << MLX4_EN_FILTER_HASH_SHIFT]; | 587 | struct hlist_head filter_hash[1 << MLX4_EN_FILTER_HASH_SHIFT]; |
586 | #endif | 588 | #endif |
587 | u64 tunnel_reg_id; | 589 | u64 tunnel_reg_id; |
590 | __be16 vxlan_port; | ||
588 | }; | 591 | }; |
589 | 592 | ||
590 | enum mlx4_en_wol { | 593 | enum mlx4_en_wol { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index 2705b9ab9463..cfcad26ed40f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c | |||
@@ -988,7 +988,7 @@ struct mlx4_set_port_vxlan_context { | |||
988 | u8 steering; | 988 | u8 steering; |
989 | }; | 989 | }; |
990 | 990 | ||
991 | int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering) | 991 | int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering, int enable) |
992 | { | 992 | { |
993 | int err; | 993 | int err; |
994 | u32 in_mod; | 994 | u32 in_mod; |
@@ -1002,7 +1002,8 @@ int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering) | |||
1002 | memset(context, 0, sizeof(*context)); | 1002 | memset(context, 0, sizeof(*context)); |
1003 | 1003 | ||
1004 | context->modify_flags = VXLAN_ENABLE_MODIFY | VXLAN_STEERING_MODIFY; | 1004 | context->modify_flags = VXLAN_ENABLE_MODIFY | VXLAN_STEERING_MODIFY; |
1005 | context->enable_flags = VXLAN_ENABLE; | 1005 | if (enable) |
1006 | context->enable_flags = VXLAN_ENABLE; | ||
1006 | context->steering = steering; | 1007 | context->steering = steering; |
1007 | 1008 | ||
1008 | in_mod = MLX4_SET_PORT_VXLAN << 8 | port; | 1009 | in_mod = MLX4_SET_PORT_VXLAN << 8 | port; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index 2a33513a0e31..3b5f53ef29b2 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
@@ -4015,16 +4015,6 @@ int mlx4_QUERY_IF_STAT_wrapper(struct mlx4_dev *dev, int slave, | |||
4015 | return err; | 4015 | return err; |
4016 | } | 4016 | } |
4017 | 4017 | ||
4018 | int mlx4_FLOW_STEERING_IB_UC_QP_RANGE_wrapper(struct mlx4_dev *dev, int slave, | ||
4019 | struct mlx4_vhcr *vhcr, | ||
4020 | struct mlx4_cmd_mailbox *inbox, | ||
4021 | struct mlx4_cmd_mailbox *outbox, | ||
4022 | struct mlx4_cmd_info *cmd) | ||
4023 | { | ||
4024 | return -EPERM; | ||
4025 | } | ||
4026 | |||
4027 | |||
4028 | static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp) | 4018 | static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp) |
4029 | { | 4019 | { |
4030 | struct res_gid *rgid; | 4020 | struct res_gid *rgid; |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 009985628257..c8450366c130 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
@@ -125,6 +125,7 @@ enum { | |||
125 | /* miscellaneous commands */ | 125 | /* miscellaneous commands */ |
126 | MLX4_CMD_DIAG_RPRT = 0x30, | 126 | MLX4_CMD_DIAG_RPRT = 0x30, |
127 | MLX4_CMD_NOP = 0x31, | 127 | MLX4_CMD_NOP = 0x31, |
128 | MLX4_CMD_CONFIG_DEV = 0x3a, | ||
128 | MLX4_CMD_ACCESS_MEM = 0x2e, | 129 | MLX4_CMD_ACCESS_MEM = 0x2e, |
129 | MLX4_CMD_SET_VEP = 0x52, | 130 | MLX4_CMD_SET_VEP = 0x52, |
130 | 131 | ||
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 6b3998396b99..ba87bd21295a 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -1142,7 +1142,7 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, | |||
1142 | int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); | 1142 | int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); |
1143 | int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, | 1143 | int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, |
1144 | u8 *pg, u16 *ratelimit); | 1144 | u8 *pg, u16 *ratelimit); |
1145 | int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering); | 1145 | int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering, int enable); |
1146 | int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); | 1146 | int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); |
1147 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); | 1147 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); |
1148 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); | 1148 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); |
@@ -1232,4 +1232,6 @@ struct mlx4_slaves_pport mlx4_phys_to_slaves_pport_actv( | |||
1232 | int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port); | 1232 | int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port); |
1233 | 1233 | ||
1234 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); | 1234 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); |
1235 | |||
1236 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); | ||
1235 | #endif /* MLX4_DEVICE_H */ | 1237 | #endif /* MLX4_DEVICE_H */ |