From patchwork Thu Oct 5 12:49:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?N=C3=A9lio_Laranjeiro?= X-Patchwork-Id: 29715 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E95471B282; Thu, 5 Oct 2017 14:50:57 +0200 (CEST) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 1C7231B219 for ; Thu, 5 Oct 2017 14:50:45 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id i124so1984614wmf.3 for ; Thu, 05 Oct 2017 05:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=t6OGdejel62bSVy6hKmxh9BDL1NYJcBX4C8O+PTt3+g=; b=fobTUZT/4cy0YyAmFoF4+BDt1JUUXyZoKKxlYLdK+74hB9qzRw+1fSh87urqSdDVpz /D0qjUpiNVGqT+qCUTzhUeqkpKtnPlkEpi1q2zU3dXRYCoA/mkOxEmaezc+IwSXqOCf7 Ku58KxKDizi2DC6D3eAyULKSOLZsaXuuCnOtSkLdTqe0iOxjSaKHcDNbM7KIvKlouELx XfAT6oxSF4NOBYTySJKLPRXrsVHj2KRacP7/7471AMo5paeg7IQQL/MnEyD5QvJxuB7d kFXYvQbfLPHzApltrNotu/X2he5+lyutrJuHYF2a68yiAgg4eXfiv42ESQ7SfUb9IMFS ySKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=t6OGdejel62bSVy6hKmxh9BDL1NYJcBX4C8O+PTt3+g=; b=D38cZz9ZvgZ123HkTDL54S9YeQVwc8/cNhvdzQFgkkWYQwGJm5VjUKUFQHQJovqJnr rRWOd4HAQK7JazoIbbsIv4X885E+oZMAVOoWNdR0SEYBngfKCK53j0F3QDvzO4Us8Nx0 CPsEI6zNtFWdvqrbvaFVOfrUDVppUKxLzrn3yQ/oACNDWC9P92xuhJKoi6jIYhuh3j6G yszbT0Cbhd/a5DEl4ajTBs+lnVnKomrAgeG9Jbqau4sAmq13h7WAgfTHJfLzUNPoPiV7 ilfYq3+gGlnT27luiZRgJ9rDWY3WEtDLwFTyTIAajAYlrLDCV2IT8rwgvYPK7xSOUIMl 3IwA== X-Gm-Message-State: AMCzsaX0CxIvoOgkYaXH7IYC3ZDpBjNqwO3D4WTMDToBc53zzibrY5jG EC9Qw/xBgo4dAk2GM41NLvJ4DHzGuw== X-Google-Smtp-Source: AOwi7QCkIRbUpKMr/sna3obpDQ/gsNPCU5I+wtunhmzugViioGzx53XSuLxvfyQWha9tgueUVDhBTA== X-Received: by 10.28.152.88 with SMTP id a85mr13254347wme.45.1507207844548; Thu, 05 Oct 2017 05:50:44 -0700 (PDT) Received: from ping.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k9sm26405823wrk.27.2017.10.05.05.50.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Oct 2017 05:50:44 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com, ferruh.yigit@intel.com Date: Thu, 5 Oct 2017 14:49:55 +0200 Message-Id: <3b7a6b8c2dd3e040569a7cdb8e79fc92edbf38bc.1507207731.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 23/30] net/mlx5: process flows actions before of items 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In case the pattern contains an RSS actions, the RSS configuration to use is the one provided by the user. To make the correct conversion from DPDK RSS hash fields to Verbs ones according to the users requests the actions must be processed first. Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 90 ++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 090a298..a30f1ae 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -484,51 +484,6 @@ priv_flow_convert(struct priv *priv, "only ingress is supported"); return -rte_errno; } - for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) { - const struct mlx5_flow_items *token = NULL; - unsigned int i; - int err; - - if (items->type == RTE_FLOW_ITEM_TYPE_VOID) - continue; - for (i = 0; - cur_item->items && - cur_item->items[i] != RTE_FLOW_ITEM_TYPE_END; - ++i) { - if (cur_item->items[i] == items->type) { - token = &mlx5_flow_items[items->type]; - break; - } - } - if (!token) - goto exit_item_not_supported; - cur_item = token; - err = mlx5_flow_item_validate(items, - (const uint8_t *)cur_item->mask, - cur_item->mask_sz); - if (err) - goto exit_item_not_supported; - if (flow->ibv_attr && cur_item->convert) { - err = cur_item->convert(items, - (cur_item->default_mask ? - cur_item->default_mask : - cur_item->mask), - flow); - if (err) - goto exit_item_not_supported; - } else if (items->type == RTE_FLOW_ITEM_TYPE_VXLAN) { - if (flow->inner) { - rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ITEM, - items, - "cannot recognize multiple" - " VXLAN encapsulations"); - return -rte_errno; - } - flow->inner = 1; - } - flow->offset += cur_item->dst_sz; - } for (; actions->type != RTE_FLOW_ACTION_TYPE_END; ++actions) { if (actions->type == RTE_FLOW_ACTION_TYPE_VOID) { continue; @@ -644,6 +599,51 @@ priv_flow_convert(struct priv *priv, NULL, "no valid action"); return -rte_errno; } + for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) { + const struct mlx5_flow_items *token = NULL; + unsigned int i; + int err; + + if (items->type == RTE_FLOW_ITEM_TYPE_VOID) + continue; + for (i = 0; + cur_item->items && + cur_item->items[i] != RTE_FLOW_ITEM_TYPE_END; + ++i) { + if (cur_item->items[i] == items->type) { + token = &mlx5_flow_items[items->type]; + break; + } + } + if (!token) + goto exit_item_not_supported; + cur_item = token; + err = mlx5_flow_item_validate(items, + (const uint8_t *)cur_item->mask, + cur_item->mask_sz); + if (err) + goto exit_item_not_supported; + if (flow->ibv_attr && cur_item->convert) { + err = cur_item->convert(items, + (cur_item->default_mask ? + cur_item->default_mask : + cur_item->mask), + flow); + if (err) + goto exit_item_not_supported; + } else if (items->type == RTE_FLOW_ITEM_TYPE_VXLAN) { + if (flow->inner) { + rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM, + items, + "cannot recognize multiple" + " VXLAN encapsulations"); + return -rte_errno; + } + flow->inner = 1; + } + flow->offset += cur_item->dst_sz; + } return 0; exit_item_not_supported: rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM,