From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6B4CC28D13 for ; Tue, 23 Aug 2022 00:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238668AbiHWAjd (ORCPT ); Mon, 22 Aug 2022 20:39:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238589AbiHWAjc (ORCPT ); Mon, 22 Aug 2022 20:39:32 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 405524BD0E for ; Mon, 22 Aug 2022 17:39:31 -0700 (PDT) Subject: Re: [PATCH] RDMA/rxe: No need to check IPV6 in rxe_find_route DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1661215169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RKeu5raZdsKEPGUmbCeUYR8RizTi79uyNPx+sR0JISs=; b=TWV8aQVgGCcyjS4RgVIxc6lP8s0+3w1G9SWwiPebZyOg2xHSD/45pitA5erYL34n8S2f6y EcvWsmIxOLuOZLJZmabblnlDt30kkIboHOgckgRy8pOFkU1ow7vxiNlDUFDW15fM7nqMp9 VZ2S3Lm1J1oAifUQz+ToL5SM2hWpZ/w= To: William Kucharski Cc: "yanjun.zhu@linux.dev" , "jgg@ziepe.ca" , "leon@kernel.org" , "linux-rdma@vger.kernel.org" References: <20220822112355.17635-1-guoqing.jiang@linux.dev> <6E8EBFAA-E346-413E-9DEC-84EC779CBAB6@oracle.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Guoqing Jiang Message-ID: Date: Tue, 23 Aug 2022 08:39:17 +0800 MIME-Version: 1.0 In-Reply-To: <6E8EBFAA-E346-413E-9DEC-84EC779CBAB6@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 8/23/22 12:33 AM, William Kucharski wrote: > Rather than remove the #if guard here, shouldn't it instead be expanded > to cover the entire > > else if (av->network_type == RXE_NETWORK_TYPE_IPV6) { > > clause? > > There is no need to check for RXE_NETWORK_TYPE_IPV6, make assignments > to the stack-allocated pointers or call rxe_find_route6() unless > CONFIG_IPV6 is true. > > In fact, if CONFIG_IPV6 is false, as rxe_find_route6 would also return > NULL, the else clause to the RXE_NETWORK_TYPE_IPV4 check could instead > become a simple > > return NULL; Thanks for the suggestion! And it could also resolve the issue reported by LKP too. Thanks, Guoqing