From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id B00591B7DB for ; Tue, 24 Oct 2017 17:18:32 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id l1so21084139wrc.3 for ; Tue, 24 Oct 2017 08:18:32 -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=i1VW+GpBGLTmJGgTz/QEDxyx7g7x2bRHXATQLb1UnSA=; b=nPfvv92zLLGqMSYySjM8SK02ZkQ5qiD9o/WRHw350NoHYaTNARddLu6EtGSkgwKXd3 jhgavfoR17UfCrpW0i96UdFCWhqJfuLGftZEO6vcIPzfnbaYYvJfjYV1/RnjioTA0Zms Bka4g+9ZTIqO8eZIiOaD+Dc7QduAltflOGqXP+4RjhvcObDLlOnpoYS/kdeJ9s8o7SMs aUoTku0hfKuYYpkdkR3mK8R2/xH/HDl9Lkqlhp8kqcQ3xXS3RNDuLFHPlRVILH+HHwMc GDYzsuCcVRAuR5KAj6/xivP8sHV+FHTp8sUGV6s2+/hZge0bxiELlJjgV0A4DrJKwVKo FfCQ== 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=i1VW+GpBGLTmJGgTz/QEDxyx7g7x2bRHXATQLb1UnSA=; b=A9YtRCyguAkDrnddNsUSfSykiVfvAzZkACVE/f1Vq8yNNnq/idQno5hyJX0W7leTKW rXoBmIHmgnRIEdKxweDBRr6qdOpMfoX9HXtop2nzR+OJfRhB/ndLjA8Ubr1a9Frn5cGT n+0uZ6ZmgtIJMHlA1NBM+BRflF/D7WO902ilDSk/IFmxR3XLB+hIOQDMFV1fTF7PmUlk TiDMneiEYq2qkMq8zirczCHQNTG8xmDljomxW4jNa89GJdtJnoZUXvcC9Sbzm2ppHfdS Kf4gmTgLkmRwcAwl8O4OijHhRsiOaji60l/UoNAPI6sPUPi8doM6GydwfmX5ZZxas8uU FSyw== X-Gm-Message-State: AMCzsaWCncYWcCZyQpDXRoogyrqUlkEW38hFu+jQxnaKVkPIKGuzqemq rZ9iZ7wVIrpwmMLN3xkDyRoUPFPcnQ== X-Google-Smtp-Source: ABhQp+SK7uXC1B7gW7g2GTsabaRVu94fKhBYFnlUJEJQhuPlCg5hrxRBH3TKHNMVZu1Ebn3NNf5dKA== X-Received: by 10.223.176.82 with SMTP id g18mr6379772wra.234.1508858312083; Tue, 24 Oct 2017 08:18:32 -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 v23sm637300wmh.8.2017.10.24.08.18.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 08:18:31 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Yongseok Koh , Adrien Mazarguil Date: Tue, 24 Oct 2017 17:18:15 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 4/7] net/mlx5: fix flow director drop action 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, 24 Oct 2017 15:18:33 -0000 Flow director drop action as not been brought back with the new implementation on top of rte flow. Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 6f458f44a..96a753e8d 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2601,20 +2601,27 @@ priv_fdir_filter_convert(struct priv *priv, ERROR("invalid queue number %d", fdir_filter->action.rx_queue); return EINVAL; } - /* Validate the behavior. */ - if (fdir_filter->action.behavior != RTE_ETH_FDIR_ACCEPT) { - ERROR("invalid behavior %d", fdir_filter->action.behavior); - return ENOTSUP; - } attributes->attr.ingress = 1; attributes->items[0] = (struct rte_flow_item) { .type = RTE_FLOW_ITEM_TYPE_ETH, .spec = &attributes->l2, }; - attributes->actions[0] = (struct rte_flow_action){ - .type = RTE_FLOW_ACTION_TYPE_QUEUE, - .conf = &attributes->queue, - }; + switch (fdir_filter->action.behavior) { + case RTE_ETH_FDIR_ACCEPT: + attributes->actions[0] = (struct rte_flow_action){ + .type = RTE_FLOW_ACTION_TYPE_QUEUE, + .conf = &attributes->queue, + }; + break; + case RTE_ETH_FDIR_REJECT: + attributes->actions[0] = (struct rte_flow_action){ + .type = RTE_FLOW_ACTION_TYPE_DROP, + }; + break; + default: + ERROR("invalid behavior %d", fdir_filter->action.behavior); + return ENOTSUP; + } attributes->queue.index = fdir_filter->action.rx_queue; switch (fdir_filter->input.flow_type) { case RTE_ETH_FLOW_NONFRAG_IPV4_UDP: -- 2.11.0