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 66350A49B for ; Tue, 13 Mar 2018 15:18:59 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id o8so23211859wra.1 for ; Tue, 13 Mar 2018 07:18:59 -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=MIZGTvO22YaiezK4SoCGdMTsTY9yRayxIfg+Af28tcE=; b=BGyVeZ75GrWz6wta/OPGHvxZ+HcnOI+m+AL85rKGlGKO8QpGISsPNXoSsEq0q7PhlM MybGDZWRMvnYBaC/TTZAOXXvLcbGG0iqcRpOZr0PZQbwnfYyT1GmNDIynD/ffAJ23yG7 PK9sLlNtI6tuwx0rEOSX/ULjmz5RsUNwFRyiALmZkpYE94pSyzEihEGRL3mCOfgtCwmV PPrzx3lSLVGfAWZVyDfyvEoJc2ryZXX4ITrev6TTxJOrCQbi6ngh4TgaFsBrTAW8YM+N Db4N3Ua1EbtNu0dLS1SnHzBgRxKfsM1oYxCmRccMELzX7ISVj93j3tBuYpyIAgH9IxIP USxA== 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=MIZGTvO22YaiezK4SoCGdMTsTY9yRayxIfg+Af28tcE=; b=bdkge1raC+GVmFAscX164IfFTgijcV2X+8pKFEeMZvoirP0LK2c+n7CI/R/zVvdYzW eZOMDRSEOwdszS6bjr/Kzmkcl0MRTuDmMceI2I+DZue4boIBJ080r2+8SfhYk0g/GIib uJ4Ox7Fr9LMei02oJAGGkqAFV55tgQayM4SP2v3AEZHkCfH7GogLFstR5emz1ouzZxLi wm9ddpV+aJ1D2dKxh4n4Jup16fFhemAT3Y/zZM4PuDjOOev8/cusv5Mfqx1VXStZkuAT VpWnJyQpM644/v8kMZlmUut/QaQKRloKWh5CgSqUscnBeldVhbPROh1K3dVbPK57ljE/ RpWA== X-Gm-Message-State: AElRT7Hgln4m/MGmL8L7sSlKS0W/LDZMioOOks74b6hzwCBvUVevYQZz F0vTJWErq2s3eRSHD8jn9U31TjHvGw== X-Google-Smtp-Source: AG47ELtV7GIA+e+kGzv6fD76VfszlU6vRjd09tVtxGc+Dvv3rABkMO2lS4YrpE2qg7cWRXgAMxnG9A== X-Received: by 10.223.169.80 with SMTP id u74mr779326wrc.29.1520950739212; Tue, 13 Mar 2018 07:18:59 -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 x78sm466302wmd.2.2018.03.13.07.18.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 07:18:58 -0700 (PDT) From: Nelio Laranjeiro To: Adrien Mazarguil , Yongseok Koh Cc: dev@dpdk.org Date: Tue, 13 Mar 2018 15:17:39 +0100 Message-Id: <0fdcf57a444961b082e7b4baaab6cc072c99da0d.1520950386.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: <7aeb54018d1a8dd06638632076f25fbc88945afd.1518686582.git.nelio.laranjeiro@6wind.com> Subject: [dpdk-dev] [PATCH 4/4] net/mlx5: refuse empty VLAN flow specification 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: Tue, 13 Mar 2018 14:18:59 -0000 Verbs specification does help to distinguish between packets having an VLAN and those which do not have, this ends by having flow rule which does not react as the user expects e.g. flow create 0 ingress pattern eth / vlan / end action queue index 0 / end flow create 0 ingress pattern eth / end action queue index 1 / end are colliding in Verbs definition as in both rule are matching packets with or without VLAN. For this reason, the VLAN specification must not be empty, otherwise the PMD has to refuse it. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5c096ca9c..875a5028d 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1305,9 +1305,18 @@ mlx5_flow_create_vlan(const struct rte_flow_item *item, eth->val.vlan_tag = spec->tci; eth->mask.vlan_tag = mask->tci; eth->val.vlan_tag &= eth->mask.vlan_tag; + /* + * From verbs perspective an empty VLAN is equivalent + * to a packet without VLAN layer. + */ + if (!eth->mask.vlan_tag) + goto error; } + return 0; } - return 0; +error: + return rte_flow_error_set(data->error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, + item, "VLAN cannot be empty"); } /** -- 2.11.0