Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp859724pxv; Thu, 24 Jun 2021 23:21:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuNvmXyAgLPttp/A8Vn9YNvXa88WxyGjVRwFQ190vBxtWEnnIUAT3RDQyUMGcU9AWG2O+9 X-Received: by 2002:aa7:cf0a:: with SMTP id a10mr12308934edy.329.1624602112529; Thu, 24 Jun 2021 23:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624602112; cv=none; d=google.com; s=arc-20160816; b=poI8AKlxKZxXZm7MQleEdFj+np5TV/YgOR0wwDpPKKd/JG7tEI66yN4cP1NjzyHiB6 gdVXZYU+KGpyjikRp1BC7A2UPn46WAjII7CBuIlBbLXvanXVyx5LVTnWbwVIbddFOlW2 tXlLU8CeU9XdrjuGURZedw7rS9MagspSbbzhKokjFqmr7lhukqhPnpiV3KNPyvKeNJpb F51H1RIExxzgF1Mou4FCtwkVhk8b8SBDgZ+R3OGyu21n7pqcY7PkQFxpzz/9NLBO8YM2 CpyiXguZRBP60KK1Dv/Sm/v5cMvqfSNBAvjRzOdZ+/JD0jI1fXCQzyV2+FF9v8lWi0X7 qQfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=uL5GCmoz7xyiLaRYeGYSBXAyek+OhpQApKExxrVqxec=; b=zvI7DPcqd0mZEiYrhAPJJ3SGdNTkIh+4xH0r9rX1VqWHR0GhWPabZ/+VmCxRx6WCAi a2yos1BsB692v/lpi4pbhlY8/zuK8LHfPK5XUTyfu6BMObc2VanyyZmoQt8/Y97eqtps RaMvBZCJfSfaZoMHPpgrzCscFMyQ5wAeDrmpCxkpLFtfEHwgITBbUhrkgpXASHShRX+4 Ba897m3jN9EneTtSCY4edFCZCSTjdbo20tuULBsh/N5XMu+Rk+nwW/pSSJoU46HRaSty C67GiSg+b8YmCu+kZ/uSo3ELpjSK3YzTavFAAtNgRQixQcQrZB8Vjmfj8NCD1QXZ5/os Rxfg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dq8si5568350ejc.598.2021.06.24.23.21.22; Thu, 24 Jun 2021 23:21:52 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233174AbhFYGVZ (ORCPT + 99 others); Fri, 25 Jun 2021 02:21:25 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:35066 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231406AbhFYGVY (ORCPT ); Fri, 25 Jun 2021 02:21:24 -0400 X-UUID: 7bbb680ed00b4f3abb56ac188873f7bb-20210625 X-UUID: 7bbb680ed00b4f3abb56ac188873f7bb-20210625 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1601443592; Fri, 25 Jun 2021 14:19:01 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 25 Jun 2021 14:18:59 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 25 Jun 2021 14:18:58 +0800 From: Rocco Yue To: Dan Williams CC: Greg KH , "David S . Miller" , Jakub Kicinski , Jonathan Corbet , Hideaki YOSHIFUJI , David Ahern , Matthias Brugger , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , , , , , , , , , , Rocco Yue Subject: Re: [PATCH 1/4] net: if_arp: add ARPHRD_PUREIP type Date: Fri, 25 Jun 2021 14:04:11 +0800 Message-ID: <20210625060411.23853-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <0548d1daa7e1eee9d8202481668bbe4975c9b33d.camel@redhat.com> References: <0548d1daa7e1eee9d8202481668bbe4975c9b33d.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-06-24 at 11:14 -0500, Dan Williams wrote: On Thu, 2021-06-24 at 14:13 +0800, Rocco Yue wrote: >> On Thu, 2021-06-24 at 07:29 +0200, Greg KH wrote: >> >> Before kernel-4.18, RAWIP was the same as PUREIP, neither of them >> automatically generates an IPv6 link-local address, and the way to >> generate an IPv6 global address is the same. > > This distinction seems confusing from a kernel standpoint if it only > changes how v6 IIDs are determined. Do we really need something that's Hi Dan, Thanks for your comment, In the cellular network, v6 IID is important, If the device use the link-local address formed by the incorrect IID to send RS message to the network, based on 3GPP, GGSN will not reply solicited RA message. It will lead to the device can get ipv6 address prefix and ipv6 route. Maybe the table below is a little bit clearer three device type: ARPHRD_RAWIP , ARPHRD_PUREIP, ARPHRD_NONE three mode: IN6_ADDR_GEN_MODE_EUI64 , IN6_ADDR_GEN_MODE_NONE, IN6_ADDR_GEN_MODE_STABLE_PRIVACY ipv6 link-local address generate behavior in the kernel: +---------+-------------------+---------------------+----------------+ | | MODE_EUI64 | MODE_STABLE_PRIVACY | MODE_NONE | +---------+-------------------+---------------------+----------------+ | RAWIP | fe80::(eui64-id) | fe80::(privacy-id) | no address gen | +---------+-------------------+---------------------+----------------+ | PUREIP | no address gen | no address gen | no address gen | +---------+-------------------+---------------------+----------------+ | NONE | fe80::(random-id) | fe80::(privacy-id) | no address gen | +---------+-------------------+---------------------+----------------+ ipv6 global address generate behavior in the kernel: +---------+-------------------+---------------------+-------------------+ | | MODE_EUI64 | MODE_STABLE_PRIVACY | MODE_NONE | +---------+-------------------+---------------------+-------------------+ | RAWIP | prefix+(eui64-id) | prefix+(privacy-id) | prefix+(eui64-id) | +---------+-------------------+---------------------+-------------------+ | PUREIP | prefix+(GGSN-id) | prefix+(privacy-id) | prefix+(GGSN-id) | +---------+-------------------+---------------------+-------------------+ | NONE | prefix+(random-id)| prefix+(privacy-id) | prefix+(random-id)| +---------+-------------------+---------------------+-------------------+ > also reflected to userspace (in struct ifinfomsg -> ifi_type) if the > kernel is handling the behavior that's different? Why should userspace > care? > In my opinion, userspace program cares about it because the kernel behaves differently for different device types. userspace can get the device type of the interface through ioctl, such as the following code weblink: https://cs.android.com/android/platform/superproject/+/master:system/netd/server/OffloadUtils.cpp;drc=master;l=41?q=ARPHRD_RAWIP&ss=android%2Fplatform%2Fsuperproject&start=11 > I'm also curious why this isn't an issue for the ipa/rmnet (Qualcomm) > modem drivers. There's probably a good reason, but would be good to > know what that is from Alex Elder or Loic or Bjorn... > > Dan MediaTek and Qualcomm has different hardware or modem design. For the MediaTek platform, device send the RS message that generated by the kernel to the GGSN. Thanks, Rocco