From patchwork Fri Jul 3 15:34:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11642033 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 160F014B7 for ; Fri, 3 Jul 2020 15:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F13392168B for ; Fri, 3 Jul 2020 15:34:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jvJIbJKB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbgGCPe4 (ORCPT ); Fri, 3 Jul 2020 11:34:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbgGCPe4 (ORCPT ); Fri, 3 Jul 2020 11:34:56 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8B5CC061794 for ; Fri, 3 Jul 2020 08:34:55 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id j18so32406752wmi.3 for ; Fri, 03 Jul 2020 08:34:55 -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=jvJIbJKB6br84752kikUiyuoEh92TjCbmOb8RYFRgmFdrvpzHZMx1j+GHxUpCnPfK3 S2YPR1W/aPmLXWVT4Es0SMmtglgiMllbYCcoe+wlUc4EvNgeRyGi6JkFGwXbpMRbgGcw Ry/USL4gFug7wTP9PW2B47KoXn8/ts3f6C62OLKUvrEiREOMsu6nRKHKd1nAgS7By5Hc 6x7OTiZcTRFEBz1IcadUvhBudTygHBo45PS0Z08jzYqADDl7/Flj9HVrZ9OVcVixlkQf vlYgYq8fpAVwDn00eMxykbSZudb0gBsFTUBzRaPg5FyF8U+xuKTHYaaWktrlgXiUyi1r kFIQ== 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=CpqQaZVlKjk5TNH+T49BpzgBx3cNIZHGPJ4xD15V82LPvijzy3BTjS7sWncQ/Obk+b 89h1AT9B7s0bUsh3jkapXHUSqvE5TW18+xuUssjxjqQhOCQYx0oCM2+usC6e9XUHQ/gJ cSeedgm3XOBsZp5mP+eG0IdK4xFHsIgt2/N9hysrLkQTaQgdgNao5LhMVUOQzJ9EtkFR qPxhBSny6+nYbiCIY8fbpPHWXAqf+Qryk29bVLYErAPyt7ZBROo/fbrB1QXR0mSJQCgZ PHaj/HP9Ms3DWeNCeGL82XjQ3+l4kbP4vD6qBTBiOGIX2ZydOJ877+IQAtabhDdBfjpk L5Kw== X-Gm-Message-State: AOAM5334/K7nwWezETQpV53qd1ETBkwJuK45SAJhJ/s5qyOxL4I8pjpu iUQt1RPnG2OfEp94JX8XmVwQ4zWv99Y= X-Google-Smtp-Source: ABdhPJzMPC+bmVXUAWW9iHWgzJekX0TUZVkV3YeGZKVvgkvBm6QQxJsGRTmuCaBsbP/5nN9TaTf9TQ== X-Received: by 2002:a1c:e143:: with SMTP id y64mr6990347wmg.90.1593790494364; Fri, 03 Jul 2020 08:34:54 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id r1sm14083225wrt.73.2020.07.03.08.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 08:34:53 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next 1/4] RDMA/rxe: Drop pointless checks in rxe_init_ports Date: Fri, 3 Jul 2020 18:34:25 +0300 Message-Id: <20200703153428.173758-2-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200703153428.173758-1-kamalheib1@gmail.com> References: <20200703153428.173758-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 --- 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 Fri Jul 3 15:34:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11642035 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 5248D92A for ; Fri, 3 Jul 2020 15:34:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B4F821655 for ; Fri, 3 Jul 2020 15:34:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CopOW47T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbgGCPe5 (ORCPT ); Fri, 3 Jul 2020 11:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbgGCPe5 (ORCPT ); Fri, 3 Jul 2020 11:34:57 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02431C061794 for ; Fri, 3 Jul 2020 08:34:57 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id b6so33134329wrs.11 for ; Fri, 03 Jul 2020 08:34:56 -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=CopOW47TvX6BudpniLTjCodp761Bma1uzDBnBp4jViDdVvm2JOsM36NeNEM1wDMoUa 2VU66czMOOYDlWX1QJ18LiPAZgo8lxq/Q/taj3jxWOVmKnr2fbqbUgbxX5Zlbbw089BG IKK73U3tAlYxE//lvu2K6a758B1kBS/GXIhPiFDbYIlxqIkipGYzjjJjXwCsabK2TXUn fuQyZtmymT+Omkp8H8gnESyX42YnAKK1PHM2vrBGW4mDlZYJGPcb0xLreU5Jkm3D+xr+ GFDMq56MgaiZ2skWtwvhJ4NtehQjlou3Dcm3Rq3ezDlMebPeN3AVhWZ9mHPrSFA7vEhK jR3g== 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=qzokMf+RhJG7jN5hjrn3oPBInrf+dqs76dJHQTCCTGTBt5lmkl5RHlpjNi8XqU5EU7 fDyS7VIGHLmJYGd4r+ih3l/4bzMhmmo5w3MhAoTdcHBBcsWvDcyqtUL+Y2CgWhIHHz2R i3lHKsJebgBvtpDbvbr0ToGWHrNzlOqc4ikji83VnUZHyP+WRo6lJ/qycTCCU+yBblgh DDvgDS6F1RQltwnhGoTiopyTymqFoB4jIJp8NgOIV41TeRFAc5tW6tAaIlmwXRIeNV1b oz9TLWfCUPWTc9c8WTR7E3Wr76QbHlbGUp6m1HkFJd6ivLe/hBE5MHSIlIJb00LvIm+Q JoFQ== X-Gm-Message-State: AOAM531veJ8WRAXHQw6iWrmVmJ27ue/LdVVv5ZXCgDYwOM4/x402VYh0 tlJXPj1LsRI5iSPvKuICwehCleYGLZo= X-Google-Smtp-Source: ABdhPJy6tdzcrKvYMMNieg8Z8tW8UWTWUyFK3FGqpODuDUDVXpoioQ2ssoMpIYpFTwlNpwMdWM/AAQ== X-Received: by 2002:adf:db42:: with SMTP id f2mr37091629wrj.298.1593790495511; Fri, 03 Jul 2020 08:34:55 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id r1sm14083225wrt.73.2020.07.03.08.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 08:34:55 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next 2/4] RDMA/rxe: Return void from rxe_init_port_param() Date: Fri, 3 Jul 2020 18:34:26 +0300 Message-Id: <20200703153428.173758-3-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200703153428.173758-1-kamalheib1@gmail.com> References: <20200703153428.173758-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 --- 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 Fri Jul 3 15:34:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11642037 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 BADDA92A for ; Fri, 3 Jul 2020 15:34:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A320A21655 for ; Fri, 3 Jul 2020 15:34:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mpTCE4yi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726108AbgGCPe7 (ORCPT ); Fri, 3 Jul 2020 11:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbgGCPe6 (ORCPT ); Fri, 3 Jul 2020 11:34:58 -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 829B1C061794 for ; Fri, 3 Jul 2020 08:34:58 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id f139so34502948wmf.5 for ; Fri, 03 Jul 2020 08:34:58 -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=mpTCE4yiTGcsTci881sNV7IPrDBWtmTg25OAhK3M2BXENGHG9Mw3JLEjubsVTnGLbb C1FEay2jzKi+pQCdeEVjTlaWBuk7hGr5sc8uTqgdwGJNzL7ZbQX6z0WbALQSv8NNQdq9 SRjtNU7h5/7vt+gmQfkJ3sJR1C3P0njCi5bZhQfkEGwHdPX3GaOVSENRryxxUX/Cwzbg HC3JMiCVlIoFVog7WL/4uBFFuHfD1jyayVt27gABIFwfdezF9o6d8md749R0mhozUmmL PuYrX1FC5zJz96WJq/DK7OrFQlm+kSGGq4FiJ2FznHzas6DlcKxFtwFgt1wrSDeSdVnd 7EJQ== 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=siyIj0lohj5TJhKK7/FaQA9z4O7pKFrWUeAkdoS2TuRpqA202VrIatP6pdr2qvb7bG KiIxgY7PyplMij11TWw7u3orJ6CcHfMHPiAuez+N7PSK2OgFnrblCcfS8olzDmQHc0N4 nfG5YgHO/zaG4/rm8NrHOpYRl164WiwsK5zhAhT9W57XfJp4rk5+HXSyfLkP65KFTYYV MG9a6Za74clLRKmnd9qZ9zTukVUFhBtRMqgJ5o2PAJVSYFzOeU19M0pV+EAqsh0OB1sZ BMWkmdewlhV/QbCPw9mIwH54lVOqallgkYUjM0SWKd9hAasByvunIATJtlZIPW5cF7SO DHSw== X-Gm-Message-State: AOAM532FiM4sLfOdZI0+I+aSW0lbWw5F1YMht/Gvldvvwd8I2KrSSfPG BPWvij9c90GrJo+D5+gdeG/dGWfaw7g= X-Google-Smtp-Source: ABdhPJyn6iqU4+L9B+u57XEdst3lNCB2e9CW52QqP5bLCcEul+6fJqI/JL8dxZkn+LUoHm01Ce629Q== X-Received: by 2002:a1c:2349:: with SMTP id j70mr36463167wmj.22.1593790496764; Fri, 03 Jul 2020 08:34:56 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id r1sm14083225wrt.73.2020.07.03.08.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 08:34:56 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next 3/4] RDMA/rxe: Return void from rxe_mem_init_dma() Date: Fri, 3 Jul 2020 18:34:27 +0300 Message-Id: <20200703153428.173758-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200703153428.173758-1-kamalheib1@gmail.com> References: <20200703153428.173758-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 --- 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 Fri Jul 3 15:34:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11642039 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 EEBC692A for ; Fri, 3 Jul 2020 15:35:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7D5F21655 for ; Fri, 3 Jul 2020 15:35:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f7Uroghh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbgGCPfA (ORCPT ); Fri, 3 Jul 2020 11:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbgGCPe7 (ORCPT ); Fri, 3 Jul 2020 11:34:59 -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 715F8C061794 for ; Fri, 3 Jul 2020 08:34:59 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id f18so25089709wrs.0 for ; Fri, 03 Jul 2020 08:34:59 -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=vKlDWVh3bHr1994ByvjYs9iMM9C95SGF1qWy8EKhunc=; b=f7UroghhWjuTGQm6ronExmQGG3zWEYWIrse4V2fwyYXbxxjTmtPjEK+IAEi50Z6hCR WNJc9iaPnAA/5QrbkqLAs60GP7+FQmtTzxCFuSnKs/MH0G4IGeySJl43jzqSswv/6m1X VCu7nmzJs7rssDMHPyLptWeXKf+Fw+EOBn20AXzUfWpYoAyMeYgJrIvjDbISlVDEkRGY wsC0VF6Ia+qsJ2d+mzBLri5fnZCr0WazqSWN4nEiG0N8/JtLuovw0zYTrKRX2EkcJIl3 Uev/skaXk5xMISoih4NMAZNAapF6QhIrv/8MHZRP7+T5qZUaX4FCuU4F453hygZu/aZP 9omA== 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=vKlDWVh3bHr1994ByvjYs9iMM9C95SGF1qWy8EKhunc=; b=npOZrvBFkGIHGMwbnYj6oyWiZ6+5zVFCJrzYqvqgkkXP/GQ4CS2U7TV9Jz4QIRMfei iQgW9M8F9gFthv2pmTad/Z+7pemrxPn+2e3Sg3mpRFGUfuX6D7f2EWlPIQg2dsWtZZo+ YtMygfx6QHew4dBR/Y3tw5stRpveY8koe7aYVITMw+cSU1Dyzc74l0YbT3Q5gUr03PgL vqohGa4SoU82B64c5weTfOxyTeJ1mBHK0ksolRfi24j98OdrWaUea7nYzp7JGQoDYj4K TGSq9rjQEH+tMrIHJzf2MKt7oGNe1l1vEHZIuHt5XfPQqu+vXSbuU1zAH615D/O573AE 6M+A== X-Gm-Message-State: AOAM532OJUWhkOTDIX4tMbqYsVaiUy01l3KExh2Uo95R6a+id3E1JACe KrJuMolcIYR2dSJvXSViUhWSFmatPmE= X-Google-Smtp-Source: ABdhPJyj7DxLmSpoi8w0W9Csi6AWdCAlN2TXXLW2T2eSAsk9fJFTcCi6NO0JsfpPtm5dzzzT1sKp8A== X-Received: by 2002:adf:e948:: with SMTP id m8mr38352476wrn.398.1593790498023; Fri, 03 Jul 2020 08:34:58 -0700 (PDT) Received: from kheib-workstation.redhat.com ([37.142.6.100]) by smtp.gmail.com with ESMTPSA id r1sm14083225wrt.73.2020.07.03.08.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 08:34:57 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Zhu Yanjun , Kamal Heib Subject: [PATCH for-next 4/4] RDMA/rxe: Remove rxe_link_layer() Date: Fri, 3 Jul 2020 18:34:28 +0300 Message-Id: <20200703153428.173758-5-kamalheib1@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200703153428.173758-1-kamalheib1@gmail.com> References: <20200703153428.173758-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 return 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 --- 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)