Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4626895pxj; Wed, 12 May 2021 09:32:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzaKBzufKgHdV/PXk2m2ALPIjyDDXjkSOs/d3eFs7BOnphweHBnDT+CDFr8tLztIp+DAon X-Received: by 2002:a17:906:d7a2:: with SMTP id pk2mr38872497ejb.551.1620837126813; Wed, 12 May 2021 09:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837126; cv=none; d=google.com; s=arc-20160816; b=HRNZ9NKzVOxtPEQWS+fNQRfrynUVqHp1INkWeUM4l2RsJz+a0QRJpT1weJ4iUqipeg 5vsSL2IvmkXHivGPYvKTyB71mpdDFWWH5g3oBqE14iPVI+rx9PHW0cxRm4XylJRiIGLO dLH52SqO7od31XuZ7WvpiHTaE0bNvVIeE8HNdcmDwIQF0Yr1qKmqzwNAFYci18friP+9 Yr7HtYqyf+ao6TNG38i8Nbw5b3tA1rwCbn6V6unyvDWpz2IfPg4HYOKAwx9Lq+JOV34o iRVcUlRqoUzJWfD0AyMFod8CG5aSJp52dsYMTl5WORDbY1cc+xdsoYlOGu3njrSk7vQl /yHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+zgdKem6D0meHlKt6qGl5gy2QDi/XROm7NybPrE2MPE=; b=dEe2azbEHmxj3RhvhkFNnYaxpOtXpzU5f3QJo132K0ZHnZZxEg8Ly2WPgVsoR21GJB hNuPkXcSxYlKJZAZKYqycbEQ/1de8V+YwHr5LbUIRvY18nkEn0zkqIrWn2MiuJQYO5EQ UXCwq/rxzdW0KN+Q03KTMRBApOMpeI10LpDdTjWnzb0rE6uu0qu5xVPPbIB+VHELvhL1 lp3Ksd1RGD6y+M34BGAWK+ZceaWijKnwjZ7tcVtl6HIBXzC9CAdmnWD9j49FxWNwWvy7 Pwv/f08HnxQII5KBUI9g0yKAlHZnmpSc53WCpEh/AYz5eDioG0CMwLWMI1fldo4oW9dL L8sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BojLnF6/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ji21si212335ejc.740.2021.05.12.09.31.41; Wed, 12 May 2021 09:32:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BojLnF6/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240757AbhELQZX (ORCPT + 99 others); Wed, 12 May 2021 12:25:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:56600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236320AbhELPhh (ORCPT ); Wed, 12 May 2021 11:37:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3D5E61992; Wed, 12 May 2021 15:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832749; bh=JJf+W2xCrRTBrLwg5F/9Ty9uZZZqI4O7qvJPS6KqPv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BojLnF6/hw+zGIUsyeCyWOBvQBAwdE76fLHlBsSfQYb/hShpaA5BOn8wcSTBOjb2f I0RVUSQ+cNZHnklJko/26sKOd8YTjLUGS8bx9moiqs1yAha5sif4G6lzqDRgLTponG se+iSl8305hBWoQbcyFVAMCE+HdUCeBtosTRyvj4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Bloch , Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 373/530] RDMA/mlx5: Fix drop packet rule in egress table Date: Wed, 12 May 2021 16:48:03 +0200 Message-Id: <20210512144832.036106253@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maor Gottlieb [ Upstream commit c73700806d4e430d182c2be069d230076818a99a ] Initial drop action support missed that drop action can be added to egress flow tables as well. Add the missing support. This requires making sure that dest_type isn't set to PORT which in turn exposes a possibility of passing dst while indicating number of dsts as zero. Explicitly check for number of dsts and pass the appropriate pointer. Fixes: f29de9eee782 ("RDMA/mlx5: Add support for drop action in DV steering") Link: https://lore.kernel.org/r/20210318135123.680759-1-leon@kernel.org Reviewed-by: Mark Bloch Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/fs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c index 492cfe063bca..13d50b178166 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -1528,8 +1528,8 @@ static struct mlx5_ib_flow_handler *raw_fs_rule_add( dst_num++; } - handler = _create_raw_flow_rule(dev, ft_prio, dst, fs_matcher, - flow_context, flow_act, + handler = _create_raw_flow_rule(dev, ft_prio, dst_num ? dst : NULL, + fs_matcher, flow_context, flow_act, cmd_in, inlen, dst_num); if (IS_ERR(handler)) { @@ -1885,8 +1885,9 @@ static int get_dests(struct uverbs_attr_bundle *attrs, else *dest_id = mqp->raw_packet_qp.rq.tirn; *dest_type = MLX5_FLOW_DESTINATION_TYPE_TIR; - } else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS || - fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_RDMA_TX) { + } else if ((fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS || + fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_RDMA_TX) && + !(*flags & MLX5_IB_ATTR_CREATE_FLOW_FLAGS_DROP)) { *dest_type = MLX5_FLOW_DESTINATION_TYPE_PORT; } -- 2.30.2