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 45D611B646 for ; Mon, 23 Oct 2017 16:50:17 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id k62so17662654wrc.9 for ; Mon, 23 Oct 2017 07:50:17 -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=yXiitBQ/FZimOKk5+dBWxwHXypA8cIAnCm4f/i8ZBksh0P641V/T9ztcwN8QNpxXZr GFhVPsAXjbgKO77hdxp/OwLmh/NzdaWU5Qg23HxgniW8r4EBecr0xu/lhQYvNFp/zxSW f01OadGlPPqV/diveyjyjd5MjYaGQvT2rNn0TgdyHzRKp97Wq4g/vyLJb3IXB5QIvC50 KMBWsJIZbPd5XpMn/vQY5bK4F5QHkYk9y9WRHtb+ASIGPJMi/MZ/+G6jRY3RvdJ5yuZX xafj8mBAjHeKQb4nxePqseWA+6zGiFSpk8WEsKRDmfLuiPpw2ba4OyuGtGwT2l9ZOOSq cCPg== 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=DKPLz4noA5tcqy3Au6+h+1Ug358DDEjQUgdlfZLrxp7J1+dY5cZoRWE3ONOkDo/twU AW1LfBngdx/rV+HoKXlGuUBHsccdICA2jM6RtwBx7PJSZW4RwklwQTP8+ry3ELHFvhOy FemIoVidqDnCfPhjC21qynCDE5Hbme0k+n8hRdpXcttxIizgk2Ado/a9mO3AyVPSPNen ymyjLYsmvb2cSg/lP5ujWxAmxs60x8fvMJfuALG3ZESzlM2NvfcuYYK0NztMswfWrGUz o5lp/QdeS8HIWluu60S7PBfIsK20wqvNWLuws8LGSoSEVZomWgvMPpjSfsB+Dx3F7NTy o1tA== X-Gm-Message-State: AMCzsaWwjcabDSEegZYDU0jBy7OB6Pp7ftzV9x1d5azxWLWHK/pwia0J BCo3XbIHdGtjB1V3zqQoXU85LWgTCg== X-Google-Smtp-Source: ABhQp+QAkBZ5GtPdQdfja0BLgkilvni2aJPJ6ipn1t4cJRv0p590nRVDehdtE0g/v4j6PoJrQIpH9A== X-Received: by 10.223.179.20 with SMTP id j20mr12498086wrd.116.1508770216501; Mon, 23 Oct 2017 07:50:16 -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 s196sm4908234wmb.26.2017.10.23.07.50.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 07:50:15 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Yongseok Koh , Adrien Mazarguil Date: Mon, 23 Oct 2017 16:49:54 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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: Mon, 23 Oct 2017 14:50:17 -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