From patchwork Sun Oct 20 07:15:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11200611 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 AE379913 for ; Sun, 20 Oct 2019 07:16:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84348222CD for ; Sun, 20 Oct 2019 07:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555770; bh=c8DkaVOwNHnbKep2BOZr3O+xhfOOzfhqoXkfjzWZXEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dNBjM5Df0Jx/dp1dWeRG9P52PBaOG/RJfZPaN1WL7vJJvaR7aOzaI1D1XNL4DvpQV 3QLOxISNQeKMi3FyZWsEA1mR1PVpxIqjEJFrWD/UHJkX6kk2/fNgIhcLnZTsf8UjTT FAdzQ00bl3YI7DwmmM6xvesHyWuQVIvzUAoqsYTs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726194AbfJTHQI (ORCPT ); Sun, 20 Oct 2019 03:16:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:34278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfJTHQI (ORCPT ); Sun, 20 Oct 2019 03:16:08 -0400 Received: from localhost (unknown [77.137.89.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 646C321D80; Sun, 20 Oct 2019 07:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555768; bh=c8DkaVOwNHnbKep2BOZr3O+xhfOOzfhqoXkfjzWZXEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aQ3TAKBizZKLoCeZfnax8fO9xWJwzK7IF5ijXnMYYgtnPugMYbE+jnOq+1BuigWSZ w1VEUpKUBLrNhgRoRSmd+b33wzBJbWUD59E/31bSrIBiWFE/vcJAsirnsWRpZ2epxs a2OIJWrzyYubi/0FSSVKxm0zIN/eORggx2cyGdjM= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Bart Van Assche Subject: [PATCH rdma-next 1/6] RDMA/cm: Delete unused cm_is_active_peer function Date: Sun, 20 Oct 2019 10:15:54 +0300 Message-Id: <20191020071559.9743-2-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191020071559.9743-1-leon@kernel.org> References: <20191020071559.9743-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky Function cm_is_active_peer is not used, delete it. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index c0aa3a4b4cfd..bc4abb05dbd4 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1525,14 +1525,6 @@ static int cm_issue_rej(struct cm_port *port, return ret; } -static inline int cm_is_active_peer(__be64 local_ca_guid, __be64 remote_ca_guid, - __be32 local_qpn, __be32 remote_qpn) -{ - return (be64_to_cpu(local_ca_guid) > be64_to_cpu(remote_ca_guid) || - ((local_ca_guid == remote_ca_guid) && - (be32_to_cpu(local_qpn) > be32_to_cpu(remote_qpn)))); -} - static bool cm_req_has_alt_path(struct cm_req_msg *req_msg) { return ((req_msg->alt_local_lid) || From patchwork Sun Oct 20 07:15:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11200613 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 17BEA13B1 for ; Sun, 20 Oct 2019 07:16:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB79B222D0 for ; Sun, 20 Oct 2019 07:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555773; bh=z3fgPrxRL2hl1SSlqBetc7WaCtjnugbXR7ex5JgOCic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xlny38GuwbiHpkLPLiFOeHcc9PkWNJYCHbN0h6+0U+FwyLbtk4KMr7nVgws/yq61B BtzMfX0ujFtQU+milIWOz4mua5l40XJMUcMZOGkFMooaWl2MvnDju5lj+uP3SROSo4 hg9yQ8eVWUjCBDonGOeE8vQjSpnh753pGH+38a+c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726204AbfJTHQM (ORCPT ); Sun, 20 Oct 2019 03:16:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:34334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfJTHQM (ORCPT ); Sun, 20 Oct 2019 03:16:12 -0400 Received: from localhost (unknown [77.137.89.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F2201222C3; Sun, 20 Oct 2019 07:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555771; bh=z3fgPrxRL2hl1SSlqBetc7WaCtjnugbXR7ex5JgOCic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MIeh0BDyZS7MD9TGg7a+LwhDywXaGCOn0B3jx0hXbjZN19a/nrRzHJdRUQCrdU8co Lxr0FTSXlCMtI7y9/a+U9IbwfbnZYS6MnycArYmE46x7oC9zIpqBNY0xipeePf4dJl 1fQO9qIEjl5+44diiKQDecOJWVm66BW8gclOIihM= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Bart Van Assche Subject: [PATCH rdma-next 2/6] RDMA/cm: Use specific keyword to check define Date: Sun, 20 Oct 2019 10:15:55 +0300 Message-Id: <20191020071559.9743-3-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191020071559.9743-1-leon@kernel.org> References: <20191020071559.9743-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky There is a specific define keyword to check if define exists or not, let's use it instead of open-coded variant. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm_msgs.h | 2 +- include/rdma/ib_cm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index 3d16d614aff6..0a9e2d3fb9df 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h @@ -31,7 +31,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS THE * SOFTWARE. */ -#if !defined(CM_MSGS_H) +#ifndef CM_MSGS_H #define CM_MSGS_H #include diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 49f4f75499b3..5dc4ec986527 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h @@ -32,7 +32,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#if !defined(IB_CM_H) +#ifndef IB_CM_H #define IB_CM_H #include From patchwork Sun Oct 20 07:15:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11200615 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 C300F13B1 for ; Sun, 20 Oct 2019 07:16:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98B7721744 for ; Sun, 20 Oct 2019 07:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555777; bh=56HK1mo82DeG2J/qGurr1vYvzgbQ5n7MGWLzn96Lv4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ip2Shb0lIdfVTbvdl9rN2fIS+G7QID6OpXZXPdhF/RuCExCvVNfvkPfrHns6R8nwl /pEgWlq1OrxJX5GWQOdhRnZp1g9nZAqQOUk02mJGg+tXvmJikPHOqEVFMJeAec0qCf YyxRGLm1n2K5+s1La6JYDugvq6J8tBZ1+QKl0ZWo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726205AbfJTHQR (ORCPT ); Sun, 20 Oct 2019 03:16:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:34386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfJTHQQ (ORCPT ); Sun, 20 Oct 2019 03:16:16 -0400 Received: from localhost (unknown [77.137.89.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C7C8222CD; Sun, 20 Oct 2019 07:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555775; bh=56HK1mo82DeG2J/qGurr1vYvzgbQ5n7MGWLzn96Lv4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DbcvYanRjD7/tA8ywu2jqBVYDBGzTQ40Ub9THThdW2eju2pXQuklsUYGgBpSyQnvy XkoPPNtm3puwWO07EWiSuacF+e5oIHikShJRQI1tcZAHBVTQzzVCuREJJ25SpjU27y aoArTa8WurWU2WPjmv5ARD29aPO7SnnpLi0y4Xbo= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Bart Van Assche Subject: [PATCH rdma-next 3/6] RDMA/cm: Update copyright together with SPDX tag Date: Sun, 20 Oct 2019 10:15:56 +0300 Message-Id: <20191020071559.9743-4-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191020071559.9743-1-leon@kernel.org> References: <20191020071559.9743-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky Add Mellanox to lust of copyright holders and replace copyright boilerplate with relevant SPDX tag. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm.c | 30 ++---------------------------- drivers/infiniband/core/cm_msgs.h | 30 ++---------------------------- drivers/infiniband/core/cma.c | 31 ++----------------------------- include/rdma/ib_cm.h | 30 ++---------------------------- 4 files changed, 8 insertions(+), 113 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index bc4abb05dbd4..7ffa16ea5fe3 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1,36 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* * Copyright (c) 2004-2007 Intel Corporation. All rights reserved. * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2004, 2005 Voltaire Corporation. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2019, Mellanox Technologies inc. All rights reserved. */ #include diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index 0a9e2d3fb9df..92d7260ac913 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h @@ -1,35 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* * Copyright (c) 2004, 2011 Intel Corporation. All rights reserved. * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2004 Voltaire Corporation. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING the madirectory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use source and binary forms, with or - * withmodification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retathe above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHWARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS THE - * SOFTWARE. + * Copyright (c) 2019, Mellanox Technologies inc. All rights reserved. */ #ifndef CM_MSGS_H #define CM_MSGS_H diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index c8566a423719..8f318928f29d 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -1,36 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* * Copyright (c) 2005 Voltaire Inc. All rights reserved. * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. - * Copyright (c) 1999-2005, Mellanox Technologies, Inc. All rights reserved. + * Copyright (c) 1999-2019, Mellanox Technologies, Inc. All rights reserved. * Copyright (c) 2005-2006 Intel Corporation. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 5dc4ec986527..b01a8a8d4de9 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h @@ -1,36 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2004 Voltaire Corporation. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2019, Mellanox Technologies inc. All rights reserved. */ #ifndef IB_CM_H #define IB_CM_H From patchwork Sun Oct 20 07:15:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11200621 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 130E413B1 for ; Sun, 20 Oct 2019 07:16:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD18D222C3 for ; Sun, 20 Oct 2019 07:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555787; bh=G3FnwL06XEW9KDbgsdP5+Z+/JB+Jcp8oSyvgDANAUA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IfzB4Ax8DUn/3vbMsOnRk4QqKC7MUqtGRz4l3k3w1amxiGaI5rudzkor+6+KiXfEx ms3W5ItfanzEMF3Ko+CnTKXfTp4GB4UTHJaqPoDRxBwHg42wTBHDBPVWi9s4qB0n/d 9PrBwhOadLG6xz0Kg1Kb2VFB1Y8foT1CAXeMYqj4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726217AbfJTHQ0 (ORCPT ); Sun, 20 Oct 2019 03:16:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:34472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfJTHQ0 (ORCPT ); Sun, 20 Oct 2019 03:16:26 -0400 Received: from localhost (unknown [77.137.89.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 200E821744; Sun, 20 Oct 2019 07:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555785; bh=G3FnwL06XEW9KDbgsdP5+Z+/JB+Jcp8oSyvgDANAUA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=enLUJDIL0sVcxOR0/PUgzbxzxlZyjARTdqinK0k0Nnb1tKJJeiT1fygB2GIQQGnoV lGq0SaRhd8mT5452kb4u/e+CJPkff5rNquKfoCAm60MYhdPQBYEVlrp0CnAQhZsf1O wRLjWsxR6MxXeJUguLlPz7zLd0OPo44O5cqxS8/I= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Bart Van Assche Subject: [PATCH rdma-next 4/6] RDMA/cm: Delete useless QPN masking Date: Sun, 20 Oct 2019 10:15:57 +0300 Message-Id: <20191020071559.9743-5-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191020071559.9743-1-leon@kernel.org> References: <20191020071559.9743-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky QPN is supplied by kernel users who controls and creates valid QPs, such flow ensures that QPN is limited to 24bits and no need to mask already valid QPN. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 7ffa16ea5fe3..2eb8e1fab962 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -2101,7 +2101,7 @@ int ib_send_cm_rep(struct ib_cm_id *cm_id, cm_id_priv->initiator_depth = param->initiator_depth; cm_id_priv->responder_resources = param->responder_resources; cm_id_priv->rq_psn = cm_rep_get_starting_psn(rep_msg); - cm_id_priv->local_qpn = cpu_to_be32(param->qp_num & 0xFFFFFF); + cm_id_priv->local_qpn = cpu_to_be32(param->qp_num); out: spin_unlock_irqrestore(&cm_id_priv->lock, flags); return ret; From patchwork Sun Oct 20 07:15:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11200617 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 E269D913 for ; Sun, 20 Oct 2019 07:16:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1E8D222D0 for ; Sun, 20 Oct 2019 07:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555780; bh=9lX0dY96lDe/nG8RBrPiy4okSQRATw+koAPWb6/TloM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XDe/8zFhast43sT1H4oNVWZoCG6mOAAOvNB0wY/5zkUfxqM0LVNQcPQxjyRxrBKL7 L0mW7A4PzuSccJwE4213LD09f+5J2/nWG2UZqCvh8x2ggj/k39RjrOCpGWyRtAARek Yd+nb5HF/VCntbqLJYbvLlaWZAnN5eXD3uc42I8M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726206AbfJTHQU (ORCPT ); Sun, 20 Oct 2019 03:16:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:34418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfJTHQU (ORCPT ); Sun, 20 Oct 2019 03:16:20 -0400 Received: from localhost (unknown [77.137.89.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1469A21744; Sun, 20 Oct 2019 07:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555778; bh=9lX0dY96lDe/nG8RBrPiy4okSQRATw+koAPWb6/TloM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z/ffiTuGgN3S4P1jl9P24APIOgJr4oTNG83t025MGlOPmt9vipPgMLtwRQx9O8MN9 qrAuo4qQHGwEjeH2vUycFz/lQv1TNOk63Gg19AwW7AkVPpGEWuMrIAdVobrWGYE1b1 0BIu4SwQpZ7ZuHCqV/STMXo94x5b2FfVPwKT4B14= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Bart Van Assche Subject: [PATCH rdma-next 5/6] RDMA/cm: Provide private data size to CM users Date: Sun, 20 Oct 2019 10:15:58 +0300 Message-Id: <20191020071559.9743-6-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191020071559.9743-1-leon@kernel.org> References: <20191020071559.9743-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky Prepare code to removal IB_CM_*_PRIVATE_DATA_SIZE enum so we will store such size in adjacent to actual data. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm.c | 11 +++++++++++ include/rdma/ib_cm.h | 1 + 2 files changed, 12 insertions(+) -- 2.20.1 diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 2eb8e1fab962..ecd868954958 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1681,6 +1681,7 @@ static void cm_format_req_event(struct cm_work *work, param->srq = cm_req_get_srq(req_msg); param->ppath_sgid_attr = cm_id_priv->av.ah_attr.grh.sgid_attr; work->cm_event.private_data = &req_msg->private_data; + work->cm_event.private_data_len = IB_CM_REQ_PRIVATE_DATA_SIZE; } static void cm_process_work(struct cm_id_private *cm_id_priv, @@ -2193,6 +2194,7 @@ static void cm_format_rep_event(struct cm_work *work, enum ib_qp_type qp_type) param->rnr_retry_count = cm_rep_get_rnr_retry_count(rep_msg); param->srq = cm_rep_get_srq(rep_msg); work->cm_event.private_data = &rep_msg->private_data; + work->cm_event.private_data_len = IB_CM_REP_PRIVATE_DATA_SIZE; } static void cm_dup_rep_handler(struct cm_work *work) @@ -2395,6 +2397,7 @@ static int cm_rtu_handler(struct cm_work *work) return -EINVAL; work->cm_event.private_data = &rtu_msg->private_data; + work->cm_event.private_data_len = IB_CM_RTU_PRIVATE_DATA_SIZE; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_REP_SENT && @@ -2597,6 +2600,7 @@ static int cm_dreq_handler(struct cm_work *work) } work->cm_event.private_data = &dreq_msg->private_data; + work->cm_event.private_data_len = IB_CM_DREQ_PRIVATE_DATA_SIZE; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->local_qpn != cm_dreq_get_remote_qpn(dreq_msg)) @@ -2671,6 +2675,7 @@ static int cm_drep_handler(struct cm_work *work) return -EINVAL; work->cm_event.private_data = &drep_msg->private_data; + work->cm_event.private_data_len = IB_CM_DREP_PRIVATE_DATA_SIZE; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_DREQ_SENT && @@ -2770,6 +2775,7 @@ static void cm_format_rej_event(struct cm_work *work) param->ari_length = cm_rej_get_reject_info_len(rej_msg); param->reason = __be16_to_cpu(rej_msg->reason); work->cm_event.private_data = &rej_msg->private_data; + work->cm_event.private_data_len = IB_CM_REJ_PRIVATE_DATA_SIZE; } static struct cm_id_private * cm_acquire_rejected_id(struct cm_rej_msg *rej_msg) @@ -2982,6 +2988,7 @@ static int cm_mra_handler(struct cm_work *work) return -EINVAL; work->cm_event.private_data = &mra_msg->private_data; + work->cm_event.private_data_len = IB_CM_MRA_PRIVATE_DATA_SIZE; work->cm_event.param.mra_rcvd.service_timeout = cm_mra_get_service_timeout(mra_msg); timeout = cm_convert_to_ms(cm_mra_get_service_timeout(mra_msg)) + @@ -3214,6 +3221,7 @@ static int cm_lap_handler(struct cm_work *work) param->alternate_path = &work->path[0]; cm_format_path_from_lap(cm_id_priv, param->alternate_path, lap_msg); work->cm_event.private_data = &lap_msg->private_data; + work->cm_event.private_data_len = IB_CM_LAP_PRIVATE_DATA_SIZE; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_ESTABLISHED) @@ -3367,6 +3375,7 @@ static int cm_apr_handler(struct cm_work *work) work->cm_event.param.apr_rcvd.apr_info = &apr_msg->info; work->cm_event.param.apr_rcvd.info_len = apr_msg->info_length; work->cm_event.private_data = &apr_msg->private_data; + work->cm_event.private_data_len = IB_CM_APR_PRIVATE_DATA_SIZE; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_ESTABLISHED || @@ -3515,6 +3524,7 @@ static void cm_format_sidr_req_event(struct cm_work *work, param->port = work->port->port_num; param->sgid_attr = rx_cm_id->av.ah_attr.grh.sgid_attr; work->cm_event.private_data = &sidr_req_msg->private_data; + work->cm_event.private_data_len = IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE; } static int cm_sidr_req_handler(struct cm_work *work) @@ -3664,6 +3674,7 @@ static void cm_format_sidr_rep_event(struct cm_work *work, param->info_len = sidr_rep_msg->info_length; param->sgid_attr = cm_id_priv->av.ah_attr.grh.sgid_attr; work->cm_event.private_data = &sidr_rep_msg->private_data; + work->cm_event.private_data_len = IB_CM_SIDR_REP_PRIVATE_DATA_SIZE; } static int cm_sidr_rep_handler(struct cm_work *work) diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index b01a8a8d4de9..b476e0e27ec9 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h @@ -254,6 +254,7 @@ struct ib_cm_event { } param; void *private_data; + u8 private_data_len; }; #define CM_REQ_ATTR_ID cpu_to_be16(0x0010) From patchwork Sun Oct 20 07:15:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11200619 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 86973913 for ; Sun, 20 Oct 2019 07:16:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B7FF222C3 for ; Sun, 20 Oct 2019 07:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555783; bh=743Cxu4KRTWlfMx3ZaqQs/0aksqtHskOO1X3RvILynE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KlgnXq/nT1OMVJJLQCT+qfUraE4plv89lRift8PcxpssdBGmK8mCPwW+ITCSj7xlo ftJA7Lb4sqIPUSPLze6J3KnHpQtwvoBS63PgH6wYb2IRD7/mRRcNbyCIjKEJxXWjZc RXGqS09F0+3kcnvbA+P4UUN2Inmgu+s2+jH7AKtQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726212AbfJTHQW (ORCPT ); Sun, 20 Oct 2019 03:16:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:34450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfJTHQW (ORCPT ); Sun, 20 Oct 2019 03:16:22 -0400 Received: from localhost (unknown [77.137.89.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98A6621D80; Sun, 20 Oct 2019 07:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571555782; bh=743Cxu4KRTWlfMx3ZaqQs/0aksqtHskOO1X3RvILynE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wnPCMe0JU0AXcW+I/0cCFUClRMGbYC5iVi0EHzc+Wf6KjBE2Ourrjvx3A6YTPL6UT RqEf1X2ceZMHAr2YgRZITToChqSEC88ZvUSSs2MmtwTsrGNfCo81Ef6rd3uZ9rbzit v8EWicraDo0ZCVHY2nKmjV+wJw/V1ZWk30jDz3Zo= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Bart Van Assche Subject: [PATCH rdma-next 6/6] RDMA/srpt: Use private_data_len instead of hardcoded value Date: Sun, 20 Oct 2019 10:15:59 +0300 Message-Id: <20191020071559.9743-7-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191020071559.9743-1-leon@kernel.org> References: <20191020071559.9743-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky Reuse recently introduced private_data_len to get IBTA REJ message private data size. Signed-off-by: Leon Romanovsky Reviewed-by: Bart Van Assche --- drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index daf811abf40a..e66366de11e9 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2609,7 +2609,7 @@ static int srpt_cm_handler(struct ib_cm_id *cm_id, case IB_CM_REJ_RECEIVED: srpt_cm_rej_recv(ch, event->param.rej_rcvd.reason, event->private_data, - IB_CM_REJ_PRIVATE_DATA_SIZE); + event->private_data_len); break; case IB_CM_RTU_RECEIVED: case IB_CM_USER_ESTABLISHED: