1 From 0866d640e42d6c54b2b3f15ebde9930e756ba4d5 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= <nelio.laranjeiro@6wind.com>
3 Date: Wed, 22 Feb 2017 10:57:52 +0100
4 Subject: [PATCH] net/mlx5: fix startup when flow cannot be applied
6 When flows cannot be re-applied due to configuration modifications, the
7 start function should rollback the configuration done.
9 Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")
12 Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
14 drivers/net/mlx5/mlx5_trigger.c | 21 ++++++++++++++++-----
15 1 file changed, 16 insertions(+), 5 deletions(-)
17 diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
18 index 30addd2..0acbf28 100644
19 --- a/drivers/net/mlx5/mlx5_trigger.c
20 +++ b/drivers/net/mlx5/mlx5_trigger.c
21 @@ -82,17 +82,28 @@ mlx5_dev_start(struct rte_eth_dev *dev)
22 ERROR("%p: an error occurred while configuring hash RX queues:"
24 (void *)priv, strerror(err));
26 - priv_special_flow_disable_all(priv);
27 - priv_mac_addrs_disable(priv);
28 - priv_destroy_hash_rxqs(priv);
31 if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_NONE)
32 priv_fdir_enable(priv);
33 - priv_dev_interrupt_handler_install(priv, dev);
34 err = priv_flow_start(priv);
37 + ERROR("%p: an error occurred while configuring flows:"
39 + (void *)priv, strerror(err));
42 + priv_dev_interrupt_handler_install(priv, dev);
43 priv_xstats_init(priv);
48 + priv_special_flow_disable_all(priv);
49 + priv_mac_addrs_disable(priv);
50 + priv_destroy_hash_rxqs(priv);
51 + priv_flow_stop(priv);