From patchwork Fri Apr 26 09:24:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slark Xiao X-Patchwork-Id: 13644445 X-Patchwork-Delegate: kuba@kernel.org Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D654013C838; Fri, 26 Apr 2024 09:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.50.220 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714123561; cv=none; b=QEIEYfzJcdykqvEulmo5lEcwQTfCJB7ZkJ+J9+KPIjmgy4wMk2kTJiKah9kgv+LI1id2NX+DCbkeKHewHuJqijDRheDUvnL2RVoaEpl2zvR8L+tiulOe1otm67/gqKaZxmtPOxJCGTDRTJLNXV+o1XxEJQZ3dGEjeMjPLM2Dgq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714123561; c=relaxed/simple; bh=rp94rzmBiWYwRT1Xe9//2+dGBGbcwQT69S3QZcWHhbc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NtNwmK+fkjMG498GgYM7fTAAEO1Psn/FROHwRpFarnOqdrqbKBzqdDLAgnByROE/ZN9KfegestAOf2VBmFr+isGdwOsO91kN5ByFb8cGU+J21xGQMiSe+YjUw4pZrE3cNAuJkRlv1MrIoNnam3Kycwr3eX2xpBrIjY5rTCttXWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=DriDzvnH; arc=none smtp.client-ip=45.254.50.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="DriDzvnH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=ac8Ot BpdXETb5u8j8PCiiZkMHIEDlMdWPHdK4ooOeGY=; b=DriDzvnHjrY+bGS417Fpf MqinJ2/Lr3xAt/nI9aHCUjJHLhQsvJrFpYu38cEBn1Kv0PrRFdmdJsij2jFh5zgk qn6aIf9q9ewZYsrs7K8EG2Gq8HHi2oxVFXMbeJBQPj9DiUsQWGHLB6ICAL1DCXXc SBPfj5XaheRUIiNyG4x87M= Received: from localhost.localdomain (unknown [112.97.48.208]) by gzga-smtp-mta-g0-3 (Coremail) with SMTP id _____wD3v3Tecitm5obCCQ--.37650S2; Fri, 26 Apr 2024 17:24:48 +0800 (CST) From: Slark Xiao To: loic.poulain@linaro.org, ryazanov.s.a@gmail.com, johannes@sipsolutions.net Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Slark Xiao , Hariprasad Kelam Subject: [PATCH net v2] net: wwan: Fix missing net device name for error message print Date: Fri, 26 Apr 2024 17:24:44 +0800 Message-Id: <20240426092444.825735-1-slark_xiao@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wD3v3Tecitm5obCCQ--.37650S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxAF4xCw13Cw45Wr43JF1kKrg_yoW5Cw1Upa y7K3sxZr18Jay7X3WUJrWkZFWFywn5ta47Kry2v3WSvF1ayrWUWa4fJF95uw43ta1rAw17 tF4a9anxW3ZrG3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piHa0PUUUUU= X-CM-SenderInfo: xvod2y5b0lt0i6rwjhhfrp/1tbiowPMZGVODGqReQAAst X-Patchwork-Delegate: kuba@kernel.org 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. 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"); 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; }