Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5455708pxu; Tue, 22 Dec 2020 18:34:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEJCQFOHqQ+XP6zrpBsf3eshUqrAh9/A7JWLQ+cSzvbOR1DJyX1tnlq6jZiecJbmlEhrzv X-Received: by 2002:a17:906:27d1:: with SMTP id k17mr22779190ejc.325.1608690848248; Tue, 22 Dec 2020 18:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608690848; cv=none; d=google.com; s=arc-20160816; b=eZ0jqSZxpAxQBTMAvr0IMQg9a3cCgSrM09A+uywgDr1ltQpNlffHwANuGqzd/3x2S5 Ip24ORShNTbo1o2FADeX4oCe1/bsTuuPS0FTFrOEpA0gbDZHBK8XcGNkyCa8/5lKEkQz 7R1tIJELllJjVbj8LvCS/gs4SUtVuDhTxwNGaWUx+ywUjzS2O1/pOebHKgNKqIXb9jd+ ShrpkqHCFPSR/8Z3pRNdtZQmijLW9i6GMdGAK7m/WE9VDGEeTXBPCn9hRSZUvINrvMh3 YiLpntVvGR/r6WIBIuEz4qiWJmbNBTvO4egbBdQBiVGHlIMzfttajL0o+ixLuK58Gjio W9Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=V9hK6tZTtM/ji+HJVscJbz4WI8B3CTyVYiz1PbLvnXs=; b=kQzY8n32C7zO/lCdQ6KA6eQMn6inkVIivxUKcHyn1mxb9HTD7ErxiUjyd1D57vQWlC d2fnpjZmYJ/bc94KK828tNTncBts65HoPnc+3feqrn0DXrZKyLf3FFb69k1MAevGh2xT +fzS7IZSPROlPgdqL3OEVHNLnHbb/Mu1YoChrMeLJ13sQsF8qz3e9BIQ6vOLRglDtCmq eH3Zo2h61cKAxtF3DPySF1rKqYVITF4Gf9yJgtr8MafLyU5V6Kyo9lVSIusdL8VpRElV IHT1ecxAmExN31XtjKJkPDEKnMekifzXounWN2zxH67JcEDe2eccHuOUcxPmaeunL0c1 UCHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ai1I5Fmy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si12386970edt.499.2020.12.22.18.33.46; Tue, 22 Dec 2020 18:34:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ai1I5Fmy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730707AbgLWCdO (ORCPT + 99 others); Tue, 22 Dec 2020 21:33:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:54254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730425AbgLWCZP (ORCPT ); Tue, 22 Dec 2020 21:25:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B6DF229C5; Wed, 23 Dec 2020 02:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690299; bh=V9hK6tZTtM/ji+HJVscJbz4WI8B3CTyVYiz1PbLvnXs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ai1I5FmyMwx/34XoDqbh8/B7kjykZ6stIWAIe+V3s+WYfduNPH+ih60OzfNepPfyH HphN8ATPwIkTxa9g8l+yZtVZzADKQ3KM50IoolkXJTtiKgNF7DXpfsUUrTCfpA1sL0 goFFYrfRgUDBrtZn1qoG0iCM0nTE6nyoR4jTz4evcCaBFjM4DTIreKLZh98oCA5D5W csDV28B0BDh0BpSQdNV/VvGH2EZwEEwrNUxgvBrslU88+9zVegVl0tDS8E41ilIQlY MZm8ZHoUuvcVTXyeUwpYDrron12de3fo+9JGifpnb1MBW9NpB2oDSyb0HThxcxf+bh 2epKPsv9hvfeQ== Date: Tue, 22 Dec 2020 18:24:58 -0800 From: Jakub Kicinski To: Samuel Mendoza-Jonas Cc: Joel Stanley , John Wang , xuxiaohan@bytedance.com, =?UTF-8?B?6YOB?= =?UTF-8?B?6Zu3?= , "David S. Miller" , Gavin Shan , "open list:NETWORKING [GENERAL]" , open list Subject: Re: [PATCH] net/ncsi: Use real net-device for response handler Message-ID: <20201222182458.4651c564@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <4a9cab3660503483fd683c89c84787a7a1b492b1.camel@mendozajonas.com> References: <20201220123957.1694-1-wangzhiqiang.bj@bytedance.com> <4a9cab3660503483fd683c89c84787a7a1b492b1.camel@mendozajonas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Dec 2020 10:38:21 -0800 Samuel Mendoza-Jonas wrote: > On Tue, 2020-12-22 at 06:13 +0000, Joel Stanley wrote: > > On Sun, 20 Dec 2020 at 12:40, John Wang wrote: > > > When aggregating ncsi interfaces and dedicated interfaces to bond > > > interfaces, the ncsi response handler will use the wrong net device > > > to > > > find ncsi_dev, so that the ncsi interface will not work properly. > > > Here, we use the net device registered to packet_type to fix it. > > >=20 > > > Fixes: 138635cc27c9 ("net/ncsi: NCSI response packet handler") > > > Signed-off-by: John Wang =20 This sounds like exactly the case for which orig_dev was introduced. I think you should use the orig_dev argument, rather than pt->dev. Can you test if that works? > > Can you show me how to reproduce this? > >=20 > > I don't know the ncsi or net code well enough to know if this is the > > correct fix. If you are confident it is correct then I have no > > objections. =20 >=20 > This looks like it is probably right; pt->dev will be the original > device from ncsi_register_dev(), if a response comes in to > ncsi_rcv_rsp() associated with a different device then the driver will > fail to find the correct ncsi_dev_priv. An example of the broken case > would be good to see though. =46rom the description sounds like the case is whenever the ncsi interface is in a bond, the netdev from the second argument is=20 the bond not the interface from which the frame came. It should=20 be possible to repro even with only one interface on the system, create a bond or a team and add the ncsi interface to it. Does that make sense? I'm likely missing the subtleties here.