From patchwork Wed Oct 10 16:56:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10634901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF39317E3 for ; Wed, 10 Oct 2018 17:14:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B74E29A86 for ; Wed, 10 Oct 2018 17:14:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F02B29FFC; Wed, 10 Oct 2018 17:14:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4B2029A86 for ; Wed, 10 Oct 2018 17:14:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbeJKAhG (ORCPT ); Wed, 10 Oct 2018 20:37:06 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:59811 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726649AbeJKAhG (ORCPT ); Wed, 10 Oct 2018 20:37:06 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 10 Oct 2018 19:01:45 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w9AGus0b007096; Wed, 10 Oct 2018 19:56:54 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id w9AGusAA031326; Wed, 10 Oct 2018 19:56:54 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id w9AGusk4031325; Wed, 10 Oct 2018 19:56:54 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, Alexr@mellanox.com, jgg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 3/3] mlx5: Add support for DEVX object as a flow destination Date: Wed, 10 Oct 2018 19:56:30 +0300 Message-Id: <1539190590-31186-4-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1539190590-31186-1-git-send-email-yishaih@mellanox.com> References: <1539190590-31186-1-git-send-email-yishaih@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A flow destination can be some DEVX object that was previously created, adds this option as part of mlx5dv_create_flow(). Signed-off-by: Yishai Hadas --- providers/mlx5/mlx5dv.h | 2 ++ providers/mlx5/verbs.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h index 0385b68..9c39e3c 100644 --- a/providers/mlx5/mlx5dv.h +++ b/providers/mlx5/mlx5dv.h @@ -224,6 +224,7 @@ enum mlx5dv_flow_action_type { MLX5DV_FLOW_ACTION_IBV_COUNTER, MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION, MLX5DV_FLOW_ACTION_TAG, + MLX5DV_FLOW_ACTION_DEST_DEVX, }; struct mlx5dv_flow_action_attr { @@ -233,6 +234,7 @@ struct mlx5dv_flow_action_attr { struct ibv_counters *counter; struct ibv_flow_action *action; uint32_t tag_value; + struct mlx5dv_devx_obj *obj; }; }; diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index a8a7fa3..13616ad 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -3775,6 +3775,7 @@ mlx5dv_create_flow(struct mlx5dv_flow_matcher *flow_matcher, int num_flow_actions = 0; struct mlx5_flow *mflow; bool have_qp = false; + bool have_dest_devx = false; int ret; int i; DECLARE_COMMAND_BUFFER(cmd, UVERBS_OBJECT_FLOW, @@ -3799,7 +3800,7 @@ mlx5dv_create_flow(struct mlx5dv_flow_matcher *flow_matcher, type = actions_attr[i].type; switch (type) { case MLX5DV_FLOW_ACTION_DEST_IBV_QP: - if (have_qp) { + if (have_qp || have_dest_devx) { errno = EOPNOTSUPP; goto err; } @@ -3820,6 +3821,15 @@ mlx5dv_create_flow(struct mlx5dv_flow_matcher *flow_matcher, flow_actions[num_flow_actions] = vaction->handle; num_flow_actions++; break; + case MLX5DV_FLOW_ACTION_DEST_DEVX: + if (have_dest_devx || have_qp) { + errno = EOPNOTSUPP; + goto err; + } + fill_attr_in_obj(cmd, MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX, + actions_attr[i].obj->handle); + have_dest_devx = true; + break; default: errno = EOPNOTSUPP; goto err;