Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3924191pxj; Mon, 21 Jun 2021 09:28:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCzCVVuS0nf7kIpIHmQ9RehZB6xrgVTb1TTWtnQ5iHu1mjgpO69khGfIXikyby4G2hrKeM X-Received: by 2002:aa7:c38f:: with SMTP id k15mr22756120edq.156.1624292933504; Mon, 21 Jun 2021 09:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292933; cv=none; d=google.com; s=arc-20160816; b=N2BRb30AsB+cp4X02aY9fgpZesN1dgcPeBj8MOnpEiIt7dixHOR8HELyY0k/d6UWjL lWi3BF1GglQJVnX74uwQVejGKmMCKzHinVy7Qwi3WrCALNov5DjXcJD2Lx8X4NAb2I+s SeF2EEzXYEv4N/2YSI+RbmU+T/4dcQRy37+Du50CkyidYrGCqp7fcXeAQDoHregvNb74 Qw6Kyn0enqVcv59LeMtsUxbHSTGclyHoD2hQA/nc0I/rrmVM7Rv/KkTGT2AvupPJv4CP ZykYodAhAMDmYYort/m1XUW6yribrkbYqmegG2MvBUdYqVkkVh/SXwdGz54gDKzFoLF8 ChOQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yoDL1AxGUdCxnySQIv5pZ1Vja2aSGIxRH0VWBViO38o=; b=EoSkFQGKfzsgUP47XfTiQH/d4oMNo/rqookRoO3duiIEwtkyBWo65DIV+w+GhF2nXH xh+dlyML3dTzEL26y4Q/rshwuZc7NtWm4H1LElxjGKf56Q2m16NftGJSk+89BFXRYoBX DeVcyASFiL/1kU/OCGGiXBywwXHV7bhgSxnGK45oYZ39XMDzUtGdzOZMJu0rCzvAsDG+ sc8gbzOGUBdLHcPqj7zBJJdB6ohKd+mlYFjB2qqO5rVGD6k6fXGwpaG3S8TOtWsKOjrS mHoKcPb2/QPDJL/umlFprVqvIXEiV9L6E7+rmcbNL1HG+ertbhs8u6MlIkIoUSRVGS1s e2qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zc0sQX0k; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si12621964edb.593.2021.06.21.09.28.27; Mon, 21 Jun 2021 09:28:53 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zc0sQX0k; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231789AbhFUQ3q (ORCPT + 99 others); Mon, 21 Jun 2021 12:29:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:48354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbhFUQ15 (ORCPT ); Mon, 21 Jun 2021 12:27:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EDF93613B2; Mon, 21 Jun 2021 16:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292587; bh=hmGwcpj73i9WK4PJwPQacDbkdECktaVInEOULUZWVkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zc0sQX0k7D9SkSaD03Ty/vxZQyp2/gqiLJkHusk6ctZ032jwf/9SFK+nD17pVbTYx ZKKudP3o4K1MjlEBnpg5AS7DSDgkyMPyNuTuOT5Xy7LLWADDmzM4KeplXr0dxEMO6i c6+cbxCJIBPCH9+kA3eX6ETU1nJz1AOftGoHqiEY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Colitti , =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 056/146] net: cdc_ncm: switch to eth%d interface naming Date: Mon, 21 Jun 2021 18:14:46 +0200 Message-Id: <20210621154914.078696937@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maciej Żenczykowski [ Upstream commit c1a3d4067309451e68c33dbd356032549cc0bd8e ] This is meant to make the host side cdc_ncm interface consistently named just like the older CDC protocols: cdc_ether & cdc_ecm (and even rndis_host), which all use 'FLAG_ETHER | FLAG_POINTTOPOINT'. include/linux/usb/usbnet.h: #define FLAG_ETHER 0x0020 /* maybe use "eth%d" names */ #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ #define FLAG_WWAN 0x0400 /* use "wwan%d" names */ #define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ drivers/net/usb/usbnet.c @ line 1711: strcpy (net->name, "usb%d"); ... // heuristic: "usb%d" for links we know are two-host, // else "eth%d" when there's reasonable doubt. userspace // can rename the link if it knows better. if ((dev->driver_info->flags & FLAG_ETHER) != 0 && ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 || (net->dev_addr [0] & 0x02) == 0)) strcpy (net->name, "eth%d"); /* WLAN devices should always be named "wlan%d" */ if ((dev->driver_info->flags & FLAG_WLAN) != 0) strcpy(net->name, "wlan%d"); /* WWAN devices should always be named "wwan%d" */ if ((dev->driver_info->flags & FLAG_WWAN) != 0) strcpy(net->name, "wwan%d"); So by using ETHER | POINTTOPOINT the interface naming is either usb%d or eth%d based on the global uniqueness of the mac address of the device. Without this 2.5gbps ethernet dongles which all seem to use the cdc_ncm driver end up being called usb%d instead of eth%d even though they're definitely not two-host. (All 1gbps & 5gbps ethernet usb dongles I've tested don't hit this problem due to use of different drivers, primarily r8152 and aqc111) Fixes tag is based purely on git blame, and is really just here to make sure this hits LTS branches newer than v4.5. Cc: Lorenzo Colitti Fixes: 4d06dd537f95 ("cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind") Signed-off-by: Maciej Żenczykowski Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/cdc_ncm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 1d3bf810f2ca..04c4f1570bc8 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1900,7 +1900,7 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb) static const struct driver_info cdc_ncm_info = { .description = "CDC NCM", .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET - | FLAG_LINK_INTR, + | FLAG_LINK_INTR | FLAG_ETHER, .bind = cdc_ncm_bind, .unbind = cdc_ncm_unbind, .manage_power = usbnet_manage_power, -- 2.30.2