From patchwork Sun Jul 1 12:50:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 10498671 X-Patchwork-Delegate: jgg@ziepe.ca 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 55CD560284 for ; Sun, 1 Jul 2018 12:50:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3776F2897F for ; Sun, 1 Jul 2018 12:50:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 286DD28A6A; Sun, 1 Jul 2018 12:50:24 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 BF5F92897F for ; Sun, 1 Jul 2018 12:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752109AbeGAMuW (ORCPT ); Sun, 1 Jul 2018 08:50:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:34242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752031AbeGAMuV (ORCPT ); Sun, 1 Jul 2018 08:50:21 -0400 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EADED250D3; Sun, 1 Jul 2018 12:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530449421; bh=9LkUO23hwQHyM1m9kjLgSuDIU/rp2zGA8a/U20eeZB4=; h=From:To:Cc:Subject:Date:From; b=k+atDRm1JSCYUEZMoAceSOf2k8EfTlOSNEleauKPo1hGlbkX4IiAkRzIhBgwPc8oh ZtJBa/oeHJRf92RsWsZ49VSRrjOgDRSGBVvZ+eUxvBBsECp5hDE3eRnnPu3vUGQe9L n+xauFuzv35XK+0D1kajrJKejqjb3SSOc/FwQ2Po= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Maor Gottlieb , RDMA mailing list , Ariel Levkovich , Leon Romanovsky Subject: [PATCH rdma-next] IB/mlx5: Fix GRE flow specification Date: Sun, 1 Jul 2018 15:50:17 +0300 Message-Id: <20180701125017.26805-1-leon@kernel.org> X-Mailer: git-send-email 2.17.1 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: Maor Gottlieb Currently the driver sets the mask of the gre_protocol to 0xffff without consideration in the user request. Fix it by copy the mask from the verbs spec. Fixes: da2f22ae7707 ('IB/mlx5: Add support for GRE flow specification') Signed-off-by: Maor Gottlieb Reviewed-by: Ariel Levkovich Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 54a1a4d537be..3f4e43433361 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -2685,7 +2685,7 @@ static int parse_flow_attr(struct mlx5_core_dev *mdev, u32 *match_c, IPPROTO_GRE); MLX5_SET(fte_match_set_misc, misc_params_c, gre_protocol, - 0xffff); + ntohs(ib_spec->gre.mask.protocol)); MLX5_SET(fte_match_set_misc, misc_params_v, gre_protocol, ntohs(ib_spec->gre.val.protocol));