Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6883775rdb; Tue, 2 Jan 2024 18:01:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzBKz2jhQMn1dQmD4m2dfE76IDNHwmO4ECv1z4PWVMI2A+oAwsfvCCDLslLKRPAEud+mOc X-Received: by 2002:ad4:5946:0:b0:680:c74f:4f48 with SMTP id eo6-20020ad45946000000b00680c74f4f48mr1452357qvb.104.1704247312800; Tue, 02 Jan 2024 18:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704247312; cv=none; d=google.com; s=arc-20160816; b=TsPunwdDzZw3EydYuQaXhGx2ZObmaMiScqQwqJ0xZ+hm7cHdkimb6Ep2hHtgqqAwEw jKJ3beR3fI8i7VZTFp6Wn2kyg5+kaL/VoSP4diZq/G29jOIxO0g9X1XuV3N4jJKqn4ww CzqhrrjdpXZoSUVgwonDDcbxPc4EqVUcVpUdkAO1nCaLG5RCc7UM8MxeJTihdmJreDzU 9UAgEQJ1pfFgxk/FMlOf9S0LShtgx3f4Yw94ETajccj43RLQOMORK67sxNGMsZSZzpH6 +7NRRqNGd1OCttskiQfV246KTcM8gMiFist+kO2aH9Vz1boU53skOzfs3AbI6ka1qw5b 4Npw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=C9J+xmhh3o2qb5UA/Lzz6b6u4mxmFjot2u0XPV7yids=; fh=NA/+FAV5KEwz58JrhNfLafxNhf6g1D8GA4AMZce1l0I=; b=s1vCfR4qAlxZiuU0uFHuaUoOPBFNWQGx18Y00hF9xNugFnq91DbdasvJ1o6D4g7VHK QonmkZMv/Y7/XlcVT3333dVHkQKuJmGoGt9Tx9ldBRmzpTaMnAeMPgJIzSUA3RzZy9Mz 2HIm5HCWlsf21yDNAeaTr7l+PdZqnhm9Zsdgm+t+osJZagT6oIsEt0cCWbOj7yVHZG0K DQVuR0185xhzMp6njzr/6WhuoFdVSISDAWhc8eUREN0hTj6tqFjmL76YLKdqjDN6FkBc PUuaf4Bc6U19c4cu7qiwzK5dbOf9aNcvqWoGYWNcNZfK3TJ6zup8FyV3KjUqA6wFE4ns 2VAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=GZlNilYL; spf=pass (google.com: domain of linux-kernel+bounces-15056-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k12-20020a0cf28c000000b0067f69b84b0asi29540356qvl.356.2024.01.02.18.01.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 18:01:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15056-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=GZlNilYL; spf=pass (google.com: domain of linux-kernel+bounces-15056-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 864321C21CC6 for ; Wed, 3 Jan 2024 02:01:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F31E15AF; Wed, 3 Jan 2024 02:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="GZlNilYL" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69D051848 for ; Wed, 3 Jan 2024 02:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-5ce0efd60ddso2216933a12.0 for ; Tue, 02 Jan 2024 18:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1704247300; x=1704852100; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=C9J+xmhh3o2qb5UA/Lzz6b6u4mxmFjot2u0XPV7yids=; b=GZlNilYLnI1HKXYwNa2nl/Kow5L9hzkpRgA156s/d/e7eJgCpnXNnXDZ0Kwb6O2yK/ fonOzsr6naC9/tRbV0snMeKWMXTlKYVG3Y/Yk5dQbkQYXHZNe/AvfLWi/GhDRmV00mrl k3bigFhLIBzruHFTJZ/hOHlSRl2gb9igndfS12KnbBE7gCAymm9O/T8gllE6ZyFWdvol kg/bRJImsZx8dhk3JexM86KEyh+RLnKzZJ7vGGLP4+BohIPC4pyimHVsuP2aN8JMIRwr GkbL5nNpgGrE73h5GyQpE9zqDz90/HxBEoaj2p/7nNSB2JBuMcSUluPyiLv9Lyu7n5On Hs3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704247300; x=1704852100; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C9J+xmhh3o2qb5UA/Lzz6b6u4mxmFjot2u0XPV7yids=; b=Aj593ALi9CepFKVXsMo13IO7eCG7QPU2ZDgEiOqtKSkPqh3z1GbCmF+2wAbw/r2EqY NWwSTtMDvHIxwbJkSknUdbK/+kXOypGDKzgXoGfjFfqIHR3HGlBYDaAGmJlOmMrrbdOM 7VWW3RzqM2eqPpZkzpZ3+SEvOlu4SX5rmXKTEGsHyLRpUkVpCSW55PtsTdMfb5yVVqsB JWa/dEJKwax6ioVXGRumJGtp2U7scENOfW7caKza0D++7fZl/jBxa/Q71j3tRYls4BzU WIwqIgD01/e8O11Bqz6P+jYDzsps3j9wQ91Ubu/HXpubRVn/ClFNqpwVo+O2i3ieaXlp 02qg== X-Gm-Message-State: AOJu0YzOtTaqKY6BzDRyw3Uu9fK0uXtv75NMEEwZoniMbVCq8kxcfqzm jTBhksTUvofjcCzTKLD1J8cv8S9qkV3x3w== X-Received: by 2002:a05:6a00:3243:b0:6da:2ee0:50bd with SMTP id bn3-20020a056a00324300b006da2ee050bdmr3230918pfb.53.1704247299704; Tue, 02 Jan 2024 18:01:39 -0800 (PST) Received: from always-x1.bytedance.net ([61.213.176.12]) by smtp.gmail.com with ESMTPSA id v21-20020a056a00149500b006d9cf4b56edsm14219784pfu.175.2024.01.02.18.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 18:01:39 -0800 (PST) From: zhenwei pi To: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, zhenwei pi Subject: [PATCH] RDMA/rxe: Fix port state on associating netdev successfully Date: Wed, 3 Jan 2024 10:01:33 +0800 Message-Id: <20240103020133.664928-1-pizhenwei@bytedance.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Originally, after adding a RXE device successfully, the RXE device gets ready, it still reports 'PORT_DOWN' state. Set the state to *IB_PORT_ACTIVE* once it becomes ready to access. Signed-off-by: zhenwei pi --- drivers/infiniband/sw/rxe/rxe_net.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index cd59666158b1..eafcb2351a7b 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -524,6 +524,7 @@ int rxe_net_add(const char *ibdev_name, struct net_device *ndev) { int err; struct rxe_dev *rxe = NULL; + struct rxe_port *port; rxe = ib_alloc_device(rxe_dev, ib_dev); if (!rxe) @@ -537,6 +538,11 @@ int rxe_net_add(const char *ibdev_name, struct net_device *ndev) return err; } + if (netif_running(ndev) && netif_carrier_ok(ndev)) { + port = &rxe->port; + port->attr.state = IB_PORT_ACTIVE; + } + return 0; } -- 2.34.1