Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3891209pxv; Mon, 28 Jun 2021 15:52:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6E2el+BJADwvEjXut0cerW5IMagnP6W3n+qk2tWMADa0mX2z+sHw9/hwBzCqM3TXuwTAN X-Received: by 2002:a05:6e02:109:: with SMTP id t9mr19424150ilm.235.1624920738797; Mon, 28 Jun 2021 15:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624920738; cv=none; d=google.com; s=arc-20160816; b=Ld6hEUgFNE1bT5H9dydeFMyKxs2MpOqRGRfh82p88HbTeKfphZVo70XoNkb+JseR25 VFwBN+gX+RZ1Wuf4xM4ZhibJT/P6Dg/X4Ms/mCFrFzBwCRhupXKQg8qeBYBss99vkNfe /V6Ek5vtk822w545eqzkh3Z5inxVDYyqKhNixV8bswVbCcxAS4Ub/wu85Tcunuror7l4 +dLA/XXp4y3TuH+LKIDqVk6DfVEtQpAdt3O1H4yVZ6WXN+6DvUBG/Kog36RaaT2FcU49 akkCvTRvxqXBB+L4GTL1qVHRqAslUdtPHLZeDy3jVvM5qj43WIeUxZXzxX7c/H65kKDp JhLQ== 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:date:subject:cc:to:from :dkim-signature; bh=DXeaSMXXG81tp0Y48R0GfABZ2NcuL7MmDjhXDNF1rrs=; b=oFGuB7hCjnySXbvA5btFlMPjKm7np/uBbCBw4rx7C5QdIMnp0dcpLNPngoFbCmg8YB nGagaJwJC1md+83N1yuSaU0VxzN1sJkWQWLn3GWO84UYMWAEFL4x87HmAe0J/topoHmk 3mcxdVxJHyxVhzT4NAehq8LQNtjZIAAiMEfwOERqNzlvXsDil09h6AbGgo8N1iEhayxV kS6+Zs/56ZtoN7JZPIDkbEe4o4Krd+hnqU8n8WP5aINNOqOb1svG1iYffOmiO6OBZIZE gJeEIabZfiqXBC04RY9HJ3pzZRCBZygCEU75PzgBBzLUn+gdvA5yJzvvaxaFfzRrA+lZ ERkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FwZaTAHt; 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 t21si13676262jai.3.2021.06.28.15.52.04; Mon, 28 Jun 2021 15:52:17 -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=@kernel.org header.s=k20201202 header.b=FwZaTAHt; 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 S234645AbhF1P3I (ORCPT + 99 others); Mon, 28 Jun 2021 11:29:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:39694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235914AbhF1PET (ORCPT ); Mon, 28 Jun 2021 11:04:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A60C761CEE; Mon, 28 Jun 2021 14:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891397; bh=o8Hz7UJvOrtvpb2IIfsBlXuBI7nkPo2JqjhWVsSnWaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FwZaTAHtvoECep/xTdsSacB+R3rDv/tfhcBJgimlnu80DVpGNcAX+d4V3o/YMPjOk Lrw51h9GecKD+ME3cfxFLHICp/uprakYysHx4dvoumbrRN/b97dYd0q5FFQGa1YBhQ uNceP86uWOYuG3W571O8V79L9yIBMbEu7gOq9qJ5lPUF5sGrRo0Tg6Q7cvXofrvW7O Rgx4kkjYXbNy7uczktMdKiUR1pxZ1+t0LeJOy2l6GsVTBS2SXVA+w4pSiIkWROM59U QFYDAwrM+VF0FneHAM4/Zk6z4g+pq8MIYwpb7j+DWjGJoAMseGkxFeTs6OMSLBb5Wl M0DZ/SMPjEO+Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , Lorenzo Colitti , "David S . Miller" , Sasha Levin Subject: [PATCH 4.4 22/57] net: cdc_ncm: switch to eth%d interface naming Date: Mon, 28 Jun 2021 10:42:21 -0400 Message-Id: <20210628144256.34524-23-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144256.34524-1-sashal@kernel.org> References: <20210628144256.34524-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.274-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.4.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.4.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:42+00:00 X-stable: review X-Patchwork-Hint: Ignore 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 8de7797ea7e7..8bef8c3dd2a3 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1580,7 +1580,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