From patchwork Tue Mar 27 09:37:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10309677 X-Patchwork-Delegate: leon@leon.nu Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD1236037D for ; Tue, 27 Mar 2018 09:38:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B389429930 for ; Tue, 27 Mar 2018 09:38:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7F8C299AE; Tue, 27 Mar 2018 09:38:02 +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=-6.9 required=2.0 tests=BAYES_00, 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 45E7429930 for ; Tue, 27 Mar 2018 09:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168AbeC0JiA (ORCPT ); Tue, 27 Mar 2018 05:38:00 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:53170 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750978AbeC0JiA (ORCPT ); Tue, 27 Mar 2018 05:38:00 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 27 Mar 2018 11:38:51 +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 w2R9bwic024005; Tue, 27 Mar 2018 12:37:58 +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 w2R9bwVJ031918; Tue, 27 Mar 2018 12:37:58 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id w2R9brs1031906; Tue, 27 Mar 2018 12:37:53 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, guyle@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core] mlx4: Enable WQ creation with IBV_WQ_FLAGS_SCATTER_FCS Date: Tue, 27 Mar 2018 12:37:22 +0300 Message-Id: <1522143442-31794-1-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 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 From: Guy Levi Enable WQ creation with the IBV_WQ_FLAGS_SCATTER_FCS flag. Prior to using this option an application should check whether the IBV_RAW_PACKET_CAP_SCATTER_FCS capability is set on the device's raw_packet_caps. Signed-off-by: Guy Levi Signed-off-by: Yishai Hadas --- PR was sent: https://github.com/linux-rdma/rdma-core/pull/314 providers/mlx4/verbs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/providers/mlx4/verbs.c b/providers/mlx4/verbs.c index 9d8d340..534838b 100644 --- a/providers/mlx4/verbs.c +++ b/providers/mlx4/verbs.c @@ -1422,7 +1422,13 @@ struct ibv_wq *mlx4_create_wq(struct ibv_context *context, } } - if (attr->comp_mask) { + if (!check_comp_mask(attr->comp_mask, IBV_WQ_INIT_ATTR_FLAGS)) { + errno = ENOTSUP; + return NULL; + } + + if ((attr->comp_mask & IBV_WQ_INIT_ATTR_FLAGS) && + (attr->create_flags & ~IBV_WQ_FLAGS_SCATTER_FCS)) { errno = ENOTSUP; return NULL; }