Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp205191lqf; Fri, 26 Apr 2024 04:33:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOJsji8umcX27ylV0sYY5I/JHAF7JTbvHwa+9T8U8pogIyapwI1Dalv4ZPcJZb3wJFkTAqfy1ijU7H0MnTh+UsKC9G7WXowf82XIXMKQ== X-Google-Smtp-Source: AGHT+IGcvWDYZGvqzYhw+rje+mP08NWrC0g1ip69NJnKUs8cF4y0nULgP5sGBRfImta9wEc5bSAZ X-Received: by 2002:a05:6870:171d:b0:222:5ff6:43f1 with SMTP id h29-20020a056870171d00b002225ff643f1mr2556087oae.16.1714131202774; Fri, 26 Apr 2024 04:33:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714131202; cv=pass; d=google.com; s=arc-20160816; b=Gz/GSkvXnxBeOYTX8WYvlrrgNkQyAZKorLg3mr0JFeFTHRcTSUzGdfQhb0TqWXo1na cv5WOAEx9ZM0u5PF8qgbGN7TDmKzwOOVL4M6azCXz+9t7JDeH2cZ/HVugHfUX8DqmNiT sSQ4HsCBNlOfAutxRVgVYFBI7y9YtxHskN6ov6XOAIma4q/xB9/ZXA9T8/MhpPPCeOR9 jT8LxVP96cb0nwBW5xErolfd26mMD070C0+FwDpFkavc6DV3NciwptL4QW+LjSKsQrMI ugOwqgkcZ3vnfh9izNYCCWlqQKf29Mdz+U6fR8wji4ADyKfwTzfmWc8iaa0/Fi46LFRk hTUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DAxZtDWunLrbApHdmQojPuCJgA5oa4jSx3wfchhqKB4=; fh=HEWEanUohXFNRCbqlxNO2m/6sVMFPQq3B47Wbb1Lojk=; b=S9arePpCMBWVJpYC8rTPcTZZaSqEzQ6yUbT1W3VYuVEO912Ew81JQdljZ0ufm71HUC d8o4m52/+/J25IyQSZ0o4uE7/ba30NFNXYnU6kN09KDIgALRPGt1aGlDDWVZJS4B3h09 7tr42JI0ptFaCJW1Q91tJ2SG5bqUIC+jkmiL+8NhHvY/uub5o+R963O2fzgG7U/A09fy Zl3Kk4WTRfakfuio5TRmhG/ECgJQOIuwP+b9QGl3RMe1MiXOHR0IInUloL6MytZQfYJh psYQ6lxdRRYZ5JE8Yzb0nO/gZa3Nd0ViJliGVuOmBuP9R98BfHh94edGHtzOYUPzrKaq OAyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=0QHVck+5; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-159939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159939-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m123-20020a633f81000000b005f7fdbca98csi12881100pga.76.2024.04.26.04.33.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 04:33:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=0QHVck+5; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-159939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159939-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1ECEAB2229E for ; Fri, 26 Apr 2024 11:33:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E36014533C; Fri, 26 Apr 2024 11:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="0QHVck+5" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CA5F144D24 for ; Fri, 26 Apr 2024 11:33:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714131190; cv=none; b=hu2YgcRJ9FrsMMJfLXw1652YUn7imDf4jo8nNaRSSQucbzqsGpEqyGZy2TNRFr6tIN3rPkQme/OdLEZjKD7OsyRGLEqFEbTkCuTV3HaqqJkjKVfFljppC7ncQtIqcripDF3Uc3uhv7EEdpEvdndVdd3hoU5lV7B1aifvwshpCyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714131190; c=relaxed/simple; bh=geBqZPdJKBHdolO8PO7FM1jSAd+Io8kVp5K3TQpvuP8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ScMbARxREf4Utb6TdUOv1EiTeK3nQ2vO5ilnQy+Ogb8KuvOE/SwNebL2VPyxLOjZlKudw+9ecmy9XTTItgp+/u15YzEYlnW8/LM39ccZvdLLFUS1Vnex8DsIdc5gsUmBmBQij5U9gCyVhtYlllOeudGu88RDGuGbtVq339nKdsA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b=0QHVck+5; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2d87660d5c9so22665881fa.2 for ; Fri, 26 Apr 2024 04:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1714131187; x=1714735987; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DAxZtDWunLrbApHdmQojPuCJgA5oa4jSx3wfchhqKB4=; b=0QHVck+5wxVXzmxM0Bkk50aFP3iINnDadIsTn03Fx7xe116VMKdCV86MiR4kYy/o7A F0MGtraJVOgtujpDP3/N9P6joJSHof4Z/JNMr+lljn7ld/z38/O1snCvoS094uCwqRnk 1J0i0+zPxCxl5LmG7M6gYcULlQyyF1TmMQ1yLYVJLs8xqdTQhGjWDFaNQMhDSlJ5uajT E/AXQoJsrnYs5RuReWIKnBjq89L6yI2PYxGP0H3Aesy1+uxoe0FqxszGBipBdtIkLT1q zBUk+OuVduvsGDJhaZzcYHEDNZWEUDWztnJWpgHEGwA8RjNHYmdZDQGkqWxRl0GJjWR5 ZIrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714131187; x=1714735987; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DAxZtDWunLrbApHdmQojPuCJgA5oa4jSx3wfchhqKB4=; b=plTotkpiXS4OTCxE45HsCrh5r1AY3rhl6706bxbtStMBm2M7SEuk/vJR0aMTu+uRDA cK2dljv2qCSpcXpCqxdwH8R67HpR5vJIbBXnc/OIf6Px+24/oL8PL7F7RDgyJ8yLuHpG 4ZAoKhGZoQyItEWqOkV4w2NFFruEKlmVNKdDFlm/bqctTCAJXqS5SJ/BVSt+vWsIoTVW /LZuBrdAkbwUGLCV0FaNvb9J+vqE/9J3GelvONK2jqPasW3Q2z5UxvwRzpep53hQVDo9 ePZK0S2KjtNuaTjqfUnrb/K4Z62iI8k/uXFQc2vnrhHMIaz6wS7GWrIMgj/zwGol6cgC ptRQ== X-Forwarded-Encrypted: i=1; AJvYcCUoO4R4WvOXMVy6hzwMaZKkEaaPaKgArI7MRoO5c+oslN2jgbIW6WTGUObsj0KFQe7mtS7nPeFzNWsLJjSd+/z18xsxFhQ/4jGP/bAh X-Gm-Message-State: AOJu0YwChaqTUtjns+6hRsgZPYlrnSIH+rMiKlwf06HHyFREV7AqNcuQ ztAt5QHN7epcu/0QXx5yLrnpVgoWTaqq+gJIa+vBkyjgw/ShWhv7/6tPFxq4Sro= X-Received: by 2002:a05:651c:155:b0:2dd:cb34:ddbc with SMTP id c21-20020a05651c015500b002ddcb34ddbcmr2107369ljd.48.1714131186378; Fri, 26 Apr 2024 04:33:06 -0700 (PDT) Received: from localhost (89-24-35-126.nat.epc.tmcz.cz. [89.24.35.126]) by smtp.gmail.com with ESMTPSA id i13-20020a05600c354d00b00419fba938d8sm21958029wmq.27.2024.04.26.04.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 04:33:05 -0700 (PDT) Date: Fri, 26 Apr 2024 13:33:04 +0200 From: Jiri Pirko To: Slark Xiao Cc: loic.poulain@linaro.org, ryazanov.s.a@gmail.com, johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Hariprasad Kelam Subject: Re: [PATCH net v2] net: wwan: Fix missing net device name for error message print Message-ID: References: <20240426092444.825735-1-slark_xiao@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240426092444.825735-1-slark_xiao@163.com> Fri, Apr 26, 2024 at 11:24:44AM CEST, slark_xiao@163.com wrote: >In my local, I got an error print in dmesg like below: >"sequence number glitch prev=487 curr=0" >After checking, it belongs to mhi_wwan_mbim.c. Refer to the usage >of this net_err_ratelimited() API in other files, I think we >should add net device name print before message context. You don't add dev device name, but rather constant string. > >Fixes: aa730a9905b7 ("net: wwan: Add MHI MBIM network driver") >Signed-off-by: Slark Xiao >Reviewed-by: Hariprasad Kelam >--- > drivers/net/wwan/mhi_wwan_mbim.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c >index 3f72ae943b29..6cefee25efc4 100644 >--- a/drivers/net/wwan/mhi_wwan_mbim.c >+++ b/drivers/net/wwan/mhi_wwan_mbim.c >@@ -186,14 +186,14 @@ static int mbim_rx_verify_nth16(struct mhi_mbim_context *mbim, struct sk_buff *s > > if (skb->len < sizeof(struct usb_cdc_ncm_nth16) + > sizeof(struct usb_cdc_ncm_ndp16)) { >- net_err_ratelimited("frame too short\n"); >+ net_err_ratelimited("mbim: frame too short\n"); Does not make any sense. If you have multiple instances of mbim, you are still clueless. You can access netdevice, print out the name as other net_err_ratelimited() instances do. Btw, it would be more correct to use netdev_err(), but there is no "ratelimited" variant of that. Perhaps better to introduce it. pw-bot: cr > return -EINVAL; > } > > nth16 = (struct usb_cdc_ncm_nth16 *)skb->data; > > if (nth16->dwSignature != cpu_to_le32(USB_CDC_NCM_NTH16_SIGN)) { >- net_err_ratelimited("invalid NTH16 signature <%#010x>\n", >+ net_err_ratelimited("mbim: invalid NTH16 signature <%#010x>\n", > le32_to_cpu(nth16->dwSignature)); > return -EINVAL; > } >@@ -201,7 +201,7 @@ static int mbim_rx_verify_nth16(struct mhi_mbim_context *mbim, struct sk_buff *s > /* No limit on the block length, except the size of the data pkt */ > len = le16_to_cpu(nth16->wBlockLength); > if (len > skb->len) { >- net_err_ratelimited("NTB does not fit into the skb %u/%u\n", >+ net_err_ratelimited("mbim: NTB does not fit into the skb %u/%u\n", > len, skb->len); > return -EINVAL; > } >@@ -209,7 +209,7 @@ static int mbim_rx_verify_nth16(struct mhi_mbim_context *mbim, struct sk_buff *s > if (mbim->rx_seq + 1 != le16_to_cpu(nth16->wSequence) && > (mbim->rx_seq || le16_to_cpu(nth16->wSequence)) && > !(mbim->rx_seq == 0xffff && !le16_to_cpu(nth16->wSequence))) { >- net_err_ratelimited("sequence number glitch prev=%d curr=%d\n", >+ net_err_ratelimited("mbim: sequence number glitch prev=%d curr=%d\n", > mbim->rx_seq, le16_to_cpu(nth16->wSequence)); > } > mbim->rx_seq = le16_to_cpu(nth16->wSequence); >@@ -222,7 +222,7 @@ static int mbim_rx_verify_ndp16(struct sk_buff *skb, struct usb_cdc_ncm_ndp16 *n > int ret; > > if (le16_to_cpu(ndp16->wLength) < USB_CDC_NCM_NDP16_LENGTH_MIN) { >- net_err_ratelimited("invalid DPT16 length <%u>\n", >+ net_err_ratelimited("mbim: invalid DPT16 length <%u>\n", > le16_to_cpu(ndp16->wLength)); > return -EINVAL; > } >@@ -233,7 +233,7 @@ static int mbim_rx_verify_ndp16(struct sk_buff *skb, struct usb_cdc_ncm_ndp16 *n > > if (sizeof(struct usb_cdc_ncm_ndp16) + > ret * sizeof(struct usb_cdc_ncm_dpe16) > skb->len) { >- net_err_ratelimited("Invalid nframes = %d\n", ret); >+ net_err_ratelimited("mbim: Invalid nframes = %d\n", ret); > return -EINVAL; > } > >-- >2.25.1 > >