From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id 658BF7D5B for ; Fri, 1 Sep 2017 10:08:25 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id k94so4567909wrc.0 for ; Fri, 01 Sep 2017 01:08:25 -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=JUMgWarKecwGAK3V6tvowIgwY3jiR10cc2WJH/16ivI=; b=GAgnGm6vLRLfZM9WRN/2uTGGzV+ithwSomQDvruvcnqlbvIopYbwSz1YWwpjSLpVln MjihD3BnHlA/o5kLg97V5XuhAQ0GrFYVI/JBKmG+Frk0jbpzg+d9I+4c+ZjNpun/jlel 3BLtQAQlNUcdpNPY/8p+5Wu826irw2aA1MZY7lkJAoM1Plwj2CQvhLZH5aT1TohwUF+n zW4mea5tEbDjyD6yKBJ7enYBzsxJuYilSisqyqsz7FpdfjZyxHYBCDvT/5WNgcGc7SaQ KDPDNFbEETEG/dnJchyhVU2F/8M+5SxmBvi1iNQJKlsyNKxLVD7mhdmYCzV5t92X8wIX C4kg== 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=JUMgWarKecwGAK3V6tvowIgwY3jiR10cc2WJH/16ivI=; b=S+/9nMwD1S2HeuTQHmbyaXnDBQW7dkEZ1KJu4BvU0BSRKsW2MWU6TP0XsA9BFMEWxV 8kstmwg9qVPZX2t2upTQpIW9/aW88iKhdTquf2QZbe3AsvLYNC8zHHTe/ZAo8HwoDwbM PsTx3YHO8X5qrHCuwI7AGtzKhxjsLpXoKYdxqWSnCqRDM/au629ucilbOthiSNMxQF93 gpNKlpFr4HgaR1aQcXfRawkWsSYN0o5T3UtpGAcDeHYWskRN8rbmfE39afk+8JeEfgbr k9RZLETnClX/tbFpFu7QigwsOwPb2z7cS1RYXxV+cifWKgDnZEk8GMdCELeMU0HDDrj+ WodQ== X-Gm-Message-State: AHPjjUgjI5+acTLvKA78KjKn7rYv7mG7J5ttPfSRYkMHGFzn9NO1Pq5F DUzq7xzi1oY35AGZJys= X-Google-Smtp-Source: ADKCNb7NELqBgNL41SR2ecv0pmSVUKD0INjeLpN1qQktIMgrMePTBTlfKkCewSNRojPnWWQFet+6sg== X-Received: by 10.223.161.207 with SMTP id v15mr625947wrv.316.1504253304848; Fri, 01 Sep 2017 01:08:24 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id y109sm1278536wrb.7.2017.09.01.01.08.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Sep 2017 01:08:23 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 1 Sep 2017 10:07:05 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 50/51] net/mlx4: remove isolated mode constraint 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: Fri, 01 Sep 2017 08:08:25 -0000 Considering the remaining functionality, the only difference between isolated and non-isolated mode is that a default MAC flow rule is present with the latter. The restriction on enabling isolated mode before creating any queues can therefore be lifted. Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4_flow.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index e2798f6..e177545 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -935,20 +935,10 @@ mlx4_flow_create(struct rte_eth_dev *dev, } /** - * @see rte_flow_isolate() - * - * Must be done before calling dev_configure(). + * Configure isolated mode. * - * @param dev - * Pointer to the ethernet device structure. - * @param enable - * Nonzero to enter isolated mode, attempt to leave it otherwise. - * @param[out] error - * Perform verbose error reporting if not NULL. PMDs initialize this - * structure in case of error only. - * - * @return - * 0 on success, a negative value on error. + * @see rte_flow_isolate() + * @see rte_flow_ops */ static int mlx4_flow_isolate(struct rte_eth_dev *dev, @@ -957,14 +947,17 @@ mlx4_flow_isolate(struct rte_eth_dev *dev, { struct priv *priv = dev->data->dev_private; - if (priv->rxqs) { - rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_UNSPECIFIED, - NULL, "isolated mode must be set" - " before configuring the device"); - return -rte_errno; - } + if (!!enable == !!priv->isolated) + return 0; priv->isolated = !!enable; + if (enable) { + mlx4_mac_addr_del(priv); + } else if (mlx4_mac_addr_add(priv) < 0) { + priv->isolated = 1; + return -rte_flow_error_set(error, rte_errno, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "cannot leave isolated mode"); + } return 0; } -- 2.1.4