From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id B179D1BFA1 for ; Wed, 27 Jun 2018 17:07:39 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id w137-v6so6257526wmw.1 for ; Wed, 27 Jun 2018 08:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=QVugnlaUz5gNmRQ7wgMsd5fqAl07L5rQwDZ3gREIjCE=; b=Ej2shz/pplololityJYj1xLa1d8e5mVLdx2R1mKLbFYT59/G79Yx//XYlLjqYyLboC WwR/G2uqWGlR/HpO4Y1FOkitS/f3PAbTB4bcB69sqHnfJlO418WAwHc8mGINwb3qTRdR Jj0aGxHh3lTZPSUFQY2eA8Z+vkShLRo7o1xhplfYs5RQ89QFZR1x6w3lGbq7sbYw8cb9 Dmtf7HvIl+XqgAvovwzCaMRrMN3NuOZ2xOyc/66CIuoG34UqBiP6QQTs7sLSedeYZ+td lPAQXvHPSqXBrGj64MKktoVWBk/gMFOzkN4goS+pcsNOVMwImc9DmYTWUBuKDFOf4OPg rz7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=QVugnlaUz5gNmRQ7wgMsd5fqAl07L5rQwDZ3gREIjCE=; b=NMBTfuKKu9h0QEteiLkj15oAje89BUVjwfoU9y0BgV+DN9xv2NwKHgQ4LYF2pJFhuh 6iIfigd8Sax2TtnJns0EB5M5bsbVtlx+HoG9D+v9+zb97/eeKaIJebSs4b8GOETPgHFR qpLP7/hpFLy0mKdPmIzUky/FJuDQYgIMHUvOYrEWlIffE8PakrcfZawRAOj3J3/Drm2V 9QuQLrHw8iwF57a/5bqJkvUqT/K9pYKRbCQI4kLZpDkJJiVSSaJp2yZtdYS8KmEm+HR0 NSSL18urlQu4VYDzemDWblktNMHK1grazQjSu50Xj/M7h7r1D5/KMazLIpSwesK81euF vMcQ== X-Gm-Message-State: APt69E0HugLM/uS2g4yC8K4MFkO09PJBDAl0jS7elJSHs23koMmfQnNb uKdomUmfFAz/b4PLU557qyBQhLdK3A== X-Google-Smtp-Source: AAOMgpfkovwNvvKvgZLXl+u1bl2OBdr9uEEWzoepkVD1aqtaDSN3xDifSQ2S4oehnTBWuIt4nbCbnQ== X-Received: by 2002:a1c:ad09:: with SMTP id w9-v6mr5670507wme.95.1530112059261; Wed, 27 Jun 2018 08:07:39 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k17-v6sm4872513wrp.19.2018.06.27.08.07.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:07:38 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org, Adrien Mazarguil , Yongseok Koh Date: Wed, 27 Jun 2018 17:07:38 +0200 Message-Id: <71da0cfabd6f56f7a5456cba33c67cbe2fbc46f4.1530111623.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 06/20] net/mlx5: add flow stop/start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 15:07:40 -0000 Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 7ac1ba24c..6593eafa0 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -912,9 +912,12 @@ mlx5_flow_list_flush(struct rte_eth_dev *dev, struct mlx5_flows *list) * Pointer to a TAILQ flow list. */ void -mlx5_flow_stop(struct rte_eth_dev *dev __rte_unused, - struct mlx5_flows *list __rte_unused) +mlx5_flow_stop(struct rte_eth_dev *dev, struct mlx5_flows *list) { + struct rte_flow *flow; + + TAILQ_FOREACH_REVERSE(flow, list, mlx5_flows, next) + mlx5_flow_fate_remove(dev, flow); } /** @@ -929,10 +932,23 @@ mlx5_flow_stop(struct rte_eth_dev *dev __rte_unused, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_flow_start(struct rte_eth_dev *dev __rte_unused, - struct mlx5_flows *list __rte_unused) +mlx5_flow_start(struct rte_eth_dev *dev, struct mlx5_flows *list) { + struct rte_flow *flow; + struct rte_flow_error error; + int ret = 0; + + TAILQ_FOREACH(flow, list, next) { + ret = mlx5_flow_fate_apply(dev, flow, &error); + if (ret < 0) + goto error; + } return 0; +error: + ret = rte_errno; /* Save rte_errno before cleanup. */ + mlx5_flow_stop(dev, list); + rte_errno = ret; /* Restore rte_errno. */ + return -rte_errno; } /** -- 2.18.0