Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6973142rdb; Tue, 2 Jan 2024 23:15:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGa2brXvpKf4T1khZlICtCs0GJC0QP0FzHDtQAaxssXtzcrg/eMGwQjDj4UrVzyvO9fjXTQ X-Received: by 2002:a9d:7c82:0:b0:6dc:7a0c:1811 with SMTP id q2-20020a9d7c82000000b006dc7a0c1811mr1039219otn.56.1704266143884; Tue, 02 Jan 2024 23:15:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704266143; cv=none; d=google.com; s=arc-20160816; b=ZwVy59p3rrTx16pJ2/8Du6ttcBiXrk4Vzp8B6XymF9Auj4lO4dKpQN9HGP795IV0DL BbX2zELlXZpn/rQT7Eu34muWKl4ngaGXtjxxkvAWX0jRrDPiD8MT2t8lmK9bA7xfDHIO al0Raee+rM7SLsylGW2LioMl+jORfw9052EgOAHCCkOrE1st35ZC6ITkRxS76Wcp9IRa WKK7MtDcrsYkjRYbkmJE6AGmMOuGqBCRlW3gQq1HU1/jOsgO2UC1sTAZ3dyTOYr+brZF trnwL+TpJlXTX2RUzYIcJZOZHMuVdMJfG42x9EtpegfbrIXxNoRrhdMNIVGHASGk2wxd UZUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=p+HykofkC4XCLsN/IzjEfRBYAAlCw6MbbcBMKDxRgT4=; fh=SKw7HAoz5YWuLG3c1gtLjd7R86QGmjnLApGbmEpFBsM=; b=QmgE5GzkAwDVMcFbBys86HfH1zTsAVRJ2yFKZp1P9WzvfPAXmujiZEdVpxV8x9RO5U eDvLyHBDfIWOH75F2oXetiulufRJgrvFoGoU/ghM220AEw1hmdKbf7DQQZjBSBj8wfMC FPFuIbj15u3qGrpYPM57Wt9ZMZciebE0PKLJkOkJmSI3kY2RCOqMZBEiDvysP2B+Mb8f boLG4CvY78gRmDvhc+TFt2BGsgVyzmHa3fxBYblmX89BGMnC0ehhA2Zyc028hVMfJtNT ljCIYuNJIivosiNZcvWqBmsNBEqIcIgV8QNMWL7iRJ1zRV2XhgxPyN1VjCc8dg7S9HRf R3LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=E8xyDbrf; spf=pass (google.com: domain of linux-kernel+bounces-15229-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15229-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l12-20020a633e0c000000b005cdf9c9b7e3si19080832pga.179.2024.01.02.23.15.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 23:15:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15229-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=E8xyDbrf; spf=pass (google.com: domain of linux-kernel+bounces-15229-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15229-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3EE47B22D00 for ; Wed, 3 Jan 2024 07:15:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E93681802E; Wed, 3 Jan 2024 07:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="E8xyDbrf" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (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 480ED18027 for ; Wed, 3 Jan 2024 07:15:31 +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-oi1-f180.google.com with SMTP id 5614622812f47-3bbc649c275so2851734b6e.0 for ; Tue, 02 Jan 2024 23:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1704266131; x=1704870931; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=p+HykofkC4XCLsN/IzjEfRBYAAlCw6MbbcBMKDxRgT4=; b=E8xyDbrfTBAwDKR4vO84lsiLQKxmfCQ4WGv/oKNgFMGqghj1bJKAtJXWmxP8S/0L/A 7dBqLxTBrrypGGpPYKZHpIgaM9A/UXAdkKMS48fhUqUVZM5dNoDLNVaKukR9RoswRvZW MP6+c9XdZa0PUER4EXLOuf9o17LoQPN+XQxC3cZ7mT1Bd5es8Q1S0cNawZGFeFt/yLxe fprUZZAY7RjjFDEgmpIDIOBlL2xARg5l3TR5VlXSUiNhnuOCgLFLcijaq3xcQsznlzpA P6qqLAVFYzO2f2gOChpYYyNxg6K1vo1xBveVfanSRa/47tZbFP8xEozmkc1e1H/xIp8P JCRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704266131; x=1704870931; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p+HykofkC4XCLsN/IzjEfRBYAAlCw6MbbcBMKDxRgT4=; b=vQ3ORvD1Dyss72YNqjrJzM/kasDz2Oymkf/P9POMplfgbxpkmeGPxNkN/DYVni+h59 UhFIU0I2JzoFvqcI8tu50POSHkCL9cPVhOH3JykW6YQu2cbaNooUmE7LYqE+EVVFBGjY h9Mgk/yLIuijrfKtJvau5pqk+ewdg0YVzAAEch5HWd23O+dzDBG5++66VIxBTF+N2h4B gtoJnxA72klQR0so9mr0kn9A3k5/mRJfBRBq6Bv/4UQeNKHPkPCnsJpc7xP+3ajVaJRU tjc7g5PWqymWIXO+WLiK0buyjniP9fHFRTKgRKRGTKoVW7pF7ekkmbKm23tLcBhy401f +mkw== X-Gm-Message-State: AOJu0Yzo7zZobtKMFH/+iiOwaEMqWk+fJDS5sQuC/eD/jF5NDkKA2wMV CQ6DDHOBY7Tch7lQzE0D7nFwg1fMdKcG7Q== X-Received: by 2002:a05:6808:bd0:b0:3bc:22e6:a9cc with SMTP id o16-20020a0568080bd000b003bc22e6a9ccmr831123oik.40.1704266131162; Tue, 02 Jan 2024 23:15:31 -0800 (PST) Received: from [10.3.43.196] ([61.213.176.12]) by smtp.gmail.com with ESMTPSA id w67-20020a626246000000b006da04f1b884sm12272607pfb.105.2024.01.02.23.15.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Jan 2024 23:15:30 -0800 (PST) Message-ID: Date: Wed, 3 Jan 2024 15:15:26 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Re: [PATCH] RDMA/rxe: Fix port state on associating netdev successfully Content-Language: en-US To: Zhu Yanjun , zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240103020133.664928-1-pizhenwei@bytedance.com> <96f1e8d4-18fc-461e-9916-f7ddd6ea4b26@linux.dev> From: zhenwei pi In-Reply-To: <96f1e8d4-18fc-461e-9916-f7ddd6ea4b26@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/3/24 14:47, Zhu Yanjun wrote: > 在 2024/1/3 10:01, zhenwei pi 写道: >> 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. > > IB_PORT_ACTIVE is set in the function rxe_port_up. > > The followings are the call chain. > > rxe_net_add -- > rxe_register_device -- > ib_register_device -- > > enable_device_and_get -- > rxe_enable_driver -- > rxe_set_port_state -- > > rxe_port_up > > In this commit, in rxe_net_add, the port->attr.state is set to > IB_PORT_ACTIVE. > > But then in the function rxe_init_port_param, port->attr.state is set to > IB_PORT_DOWN again. > > Zhu Yanjun > Thanks, I guess anything got wrong in my env(virtual interface in a virtual machine), let's drop this. >> >> 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; >>   } > -- zhenwei pi