From patchwork Sun Jul 5 10:43:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11644319 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB6D3618 for ; Sun, 5 Jul 2020 10:43:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2DFC2075B for ; Sun, 5 Jul 2020 10:43:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sjc8S7xe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726540AbgGEKnb (ORCPT ); Sun, 5 Jul 2020 06:43:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbgGEKna (ORCPT ); Sun, 5 Jul 2020 06:43:30 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C2A3C061794 for ; Sun, 5 Jul 2020 03:43:30 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id s10so37618108wrw.12 for ; Sun, 05 Jul 2020 03:43:30 -0700 (PDT) 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=Vfq+dt2Ndtwz+iv8SBbAEN0bU6YUaM+BMcTgsk78z2I=; b=sjc8S7xepNktrmWUleqyeqSjq4Khe3HLVtA9JQ7qw4kqdhuQotP+FI1TyduTpm6qSL jH9iYyWYVLnxvbEY295uVAA7kq+r++fJTGWo3IaGQaAPSf7oOzBXwmrKlCgw5WbbF4uu qqF+N9kfQV/3v42IBtABZNMtNh0KGd4XGE7bnUk6ArYRyW/hFfmscHZ12TuOJ0iePMwo mgHVTLhRdIV2+M5BJhKp6TW1RjAf5HmQN8mhB8eNDDzbJnTqjJIbIKszZW9ptYLhwC3J q7BnPoxhOgCyDyXsjExlls9kg8e+JtE5kX2iRH9iVK3gwpqfdYbBpilDjZylXXi4lgfi UVEA== 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=Vfq+dt2Ndtwz+iv8SBbAEN0bU6YUaM+BMcTgsk78z2I=; b=P0b6i2nKH8BOmo13FAfRJfjFk/kdOz1LE7V3b3+lzuH9OYW20p1EnhtWtjAEeb2bEL Gz+ZMugvLqPfdW12fdmvELSLYnjlitkID5hRNcMsFjHfDcwucoMEh8fS6Ol75fZYNHuz MrxePIc15fcYyqZAmzZIIFPxDIlbF1o4ezEhvJ6kT1LAuj34PvAXASkyJomzy8IQnbhm eooBjVaqbEUvPb+piItcyMzqLGciywG/xHtAVMzzCvxG+pyAt4f7X73SP9U4KDvzQ6MW 9QY8d1dtdI+06m+YQBHSWoMtbFzb4ZiFHTWHSjQRAH+1Pwwwo1WTt/AulnNtmCAkc6dL Codg== X-Gm-Message-State: AOAM533oK5MX+iVCYc1bWUcJXt6FUI4xVd5f7VQMMJPBCnarhgoNCzEK QT+t0hreVf6x+CdzlfwxlWDkjKzHdFM= X-Google-Smtp-Source: ABdhPJwIeqSl0IEoYVgW6noQtGrUHyz0F5algDZjhCgCDGezC0w8zAlQPakueI0ZfS3Tx2HWBdbXYQ== X-Received: by 2002:adf:e90d:: with SMTP id f13mr41587608wrm.146.1593945808981; Sun, 05 Jul 2020 03:43:28 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id 51sm14828083wrc.44.2020.07.05.03.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 03:43:28 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next v1 1/4] RDMA/rxe: Drop pointless checks in rxe_init_ports Date: Sun, 5 Jul 2020 13:43:10 +0300 Message-Id: <20200705104313.283034-2-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200705104313.283034-1-kamalheib1@gmail.com> References: <20200705104313.283034-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 Both pkey_tbl_len and gid_tbl_len are set in rxe_init_port_param() - so no need to check if they aren't set. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky --- drivers/infiniband/sw/rxe/rxe.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c index 5642eefb4ba1..c7191b5e04a5 100644 --- a/drivers/infiniband/sw/rxe/rxe.c +++ b/drivers/infiniband/sw/rxe/rxe.c @@ -147,9 +147,6 @@ static int rxe_init_ports(struct rxe_dev *rxe) rxe_init_port_param(port); - if (!port->attr.pkey_tbl_len || !port->attr.gid_tbl_len) - return -EINVAL; - port->pkey_tbl = kcalloc(port->attr.pkey_tbl_len, sizeof(*port->pkey_tbl), GFP_KERNEL); From patchwork Sun Jul 5 10:43:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11644321 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31416618 for ; Sun, 5 Jul 2020 10:43:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 186B62075B for ; Sun, 5 Jul 2020 10:43:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V1l2gNkS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgGEKnc (ORCPT ); Sun, 5 Jul 2020 06:43:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbgGEKnb (ORCPT ); Sun, 5 Jul 2020 06:43:31 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED3FC061794 for ; Sun, 5 Jul 2020 03:43:31 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id o8so36138372wmh.4 for ; Sun, 05 Jul 2020 03:43:31 -0700 (PDT) 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=q18ny4pd+jJoQXx48Q/P7hV6NnilQDPJdxj2j+rR6u4=; b=V1l2gNkSFUdm071Mv55emVv6SuAKfv2/smjSnROttKeSgMiAVHYTdcyiL8SdPBUrja BO47kObBpdkrefl9ZM4Vfyj58xUsOxTzt0uYdDNBhp2Jn/3Q+mlEktDMclhWw91um9kr ZU7pxdLg9zqONt4ZEDSdxoquaxERTPKX82QiKBufO0CM/fPTUa/qdRnKNC957caqsZPK e0znKWHU/PNslP3xoFttFbopqccAPfC+5/F8anxLuB+4NJ5ldCkO4EjiPFItK98EMamo efGeYO8HCe4b8xFmKvWENq9gih64ACVu5SQ3DI3l/j2/sRtcSCOsPsZaJSQak/APP0Gw cusQ== 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=q18ny4pd+jJoQXx48Q/P7hV6NnilQDPJdxj2j+rR6u4=; b=aL+Mczn3Lm2LduSvFVoi3NC8ohhhu7mK08OP+jghlbyou6afJYsV1qvFwysX2IDTRo /RoqMX/1e4Lu9NZxkcwk1OfuyKtat5bkuVmHm01e+XPSN8011FV0Bm14tNzdWODu+CtQ 7en7CVWmwmbLQdtbJPJykXOxM8cFiU2Y3lWq6FotrRw4QgObkL7qQq4dSk7vmZz/jFAw dD0CGP8IO7rzG5dfT+9i1HZXS5CWQYkbgl4IqyQA+HjayjnpChzh/Hz2Qz+Nj47eqrvs nzRe0WxkY4aRP3ubknpxcKhocyHjk9R7+tLd64IF4sbVsfX2odQws1Ua/rQApDNoFVSm ij1A== X-Gm-Message-State: AOAM531eWTc0vwjqQbGWg2yaLLEFOQbF9qAH0Nexne3aLM4oo/1UG7VT 6hgj3nUolps2GV1V3x2SE8pVeDNe/E0= X-Google-Smtp-Source: ABdhPJz4bsmlxOliNayMSv4qLMi1kCMdouViKfqa2fW6nETYrt7/RwuSJC4cSDmPf2g8D/FarNsjEA== X-Received: by 2002:a1c:4444:: with SMTP id r65mr42703827wma.129.1593945810182; Sun, 05 Jul 2020 03:43:30 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id 51sm14828083wrc.44.2020.07.05.03.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 03:43:29 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next v1 2/4] RDMA/rxe: Return void from rxe_init_port_param() Date: Sun, 5 Jul 2020 13:43:11 +0300 Message-Id: <20200705104313.283034-3-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200705104313.283034-1-kamalheib1@gmail.com> References: <20200705104313.283034-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 The return value from rxe_init_port_param() is always 0 - change it to be void. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky --- drivers/infiniband/sw/rxe/rxe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c index c7191b5e04a5..efcb72c92be6 100644 --- a/drivers/infiniband/sw/rxe/rxe.c +++ b/drivers/infiniband/sw/rxe/rxe.c @@ -111,7 +111,7 @@ static void rxe_init_device_param(struct rxe_dev *rxe) } /* initialize port attributes */ -static int rxe_init_port_param(struct rxe_port *port) +static void rxe_init_port_param(struct rxe_port *port) { port->attr.state = IB_PORT_DOWN; port->attr.max_mtu = IB_MTU_4096; @@ -134,8 +134,6 @@ static int rxe_init_port_param(struct rxe_port *port) port->attr.phys_state = RXE_PORT_PHYS_STATE; port->mtu_cap = ib_mtu_enum_to_int(IB_MTU_256); port->subnet_prefix = cpu_to_be64(RXE_PORT_SUBNET_PREFIX); - - return 0; } /* initialize port state, note IB convention that HCA ports are always From patchwork Sun Jul 5 10:43:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11644323 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E2FB618 for ; Sun, 5 Jul 2020 10:43:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76FA22075D for ; Sun, 5 Jul 2020 10:43:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="R1tmn8dO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726662AbgGEKnd (ORCPT ); Sun, 5 Jul 2020 06:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbgGEKnd (ORCPT ); Sun, 5 Jul 2020 06:43:33 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0FE4C061794 for ; Sun, 5 Jul 2020 03:43:32 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id b6so37640535wrs.11 for ; Sun, 05 Jul 2020 03:43:32 -0700 (PDT) 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=wAGRW9RG5J5eOxJ/N27IiokN4JQ6OOliqfQ8Tu8usyg=; b=R1tmn8dOwQ6tFpBOkczeoP7+R2d9Y9I0FLaWlWM0RlQtoJrvXYXZyxuUXXg4ytghhl J7BzJ9dbcKFfjaimZ9kvEC3e/IeN0A7/sKvxjj4GSE5McNQtUQNKH5CSDV2DyRiAjYgs XPkN5JZDn6xERvrJW2ZMIebG/0eXBvj7nfqyKRiMcDaWBMFSBmr/t7pZQXj4x7deM0CY uSuLZxk7Ur1d2aHnrA9iDyUszfO9tvDDw4SJUyilrFpZpQnHmzfEIIbIfkgCGAVPMtkR BgzifiwvWLpmSOSnFGVq7kcPXyu/khqJv9AsBWf8EQCLNQ9j0t48B8obtqtva0jAFlL3 piPQ== 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=wAGRW9RG5J5eOxJ/N27IiokN4JQ6OOliqfQ8Tu8usyg=; b=sn7Az+lDi+PJ+HteaZxQS4I3Sihn8jVBNBxcHtinlIUIGZ864pD0Pw8pgJth8bf01Q kl1MLrGwOAeG67Y2n+BC7VgFIvNzvDtpRdYrlV7Tis3GJUIIp++7SxznUnHEkfcM9eZd yEALaVVUL8Jwd+OMnuS85tVs1ndbqFLQYbKzgX4r0Ju8L1vD87XIzdqVIO9OWGUkIBBH OxyFN4NaiGr7yYWd1fStUmF/SKzOxLLmYeqkVXEo9m/58wclEUxIdd69VBIsTIL+9zP6 5QkmxWIZv5LlxEihZvGocrafnt8y4/lJ/WVUqQFSot11dYNqFRR7uDJhbFAFxOAARyaq 3lug== X-Gm-Message-State: AOAM533QrCBY8WYMsiEjQ53VV7+wg6r3cNRbvpkgHychG95GQ9/Urtr6 QOhSrsyZHb7lTiv68nbXb503KRdowp0= X-Google-Smtp-Source: ABdhPJxTDZeXy8B39nPwYXo5lR6mLMWzyPC8D4vYFXT1T3aBjQo10Rw45DQ9t6CTZegZtg0lix3gHA== X-Received: by 2002:adf:b312:: with SMTP id j18mr41452490wrd.195.1593945811491; Sun, 05 Jul 2020 03:43:31 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id 51sm14828083wrc.44.2020.07.05.03.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 03:43:30 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next v1 3/4] RDMA/rxe: Return void from rxe_mem_init_dma() Date: Sun, 5 Jul 2020 13:43:12 +0300 Message-Id: <20200705104313.283034-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200705104313.283034-1-kamalheib1@gmail.com> References: <20200705104313.283034-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 The return value from rxe_mem_init_dma() is always 0 - change it to be void and fix the callers accordingly. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky --- drivers/infiniband/sw/rxe/rxe_loc.h | 4 ++-- drivers/infiniband/sw/rxe/rxe_mr.c | 6 ++---- drivers/infiniband/sw/rxe/rxe_verbs.c | 20 +++----------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h index 238d6a357aac..0688928cf2b1 100644 --- a/drivers/infiniband/sw/rxe/rxe_loc.h +++ b/drivers/infiniband/sw/rxe/rxe_loc.h @@ -103,8 +103,8 @@ enum copy_direction { from_mem_obj, }; -int rxe_mem_init_dma(struct rxe_pd *pd, - int access, struct rxe_mem *mem); +void rxe_mem_init_dma(struct rxe_pd *pd, + int access, struct rxe_mem *mem); int rxe_mem_init_user(struct rxe_pd *pd, u64 start, u64 length, u64 iova, int access, struct ib_udata *udata, diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index a63cb5fac01f..cdd811a45120 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -144,8 +144,8 @@ static int rxe_mem_alloc(struct rxe_mem *mem, int num_buf) return -ENOMEM; } -int rxe_mem_init_dma(struct rxe_pd *pd, - int access, struct rxe_mem *mem) +void rxe_mem_init_dma(struct rxe_pd *pd, + int access, struct rxe_mem *mem) { rxe_mem_init(access, mem); @@ -153,8 +153,6 @@ int rxe_mem_init_dma(struct rxe_pd *pd, mem->access = access; mem->state = RXE_MEM_STATE_VALID; mem->type = RXE_MEM_TYPE_DMA; - - return 0; } int rxe_mem_init_user(struct rxe_pd *pd, u64 start, diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index b8a22af724e8..ee80b8862db8 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -901,30 +901,16 @@ static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access) struct rxe_dev *rxe = to_rdev(ibpd->device); struct rxe_pd *pd = to_rpd(ibpd); struct rxe_mem *mr; - int err; mr = rxe_alloc(&rxe->mr_pool); - if (!mr) { - err = -ENOMEM; - goto err1; - } + if (!mr) + return ERR_PTR(-ENOMEM); rxe_add_index(mr); - rxe_add_ref(pd); - - err = rxe_mem_init_dma(pd, access, mr); - if (err) - goto err2; + rxe_mem_init_dma(pd, access, mr); return &mr->ibmr; - -err2: - rxe_drop_ref(pd); - rxe_drop_index(mr); - rxe_drop_ref(mr); -err1: - return ERR_PTR(err); } static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, From patchwork Sun Jul 5 10:43:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11644325 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA926618 for ; Sun, 5 Jul 2020 10:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 929EF2075D for ; Sun, 5 Jul 2020 10:43:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tgdcPh3L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbgGEKnf (ORCPT ); Sun, 5 Jul 2020 06:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbgGEKne (ORCPT ); Sun, 5 Jul 2020 06:43:34 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E62C061794 for ; Sun, 5 Jul 2020 03:43:34 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id g75so36139380wme.5 for ; Sun, 05 Jul 2020 03:43:34 -0700 (PDT) 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=X3yQZiHbkQ7MpMtQaZKlRpcknRq/3peMVAfQV2P504A=; b=tgdcPh3LUZCuUnSlO8k/idQB/S+q/nV3dEMibt5O7mxAEhF2PPR7svuVGdcZ2EVN6H Y6FiDSf6i7CJTExmXtGgjAc4/Ge2BEWNQShxq38VB8BScYnN1rEqzSDzMkk9ij8JQkjv BYa+GYQVTJITz4xS/C8gFPn/1tLet7pKX37ZDbOJ9HSgGCu7p2tpaZPqUh8T2ClnHBtM 0D/36yY6CI8nLtg0MEvVyLJEogEpmmP9gxiFB488Ky3Ywu81rl2sdLruac7G64zbVpp8 4DVTo156ax3W6wfc7lMDJWGxA1uRI0tTYOhGudnZfvt/yr6MTONiHlEX9vQaM8mfLBJZ RkAQ== 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=X3yQZiHbkQ7MpMtQaZKlRpcknRq/3peMVAfQV2P504A=; b=Rxd83XDJLJhBjF/iY0SHowlr/oidPGZacYzuW+YsHBUUK6QpL6Q6HU7V+nCDR3jHSW TTE4MVbAwkp9QUgJm2pdXjhPyJeKiaKLc87zoPYGwNTlXNUCCmhkQ+l88LKMQntMfTwf 7/Ig7DjrqINEGXn5OKxKIW1o+3NRH1DvzpBYT3ueyp5z8fTOMeRm7J8Pn0HhgZ9aDYm7 0vMWQyTzR+hIUFVRCuThR6ImsAT3arEGNnArKB+40bTcBLvSOwq7qE1X3v6GbnLGq2hg +/jwYQthxSbaVi18hPcO0noFyhIfzN8PjZwFiEf1tjGMvj+3jcZSs49CsccqkxFRqPby hFfg== X-Gm-Message-State: AOAM533X3qr3D9SkmdKxYWhF808BWo9WzSk44k8RHHYRtiNA2fYYYJnr MfmxvZhsnjCohWoyoYuxGJlqnviDki4= X-Google-Smtp-Source: ABdhPJwvS2gwvxg5V1PbWzTlD2m/c9xkrPydMUrGPZ4BjfUPh9H1fmjY/2AlOdV2Ng6MqQ1e0sobGQ== X-Received: by 2002:a1c:7315:: with SMTP id d21mr18950782wmb.108.1593945812774; Sun, 05 Jul 2020 03:43:32 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id 51sm14828083wrc.44.2020.07.05.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 03:43:32 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next v1 4/4] RDMA/rxe: Remove rxe_link_layer() Date: Sun, 5 Jul 2020 13:43:13 +0300 Message-Id: <20200705104313.283034-5-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200705104313.283034-1-kamalheib1@gmail.com> References: <20200705104313.283034-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 Instead of returning IB_LINK_LAYER_ETHERNET from rxe_link_layer, return it directly from get_link_layer callback and remove rxe_link_layer(). Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky --- drivers/infiniband/sw/rxe/rxe_loc.h | 1 - drivers/infiniband/sw/rxe/rxe_net.c | 5 ----- drivers/infiniband/sw/rxe/rxe_verbs.c | 4 +--- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h index 0688928cf2b1..39dc3bfa5d5d 100644 --- a/drivers/infiniband/sw/rxe/rxe_loc.h +++ b/drivers/infiniband/sw/rxe/rxe_loc.h @@ -142,7 +142,6 @@ int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb); struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av, int paylen, struct rxe_pkt_info *pkt); int rxe_prepare(struct rxe_pkt_info *pkt, struct sk_buff *skb, u32 *crc); -enum rdma_link_layer rxe_link_layer(struct rxe_dev *rxe, unsigned int port_num); const char *rxe_parent_name(struct rxe_dev *rxe, unsigned int port_num); struct device *rxe_dma_device(struct rxe_dev *rxe); int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid); diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 312c2fc961c0..0c3808611f95 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -520,11 +520,6 @@ const char *rxe_parent_name(struct rxe_dev *rxe, unsigned int port_num) return rxe->ndev->name; } -enum rdma_link_layer rxe_link_layer(struct rxe_dev *rxe, unsigned int port_num) -{ - return IB_LINK_LAYER_ETHERNET; -} - int rxe_net_add(const char *ibdev_name, struct net_device *ndev) { int err; diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index ee80b8862db8..a3cf9bbe818d 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -141,9 +141,7 @@ static int rxe_modify_port(struct ib_device *dev, static enum rdma_link_layer rxe_get_link_layer(struct ib_device *dev, u8 port_num) { - struct rxe_dev *rxe = to_rdev(dev); - - return rxe_link_layer(rxe, port_num); + return IB_LINK_LAYER_ETHERNET; } static int rxe_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)