From patchwork Wed Mar 11 04:56:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Somnath Kotur X-Patchwork-Id: 5977551 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 46907BF6C3 for ; Tue, 10 Mar 2015 12:32:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 625B02021F for ; Tue, 10 Mar 2015 12:32:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72C2D20219 for ; Tue, 10 Mar 2015 12:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbbCJMbe (ORCPT ); Tue, 10 Mar 2015 08:31:34 -0400 Received: from cmexedge2.emulex.com ([138.239.224.100]:30512 "EHLO CMEXEDGE2.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752781AbbCJMbe (ORCPT ); Tue, 10 Mar 2015 08:31:34 -0400 Received: from CMEXHTCAS2.ad.emulex.com (138.239.115.218) by CMEXEDGE2.ext.emulex.com (138.239.224.100) with Microsoft SMTP Server (TLS) id 14.3.210.2; Tue, 10 Mar 2015 05:31:38 -0700 Received: from codebrowse.emulex.com (10.192.207.129) by smtp.emulex.com (138.239.115.208) with Microsoft SMTP Server id 14.3.210.2; Tue, 10 Mar 2015 05:31:30 -0700 From: Somnath Kotur To: CC: , Maor Gottlieb , "Somnath Kotur" Subject: [PATCH v2 for-next 28/32] net/mlx4_core: Add handling of R-RoCE over IPV4 in qp attach flow Date: Wed, 11 Mar 2015 10:26:20 +0530 X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1426049785-30364-1-git-send-email-somnath.kotur@emulex.com> References: <1426049785-30364-1-git-send-email-somnath.kotur@emulex.com> MIME-Version: 1.0 Message-ID: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_12_24, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maor Gottlieb In that case, the IPv4 bit should be enabled in the IB flow spec. Signed-off-by: Maor Gottlieb Signed-off-by: Somnath Kotur --- drivers/net/ethernet/mellanox/mlx4/mcg.c | 14 ++++++++++++-- include/linux/mlx4/device.h | 6 ++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index a3867e7..cdf07b9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c @@ -858,7 +858,9 @@ static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec, break; case MLX4_NET_TRANS_RULE_ID_IB: - rule_hw->ib.l3_qpn = spec->ib.l3_qpn; + rule_hw->ib.l3_qpn = spec->ib.l3_qpn | + (spec->ib.roce_type == MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV4 ? + 0x80 : 0); rule_hw->ib.qpn_mask = spec->ib.qpn_msk; memcpy(&rule_hw->ib.dst_gid, &spec->ib.dst_gid, 16); memcpy(&rule_hw->ib.dst_gid_msk, &spec->ib.dst_gid_msk, 16); @@ -1377,10 +1379,18 @@ int mlx4_trans_to_dmfs_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, memcpy(spec.eth.dst_mac_msk, &mac_mask, ETH_ALEN); break; + case MLX4_PROT_IB_IPV4: + spec.id = MLX4_NET_TRANS_RULE_ID_IB; + memcpy(spec.ib.dst_gid + 12, gid + 12, 4); + memset(spec.ib.dst_gid_msk + 12, 0xff, 4); + spec.ib.roce_type = MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV4; + + break; case MLX4_PROT_IB_IPV6: spec.id = MLX4_NET_TRANS_RULE_ID_IB; memcpy(spec.ib.dst_gid, gid, 16); - memset(&spec.ib.dst_gid_msk, 0xff, 16); + memset(spec.ib.dst_gid_msk, 0xff, 16); + spec.ib.roce_type = MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV6; break; default: return -EINVAL; diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index dd1488c..58b0b8c 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -369,6 +369,11 @@ enum mlx4_protocol { MLX4_PROT_FCOE }; +enum mlx4_flow_roce_type { + MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV6 = 0, + MLX4_FLOW_SPEC_IB_ROCE_TYPE_IPV4 +}; + enum { MLX4_MTT_FLAG_PRESENT = 1 }; @@ -1096,6 +1101,7 @@ struct mlx4_spec_ipv4 { struct mlx4_spec_ib { __be32 l3_qpn; __be32 qpn_msk; + enum mlx4_flow_roce_type roce_type; u8 dst_gid[16]; u8 dst_gid_msk[16]; };