From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8134B28B7DA for ; Tue, 10 Mar 2026 00:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104296; cv=none; b=t+J0mG8lBbjuVTemD4N9+HeK4IhK9NOmtTE0ZbKmrjNnMp0JvBfUbQaYYvYLuRQECGJzPaC0N+s4Q5vuXZXLxbVQ13T0YXFgXAmmW0QmBQcHlYtih8b4OH7SG05M5/OGQf2JUpeT+57/iqChKK8/bO+CbXG5G3muIMShqvSY8ao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104296; c=relaxed/simple; bh=dPoEIOAYHx5KLrElD/4+mIklDzgqI00gPUpmH8GDibM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=Kwguc2uelmuqYcC5fvwjnI+6a1GY4UMDlSNj4dzQC/23FOfMt/sDMjUM6bO08gl6axS9eY/9y9lKk9jSaIydQjI/9QZsJN5b0MAS3yvqVEEghxGS4emN6Hxzgj1cXa0D+cDZX3SpasW8N6EmWA2jcKpyE/O43su63OEuqhBu7Dc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=pycPdyu6; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="pycPdyu6" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1773104279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uq+YT/c2bPbY61/CzhKnRWl7UJSRGUFSbyEUAdzLVMs=; b=pycPdyu6xzn9YbY8k42TaUulljiM+mnMX99p2zSHMr1JVfUOZJ5uTf+TBzAQXkc4lEJudU Nd1gs3uHqV8BM0ahvBwp6e0WKzcyQeETU7TTnPDTYGAbownxUJn4u6UozxBQR4pvokVxl3 Ypg9n1bUT4RjGoIcWZVBb64J8Ndle/M= Date: Mon, 9 Mar 2026 17:57:49 -0700 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v4 3/4] RDMA/rxe: Support RDMA link creation and destruction per net namespace To: David Ahern , jgg@ziepe.ca, leon@kernel.org, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, Zhu Yanjun References: <20260308233540.13382-1-yanjun.zhu@linux.dev> <20260308233540.13382-4-yanjun.zhu@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "yanjun.zhu" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 3/9/26 11:54 AM, David Ahern wrote: > On 3/8/26 5:35 PM, Zhu Yanjun wrote: >> @@ -101,20 +100,20 @@ static inline void rxe_reclassify_recv_socket(struct socket *sock) >> } >> >> static struct dst_entry *rxe_find_route4(struct rxe_qp *qp, >> + struct net *net, >> struct net_device *ndev, >> struct in_addr *saddr, >> struct in_addr *daddr) >> { >> struct rtable *rt; >> - struct flowi4 fl = { { 0 } }; >> + struct flowi4 fl = {}; >> >> - memset(&fl, 0, sizeof(fl)); > > changing init of fl here and fl6 in the next function are not relevant > to this patch. It should be a different one after this set. Thanks. The changes have been done. It is a trivial problem. Let us keep them in this patch series. > >> fl.flowi4_oif = ndev->ifindex; >> memcpy(&fl.saddr, saddr, sizeof(*saddr)); >> memcpy(&fl.daddr, daddr, sizeof(*daddr)); >> fl.flowi4_proto = IPPROTO_UDP; >> >> - rt = ip_route_output_key(&init_net, &fl); >> + rt = ip_route_output_key(net, &fl); >> if (IS_ERR(rt)) { >> rxe_dbg_qp(qp, "no route to %pI4\n", &daddr->s_addr); >> return NULL; >> @@ -125,21 +124,21 @@ static struct dst_entry *rxe_find_route4(struct rxe_qp *qp, >> >> #if IS_ENABLED(CONFIG_IPV6) >> static struct dst_entry *rxe_find_route6(struct rxe_qp *qp, >> + struct net *net, >> struct net_device *ndev, >> struct in6_addr *saddr, >> struct in6_addr *daddr) >> { >> struct dst_entry *ndst; >> - struct flowi6 fl6 = { { 0 } }; >> + struct flowi6 fl6 = {}; >> >> - memset(&fl6, 0, sizeof(fl6)); >> fl6.flowi6_oif = ndev->ifindex; >> memcpy(&fl6.saddr, saddr, sizeof(*saddr)); >> memcpy(&fl6.daddr, daddr, sizeof(*daddr)); >> fl6.flowi6_proto = IPPROTO_UDP; >> >> - ndst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(recv_sockets.sk6->sk), >> - recv_sockets.sk6->sk, &fl6, >> + ndst = ipv6_stub->ipv6_dst_lookup_flow(net, >> + rxe_ns_pernet_sk6(dev_net(ndev)), &fl6, > > why dev_net(ndev) here? Got it. I will fix it in the latest commits. Zhu Yanjun > > >> NULL); >> if (IS_ERR(ndst)) { >> rxe_dbg_qp(qp, "no route to %pI6\n", daddr); >