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 531DA2BCE for ; Fri, 4 May 2018 17:18:00 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id p18-v6so21499302wrm.1 for ; Fri, 04 May 2018 08:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=aGt70q+5ASzT/E+KABmJu1szvgbXHtn6PDnAHJ81nD8=; b=mbEgoD60OJyRR0XlXICCPhounOFfoAGA6BpIwv3LkldBwEJ6LTiTuZHPwAb/0aSSSu xSHJhzxQcYXxHIijm6lmz7Xz7mZNWRBnQ42bqzcM/oNiipHRQzJFktqrWHBoGXk/5yFB 2vWfSRib0DHheo9GPVGGnavQsOocPEF/uhBL+eMg6jA9xoSZXjJW/UfHJS7CPlkzD2y4 p6jx3p2ZPEZYHFtkWrBTiFtEqYhJwfXDT34HmWxjhK4LcnuOYloKFozXJJjCcIMaXgtQ koyjWrM5VmrX8FC2J97ztLtcdVzDovKqhXjuYOCyjzxYzZDEO2spcPYXL+KWvg8Ytafv M95Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=aGt70q+5ASzT/E+KABmJu1szvgbXHtn6PDnAHJ81nD8=; b=YLbeR+PDszjNcg7lBccQOCzTSxpkH7qvIEHyZYo10oEPQn1mYqjzc36D4OuAQ8OLct lQVThOqqFFljuToCnuMS6w5NA7+ZoggtUlcT9TfKmeAlQPxFYMrZEUu1L2zJRyRuXaEU ZQlCOLxfPVQOWC2opir3ETpDgnuk1mt51wCMOtwQIWDpUOjiJuMVxiqe+BPHkIy+hzho AcVqTSHZh5qj4eJpy7ZQ3Ufv4LzB9mtCcfIFeVgzs54MRHPbO+gURkUGI5Y8Bmtbp7zJ jDMDG6/PMG3cKx9VF3C9HRGlDmSheruK41li1BHguB2Q5PBmCflam5MsusumuF385mZq HszQ== X-Gm-Message-State: ALQs6tAK/SXD9eWrNl4yoYJCnFqBRLy0rMIVQjbaIo612XiGBXPoUt0a n/f7m4dOV/EPaYEiplhYB0jGzA== X-Google-Smtp-Source: AB8JxZqve76K+i0CmPkrAk3tEmvTN6HaKzSl4ncp8IpPvFLj2eU7vewiDffYgI8Lpi4Fmlx24Zy5Wg== X-Received: by 2002:adf:8121:: with SMTP id 30-v6mr2798814wrm.109.1525447080018; Fri, 04 May 2018 08:18:00 -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 m17-v6sm15641617wrh.3.2018.05.04.08.17.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 08:17:58 -0700 (PDT) Date: Fri, 4 May 2018 17:17:44 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: Ferruh Yigit , dev@dpdk.org, stable@dpdk.org Message-ID: <20180504151421.24765-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH 1/2] net/mlx4: fix UDP flow rule limitation enforcement 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, 04 May 2018 15:18:00 -0000 For some unknown reason, priorities do not have any effect on flow rules that happen to match UDP destination ports. Those are always matched first regardless. This patch is a workaround that enforces this limitation at the PMD level; such flow rules can only be created at the highest priority level for correctness. Fixes: a5171594fc3b ("net/mlx4: expose support for flow rule priorities") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4_flow.c | 9 +++++++++ drivers/net/mlx4/mlx4_flow.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index bebad074e..3f754b480 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -357,6 +357,9 @@ mlx4_flow_merge_ipv4(struct rte_flow *flow, * Additional mlx4-specific constraints on supported fields: * * - No support for partial masks. + * - Due to HW/FW limitation, flow rule priority is not taken into account + * when matching UDP destination ports, doing is therefore only supported + * at the highest priority level (0). * * @param[in, out] flow * Flow rule handle to update. @@ -388,6 +391,11 @@ mlx4_flow_merge_udp(struct rte_flow *flow, msg = "mlx4 does not support matching partial UDP fields"; goto error; } + if (mask && mask->hdr.dst_port && flow->priority) { + msg = "combining UDP destination port matching with a nonzero" + " priority level is not supported"; + goto error; + } if (!flow->ibv_attr) return 0; ++flow->ibv_attr->num_of_specs; @@ -658,6 +666,7 @@ mlx4_flow_prepare(struct priv *priv, fill: overlap = 0; proc = mlx4_flow_proc_item_list; + flow->priority = attr->priority; /* Go over pattern. */ for (item = pattern; item->type; ++item) { const struct mlx4_flow_proc_item *next = NULL; diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h index 7b83d74b0..2c8dff362 100644 --- a/drivers/net/mlx4/mlx4_flow.h +++ b/drivers/net/mlx4/mlx4_flow.h @@ -42,6 +42,7 @@ struct rte_flow { uint32_t promisc:1; /**< This rule matches everything. */ uint32_t allmulti:1; /**< This rule matches all multicast traffic. */ uint32_t drop:1; /**< This rule drops packets. */ + uint32_t priority; /**< Flow rule priority. */ struct mlx4_rss *rss; /**< Rx target. */ }; -- 2.11.0