From patchwork Tue Jan 29 10:08:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10785921 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-2.web.codeaurora.org (Postfix) with ESMTP id 57F57922 for ; Tue, 29 Jan 2019 10:09:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A8712ABF2 for ; Tue, 29 Jan 2019 10:09:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EC912AC34; Tue, 29 Jan 2019 10:09:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D14A42ABF2 for ; Tue, 29 Jan 2019 10:09:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728265AbfA2KJO (ORCPT ); Tue, 29 Jan 2019 05:09:14 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36841 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbfA2KJO (ORCPT ); Tue, 29 Jan 2019 05:09:14 -0500 Received: by mail-wm1-f65.google.com with SMTP id p6so17023608wmc.1 for ; Tue, 29 Jan 2019 02:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HRMWeA2l+qszeu98AHI+YszS9XHZmYHRyq2cW6gzMOI=; b=OniHl5QqFJQkYr5+haSOD0rNNI05qqSeeMykwV71G0//2azpka+Fb9AcX0DQZ+QQlm 7XeIDrt8Qn5nr7X3tvoxAk7ud2lCtCqK5XD8x9GR0/klJHliopi/q/iW3jG17nEQYac3 GNJpXg8yvhDyW+R/ilqQ7qqVouNKD+CSTBImI3nYkywT1xLDHm/HV2flG/+vN9uzJ9vR FCV5oTtnI/LtonLoO/oxk7N3rfsTPzpy6eAXrIDTuXPdaBppv2XDhijoLBWCNF48cnNW AY07hZ/sfrtXlbpgnuH/8dkOVCRS/CiYiZOYbQoxvyH04bW//aDH6mFYZY8KXZ7Jkrcn k18g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HRMWeA2l+qszeu98AHI+YszS9XHZmYHRyq2cW6gzMOI=; b=brcymzTSM69Hbfv+Gq2EL1ZX+KgP+QghGnlb8kEGfCzJVqohXrPEhvuUuh6/G/+09m 1Obl0zqtxZNuLjA8zNq1wwQFWPz8a+Af6FMbMN3KaVNv8qlJCV+Nn29AeJpo0nTRivQe rbZfGC8IdjNm7xft9PtNpbI5GvvGMIYZtxMiZ+SA77ng+aAA/h/cbKqcM/npsAnDn7/8 PltoqqJpiVBmlNRAYOhnICwu1y4o9OO6h9tO3m4sQle9XIHFRjFNAI0ofKfv3bJ69Xoo jXz7D1RCv0Yvxp1/GmaSytCNVNF4oyUlaxP5hQLeiaCzTcacuac/yA9PNxE4pn/d6o66 gTjQ== X-Gm-Message-State: AJcUukcFLIwEP0V1N59/Jc8TFfkP9ZLxYegKSioGIbRR+SWH+3Bt7UHt xYiHUcgYdRPlDoWRMtGcHazNKPe3 X-Google-Smtp-Source: ALg8bN6KxM73Bf6vyy9jMeaMGh5JXLQs75PAOMKvNSKNVM6UaRlIg0ieYpzqZCpJ6HmkcyjTR9qR+Q== X-Received: by 2002:a1c:c90b:: with SMTP id f11mr20416638wmb.33.1548756552181; Tue, 29 Jan 2019 02:09:12 -0800 (PST) Received: from kheib-workstation.redhat.com ([192.116.94.216]) by smtp.gmail.com with ESMTPSA id q12sm103902903wrx.31.2019.01.29.02.09.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jan 2019 02:09:11 -0800 (PST) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, Yuval Shaia , Marcel Apfelbaum , Kamal Heib Subject: [PATCH rdma-next 1/2] RDMA/rxe: Move rxe_init_av() to rxe_av.c Date: Tue, 29 Jan 2019 12:08:49 +0200 Message-Id: <20190129100850.18840-2-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129100850.18840-1-kamalheib1@gmail.com> References: <20190129100850.18840-1-kamalheib1@gmail.com> MIME-Version: 1.0 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 Move the function rxe_init_av() to rxe_av.c file and use it instead of calling rxe_av_from_attr() and rxe_av_fill_ip_info(), also remove the unused rxe_dev parameter from rxe_init_av(). Signed-off-by: Kamal Heib Reviewed-by: Yuval Shaia Reviewed-by: Zhu Yanjun --- drivers/infiniband/sw/rxe/rxe_av.c | 6 ++++++ drivers/infiniband/sw/rxe/rxe_loc.h | 1 + drivers/infiniband/sw/rxe/rxe_qp.c | 7 ++----- drivers/infiniband/sw/rxe/rxe_verbs.c | 11 ++--------- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c index 26fe8d7dbc55..27a7dec18874 100644 --- a/drivers/infiniband/sw/rxe/rxe_av.c +++ b/drivers/infiniband/sw/rxe/rxe_av.c @@ -34,6 +34,12 @@ #include "rxe.h" #include "rxe_loc.h" +void rxe_init_av(struct rdma_ah_attr *attr, struct rxe_av *av) +{ + rxe_av_from_attr(rdma_ah_get_port_num(attr), av, attr); + rxe_av_fill_ip_info(av, attr); +} + int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr) { struct rxe_port *port; diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h index a65fbd0ff42e..b517a6c86922 100644 --- a/drivers/infiniband/sw/rxe/rxe_loc.h +++ b/drivers/infiniband/sw/rxe/rxe_loc.h @@ -35,6 +35,7 @@ #define RXE_LOC_H /* rxe_av.c */ +void rxe_init_av(struct rdma_ah_attr *attr, struct rxe_av *av); int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr); diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index fd86fd2fbb26..be5d76b2bcca 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -631,14 +631,11 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask, qp->attr.qkey = attr->qkey; if (mask & IB_QP_AV) { - rxe_av_from_attr(attr->port_num, &qp->pri_av, &attr->ah_attr); - rxe_av_fill_ip_info(&qp->pri_av, &attr->ah_attr); + rxe_init_av(&attr->ah_attr, &qp->pri_av); } if (mask & IB_QP_ALT_PATH) { - rxe_av_from_attr(attr->alt_port_num, &qp->alt_av, - &attr->alt_ah_attr); - rxe_av_fill_ip_info(&qp->alt_av, &attr->alt_ah_attr); + rxe_init_av(&attr->alt_ah_attr, &qp->alt_av); qp->attr.alt_port_num = attr->alt_port_num; qp->attr.alt_pkey_index = attr->alt_pkey_index; qp->attr.alt_timeout = attr->alt_timeout; diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index 3d01247a28db..cc5a05124ece 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -210,13 +210,6 @@ static int rxe_dealloc_pd(struct ib_pd *ibpd) return 0; } -static void rxe_init_av(struct rxe_dev *rxe, struct rdma_ah_attr *attr, - struct rxe_av *av) -{ - rxe_av_from_attr(rdma_ah_get_port_num(attr), av, attr); - rxe_av_fill_ip_info(av, attr); -} - static struct ib_ah *rxe_create_ah(struct ib_pd *ibpd, struct rdma_ah_attr *attr, u32 flags, @@ -239,7 +232,7 @@ static struct ib_ah *rxe_create_ah(struct ib_pd *ibpd, rxe_add_ref(pd); ah->pd = pd; - rxe_init_av(rxe, attr, &ah->av); + rxe_init_av(attr, &ah->av); return &ah->ibah; } @@ -253,7 +246,7 @@ static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr) if (err) return err; - rxe_init_av(rxe, attr, &ah->av); + rxe_init_av(attr, &ah->av); return 0; }