From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 55FBE2C56 for ; Mon, 28 May 2018 13:21:43 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id v13-v6so8001312wrp.13 for ; Mon, 28 May 2018 04:21:43 -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:in-reply-to :references; bh=2YidjCW5vLe50Kxo9WluzXnHJHqnYZL5YrF8Xz7STrk=; b=SwMK9fBq5gFh+CfG0JB9viQ5Tt15PxC4Vv6tA9IIkBRjb9S1VcsDYsQfS93A4Tjlnk jeuGB03kfCUqBq6NiclpBgXR0fzMEPIyNtg1bk9wARPWC+SlzD9B+hACqjjUlDaDT8cF DBRP0hFYvgkfETQovu9mf+odChWlC24ye3wRiUCCthf+4fHERZt3ggyt6o16zPBSpQdH EVpbSm+yjA0xXqLYIc3w3DycMXyoSxz/eyo2B8aAbkTvSG5rguV3FXQoOWgqWVDlkfOe pu8pTHh8+oEyqBpFyi4fth43lzxejcvE5tegoBogTdpLXPdnLith5y9p1VgX5JpyQDQr s5UQ== 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:in-reply-to:references; bh=2YidjCW5vLe50Kxo9WluzXnHJHqnYZL5YrF8Xz7STrk=; b=dk8fRioWkgVpRP3uZqo2MbC6HUAAlEnKLVAJyaOOTiz15NG7h7cMzbON58DuKW/K3o 74c+J+OtACk7R3YKwogdHSOVsROLseCQdegE8SEtGZGZwxaI3dHXNzlITkO7vGdyD7FA DiO4JD9xfMLCiI4WcAykqjiwm8ppjgkbo5eG58Fl6bovSzf2CGJVnxOLaeKe9hhwXPrk kDmgs30p+bbEjGAhxVFCW8umsyTpqiGu7oLaiizGo1ORFJOKdsSg/NQ6Y45oOyyay2hA rWz5nsiCBK6sMzcaCHfQkrQCsKl4oegI+zjGGxmmf3/TwwAngdW1lOxtSoW4fi/kMDWq GPCA== X-Gm-Message-State: ALKqPwe139kCG5fO+3jhn3lkq11XRvBSYcDwhZAkRAWbLDcZMgBtpPaH vwDyBiu5dAis8AatUtHKhN7XPjmOdQ== X-Google-Smtp-Source: AB8JxZpDu8r6PzdgN/iO3ZtyPuDTwuE+P4YSh30PNMdbypwYabgzcoxLtAXsEwxLAwffIvhczJyTbg== X-Received: by 2002:adf:9125:: with SMTP id j34-v6mr11035720wrj.156.1527506502922; Mon, 28 May 2018 04:21:42 -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 q81-v6sm20755444wmd.14.2018.05.28.04.21.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 04:21:42 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org, Adrien Mazarguil , Yongseok Koh Date: Mon, 28 May 2018 13:21:38 +0200 Message-Id: <889173d9b69e4bad69402f6b135d6a8eeab6e9ee.1527506071.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [DPDK 18.08 v1 05/12] 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: Mon, 28 May 2018 11:21:43 -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 3e16f67d6..8c6309188 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -857,9 +857,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); } /** @@ -874,10 +877,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.17.0