From patchwork Thu Jun 29 11:47:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9816495 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 A29036020A for ; Thu, 29 Jun 2017 11:47:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 969D227F54 for ; Thu, 29 Jun 2017 11:47:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AF5727FB3; Thu, 29 Jun 2017 11:47:47 +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 01E5027031 for ; Thu, 29 Jun 2017 11:47:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752645AbdF2Lrp (ORCPT ); Thu, 29 Jun 2017 07:47:45 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:60577 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752593AbdF2Lro (ORCPT ); Thu, 29 Jun 2017 07:47:44 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 29 Jun 2017 14:47:19 +0300 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 v5TBlJ7e017947; Thu, 29 Jun 2017 14:47:19 +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 v5TBlJXO017935; Thu, 29 Jun 2017 14:47:19 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v5TBlJMC017934; Thu, 29 Jun 2017 14:47:19 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, yishaih@mellanox.com, maorg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 3/7] mlx4: Convert datagram segment to use mlx4_av struct Date: Thu, 29 Jun 2017 14:47:04 +0300 Message-Id: <1498736828-17875-4-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1498736828-17875-1-git-send-email-yishaih@mellanox.com> References: <1498736828-17875-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 From: Maor Gottlieb The datagram segment struct contains array which represents the address vector, convert the array to mlx4_av. mlx4dv will use this struct in downstream patches. Signed-off-by: Maor Gottlieb Reviewed-by: Yishai Hadas --- providers/mlx4/mlx4.h | 13 ------------- providers/mlx4/mlx4dv.h | 15 ++++++++++++++- providers/mlx4/qp.c | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h index 8f0d6f2..bdb7f16 100644 --- a/providers/mlx4/mlx4.h +++ b/providers/mlx4/mlx4.h @@ -214,19 +214,6 @@ struct mlx4_qp { uint32_t qp_cap_cache; }; -struct mlx4_av { - uint32_t port_pd; - uint8_t reserved1; - uint8_t g_slid; - uint16_t dlid; - uint8_t reserved2; - uint8_t gid_index; - uint8_t stat_rate; - uint8_t hop_limit; - uint32_t sl_tclass_flowlabel; - uint8_t dgid[16]; -}; - struct mlx4_ah { struct ibv_ah ibv_ah; struct mlx4_av av; diff --git a/providers/mlx4/mlx4dv.h b/providers/mlx4/mlx4dv.h index e677fe1..7679ece 100644 --- a/providers/mlx4/mlx4dv.h +++ b/providers/mlx4/mlx4dv.h @@ -325,8 +325,21 @@ struct mlx4_wqe_ctrl_seg { uint32_t imm; }; +struct mlx4_av { + uint32_t port_pd; + uint8_t reserved1; + uint8_t g_slid; + uint16_t dlid; + uint8_t reserved2; + uint8_t gid_index; + uint8_t stat_rate; + uint8_t hop_limit; + uint32_t sl_tclass_flowlabel; + uint8_t dgid[16]; +}; + struct mlx4_wqe_datagram_seg { - uint32_t av[8]; + struct mlx4_av av; uint32_t dqpn; uint32_t qkey; uint16_t vlan; diff --git a/providers/mlx4/qp.c b/providers/mlx4/qp.c index b7e3669..1be100b 100644 --- a/providers/mlx4/qp.c +++ b/providers/mlx4/qp.c @@ -175,7 +175,7 @@ static void set_atomic_seg(struct mlx4_wqe_atomic_seg *aseg, struct ibv_send_wr static void set_datagram_seg(struct mlx4_wqe_datagram_seg *dseg, struct ibv_send_wr *wr) { - memcpy(dseg->av, &to_mah(wr->wr.ud.ah)->av, sizeof (struct mlx4_av)); + memcpy(&dseg->av, &to_mah(wr->wr.ud.ah)->av, sizeof (struct mlx4_av)); dseg->dqpn = htobe32(wr->wr.ud.remote_qpn); dseg->qkey = htobe32(wr->wr.ud.remote_qkey); dseg->vlan = htobe16(to_mah(wr->wr.ud.ah)->vlan);