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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA2D1C56202 for ; Thu, 26 Nov 2020 12:06:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 615B520857 for ; Thu, 26 Nov 2020 12:06:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="HtRRPq+i" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730473AbgKZMFz (ORCPT ); Thu, 26 Nov 2020 07:05:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:59274 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729740AbgKZMFz (ORCPT ); Thu, 26 Nov 2020 07:05:55 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1606392353; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qfe6Fs+qhO9jkLkAXjlgRjsXiH9JcsA0AFbXAJ90WYU=; b=HtRRPq+iqZCFIU/piB/7B6nprx9jcmLASW+mTIeaAN1nYVwaaGP599c4Wm95mZHNi2tTl5 qJCc27UmpT36o8yQoYqt3nl+5LhRjlthTqm8Drku4WonAlv6gv4akupshiRDu/JSnmYoOs RTFuPRmGF/wQZrRJ952XCf9AOLmG+po= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id CD3ABAC22; Thu, 26 Nov 2020 12:05:53 +0000 (UTC) Message-ID: Subject: Re: cdc_ncm kernel log spam with trendnet 2.5G USB adapter From: Oliver Neukum To: Roland Dreier , netdev@vger.kernel.org, linux-usb@vger.kernel.org Date: Thu, 26 Nov 2020 13:05:31 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Am Montag, den 16.11.2020, 09:23 -0800 schrieb Roland Dreier: > Hi, I recently got a 2.5G USB adapter, and although it works fine, the > driver continually spams the kernel log with messages like > > [127662.025647] cdc_ncm 4-1:2.0 enx3c8cf8f942e0: network connection: connected > [127662.057680] cdc_ncm 4-1:2.0 enx3c8cf8f942e0: 2500 mbit/s downlink > 2500 mbit/s uplink > [127662.089794] cdc_ncm 4-1:2.0 enx3c8cf8f942e0: network connection: connected > [127662.121831] cdc_ncm 4-1:2.0 enx3c8cf8f942e0: 2500 mbit/s downlink > 2500 mbit/s uplink > [127662.153858] cdc_ncm 4-1:2.0 enx3c8cf8f942e0: network connection: connected > ... > > Looking at the code in cdc_ncm.c it seems the device is just sending > USB_CDC_NOTIFY_NETWORK_CONNECTION and USB_CDC_NOTIFY_SPEED_CHANGE urbs > over and over, and the driver logs every single one. > > Should we add code to the driver to keep track of what the last event > was and only log if the state has really change? Hi, in theory I suppose we could do that, but it would be kind of stupid. Events like these should be reported to higher layers and not logged at all. Regards Oliver