From patchwork Mon Nov 6 10:41:41 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: 31199 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 2B0A01B254; Mon, 6 Nov 2017 11:41:39 +0100 (CET) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id ACF0D1B252 for ; Mon, 6 Nov 2017 11:41:37 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id b189so12677422wmd.4 for ; Mon, 06 Nov 2017 02:41:37 -0800 (PST) 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; bh=YVJjZxZ+MK0g1hmG1biZYGjYRd6CvDcNz4RdWC8Vbzs=; b=UXVIUP6MLP5Y9+kfjj5ePyhI4+9+2RapBivciYx1R3EEbKzoexbLNxIOsybvSrS7HD ySOjxnul8VncVSA4fnZdbyPYgCHcmjUaaQ5DTzrGzN1/AXP8DmpxaukEMF5XS3bl5mYo uU0WOZKcySfjqpMf2c36LHpNswB6ZJ4lPoEqvrQ4b7onHulDlrYo/sGzfOXTo4WVS+3g c5G2JLXTGcmn5Iw2e4GbMoUa05WqTvwuUtigIjtiqeT+U6QVKcDNNZsnvwuSm4KcsAzg G5xZNvjK2/uvdPSkoW8WvAr/3dwy71/l05jFQG7PE4jhRZSk3GpKs7oyi0rQJum6vM74 zHjQ== 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; bh=YVJjZxZ+MK0g1hmG1biZYGjYRd6CvDcNz4RdWC8Vbzs=; b=SzHyN525syqGKdbS1U92qv0US58TfzVDonCoTSFfso5TC/HHTKlkwkuQ/nzYEEXodS rlN6iuzl9adT8DBi8NVbSw/1ZkBV2CiED0aJrqSYCQXylrwy2bqDN3S+GWuvexdNaGqz JJSvnurnq9WR4AxaOVLAE3q/0y1rO2221iL6rB2XqR3qIuTsqG6euDpBcXUeDZpF15u+ EBNr80/MLA/4C7SWXICfIZStJz767EOD7Fkc2d4URip5nd+yYv/TzX1GslUdXuqstfKZ 70XnaVhiFoFRbJ8ubnxswX+Hd4PkF0LAAsx/R9+u7tOJ1JLVbVz+tS/B8zrF5HIzMw6H D6Rg== X-Gm-Message-State: AJaThX4msnmS2uU+7SqD6sP1MqAQnP8Cp0LiBn7Wd/i8neHbAr0izMu+ 1/nfDuUJmVqq08fsfxpvt24WsL5zTQ== X-Google-Smtp-Source: ABhQp+TgnzScADAm+4vV+uM/Ry7SxEdVtrMwPaNWSI6JyexzC/L5zWRZcNyDo01LGc5M3uwAL3rdMw== X-Received: by 10.28.54.89 with SMTP id d86mr4709644wma.101.1509964897156; Mon, 06 Nov 2017 02:41:37 -0800 (PST) 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 o190sm11178160wmd.32.2017.11.06.02.41.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 02:41:36 -0800 (PST) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Adrien Mazarguil , Yongseok Koh Date: Mon, 6 Nov 2017 11:41:41 +0100 Message-Id: <703e09f73c94888401e3c0fd1f5a94e7d39ccdfe.1509964879.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow director delete with 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Removing a flow director rule with a drop action ends by not removing it due to a missing verbs drop specification in the conversion process between the flow director and generic flow API. Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5f49bf5ff..703a3459e 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2866,6 +2866,22 @@ priv_fdir_filter_delete(struct priv *priv, attributes.actions, &error, &parser); if (ret) goto exit; + /* + * Special case for drop action which is only set in the + * specifications when the flow is created. In this situation the + * drop specification is missing. + */ + if (parser.drop) { + struct ibv_flow_spec_action_drop *drop; + + drop = (void *)((uintptr_t)parser.drop_q.ibv_attr + + parser.drop_q.offset); + *drop = (struct ibv_flow_spec_action_drop){ + .type = IBV_FLOW_SPEC_ACTION_DROP, + .size = sizeof(struct ibv_flow_spec_action_drop), + }; + parser.drop_q.ibv_attr->num_of_specs++; + } TAILQ_FOREACH(flow, &priv->flows, next) { struct ibv_flow_attr *attr; struct ibv_spec_header *attr_h;