net/mlx4: fix flow creation before start
authorMatan Azrad <matan@mellanox.com>
Thu, 27 Jul 2017 10:27:24 +0000 (13:27 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 31 Jul 2017 17:58:41 +0000 (19:58 +0200)
commitf3b10f1d2474dfa6774ec31e1a8dc14c76b3ac53
tree02888b7f18c1892a051a23eb1e391b7f988401d8
parentea16068c00647fb6c7fe8704d8ad2adff6bf378f
net/mlx4: fix flow creation before start

The corrupted code causes segmentation fault when user creates
flow with drop action before device starting.

For example, failsafe PMD recreates all the flows before calling
dev_start in plug-in sequence and mlx4 allocated its flow drop
queue in dev_start.
Hence, when failsafe created flow with drop action after plug-in
event, mlx4 tried to dereference flow drop queue which was
uninitialized.

The fix added check to the drop qp accessible and conditioned the
ibv_create_flow calling on device starting.

Fixes: 642fe56a1ba5 ("net/mlx4: use a single drop queue for all drop flows")
Fixes: 46d5736a7049 ("net/mlx4: support basic flow items and actions")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx4/mlx4_flow.c