From patchwork Thu Nov 24 10:37:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, M Chetan" X-Patchwork-Id: 13054817 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A82DAC43219 for ; Thu, 24 Nov 2022 10:39:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiKXKjK (ORCPT ); Thu, 24 Nov 2022 05:39:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiKXKjJ (ORCPT ); Thu, 24 Nov 2022 05:39:09 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226AF205E8 for ; Thu, 24 Nov 2022 02:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669286349; x=1700822349; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=gK9lJEPQhoeKGmn0SLkYFb/fwQG86BGbl4bBaAYLIFs=; b=Z8FRdpPqhu8Ymu3l9Aarq44o/ozQItYfL8vwZheeD1DlrbsoYTDg1Zp0 WPvG+1zqbvcR8P+ME2gfLrJ5x035uVebrkESpu9fEk5j+wPPIxSVrO813 SuJF3ACkbVIDpL7WSP95cWpZ0RkX/NVTUWf0BTm1/3/kMIDT00aX4znyp JBkDyaKsS9e+cNLpawrLC2qo/3EnJDysbALCu1w04idzv3XPtjH4axtBX AXPlw1liU+TesvLn7K1CoAFANLnV3yTWsffDIrjTJIkJ/qnKBnIv7/VPR KyBnlPsIhlaSum1UyNx9JeuM0eidIoL0FJlAhiF6/JdRqYKqCFnxY2DrW A==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="400566435" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="400566435" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 02:37:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="887327832" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="887327832" Received: from bswcg005.iind.intel.com ([10.224.174.166]) by fmsmga006.fm.intel.com with ESMTP; 24 Nov 2022 02:37:54 -0800 From: m.chetan.kumar@linux.intel.com To: netdev@vger.kernel.org Cc: kuba@kernel.org, davem@davemloft.net, johannes@sipsolutions.net, ryazanov.s.a@gmail.com, loic.poulain@linaro.org, m.chetan.kumar@intel.com, linuxwwan@intel.com, edumazet@google.com, pabeni@redhat.com, M Chetan Kumar , kernel test robot Subject: [PATCH v2 net 1/4] net: wwan: iosm: fix kernel test robot reported error Date: Thu, 24 Nov 2022 16:07:46 +0530 Message-Id: <20221124103746.1445987-1-m.chetan.kumar@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: M Chetan Kumar sparse warnings - iosm_ipc_mux_codec.c:1474 using plain integer as NULL pointer. Use skb_trim() to reset skb tail & len. Fixes: 9413491e20e1 ("net: iosm: encode or decode datagram") Reported-by: kernel test robot Signed-off-by: M Chetan Kumar --- v2: No Change. --- drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c index d41e373f9c0a..c16365123660 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c @@ -1471,8 +1471,7 @@ void ipc_mux_ul_encoded_process(struct iosm_mux *ipc_mux, struct sk_buff *skb) ipc_mux->ul_data_pend_bytes); /* Reset the skb settings. */ - skb->tail = 0; - skb->len = 0; + skb_trim(skb, 0); /* Add the consumed ADB to the free list. */ skb_queue_tail((&ipc_mux->ul_adb.free_list), skb); From patchwork Thu Nov 24 10:38:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, M Chetan" X-Patchwork-Id: 13054814 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84ED9C433FE for ; Thu, 24 Nov 2022 10:38:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbiKXKiX (ORCPT ); Thu, 24 Nov 2022 05:38:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbiKXKiT (ORCPT ); Thu, 24 Nov 2022 05:38:19 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DC9524BED for ; Thu, 24 Nov 2022 02:38:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669286297; x=1700822297; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xNsnGsArlsExxKFda04bwU7zhM+RVjgJNREPsBG45lU=; b=f8p+Nj+19TZJ2xgcJ6AWqdnwLcGF0boHAUE+iu/L+Cahv4d6g8c/f5I+ p70UaFn0+bM9R14CPU8AaTuINuIiFY/lJrbWajtrTOi/cQgMfpK8b+4Do Pw1Ez8I+iC07QPVshPwMilbKb8TZmkeFm+owv5iX8zeVLt4fSZTl0ESSj MI4YDZnIdfExSOGE0VjqN0Jv11pWCOFgCE2D6+u5YISQ+US6HMBaIEa7P wXnY/FHNn6KqJHS/NROQN5QiMv8TN596mk4iDrl3MbXjR9O3daOsDCmck FwyGPGu1bHj83hWXmtK5J3I7aykdFE9MJn8FE7KrXHX+zALxZlyWT3s5U g==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="312974982" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="312974982" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 02:38:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="971207486" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="971207486" Received: from bswcg005.iind.intel.com ([10.224.174.166]) by fmsmga005.fm.intel.com with ESMTP; 24 Nov 2022 02:38:09 -0800 From: m.chetan.kumar@linux.intel.com To: netdev@vger.kernel.org Cc: kuba@kernel.org, davem@davemloft.net, johannes@sipsolutions.net, ryazanov.s.a@gmail.com, loic.poulain@linaro.org, m.chetan.kumar@intel.com, linuxwwan@intel.com, edumazet@google.com, pabeni@redhat.com, didi.debian@cknow.org, M Chetan Kumar , Bonaccorso Salvatore Subject: [PATCH v2 net 2/4] net: wwan: iosm: fix dma_alloc_coherent incompatible pointer type Date: Thu, 24 Nov 2022 16:08:03 +0530 Message-Id: <20221124103803.1446000-1-m.chetan.kumar@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: M Chetan Kumar Fix build error reported on armhf while preparing 6.1-rc5 for Debian. iosm_ipc_protocol.c:244:36: error: passing argument 3 of 'dma_alloc_coherent' from incompatible pointer type. Change phy_ap_shm type from phys_addr_t to dma_addr_t. Fixes: faed4c6f6f48 ("net: iosm: shared memory protocol") Reported-by: Bonaccorso Salvatore Signed-off-by: M Chetan Kumar Tested-by: Salvatore Bonaccorso --- v2: No Change. --- drivers/net/wwan/iosm/iosm_ipc_protocol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wwan/iosm/iosm_ipc_protocol.h b/drivers/net/wwan/iosm/iosm_ipc_protocol.h index 9b3a6d86ece7..289397c4ea6c 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_protocol.h +++ b/drivers/net/wwan/iosm/iosm_ipc_protocol.h @@ -122,7 +122,7 @@ struct iosm_protocol { struct iosm_imem *imem; struct ipc_rsp *rsp_ring[IPC_MEM_MSG_ENTRIES]; struct device *dev; - phys_addr_t phy_ap_shm; + dma_addr_t phy_ap_shm; u32 old_msg_tail; }; From patchwork Thu Nov 24 10:38:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, M Chetan" X-Patchwork-Id: 13054815 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74E25C43219 for ; Thu, 24 Nov 2022 10:38:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbiKXKie (ORCPT ); Thu, 24 Nov 2022 05:38:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbiKXKi2 (ORCPT ); Thu, 24 Nov 2022 05:38:28 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D1424BCA for ; Thu, 24 Nov 2022 02:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669286308; x=1700822308; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sM1WwMySYS33bDfk5kqMC3RU4FwCGEpxpHzl9SJrF/s=; b=Ik2bV/4/qQe9203IJEnBwMpKFdZ5Kt3BEtniW51ebowe0H+KRJH7fpB5 ynneKRL46SKifqkoGHabdtK8XaxHxY0KxyobBnSE/XlTuEBE3uwFNfDqP +lAOnZGSUGxoZRNepNqf9f+Ro0fYipDDGYvJLa43JsaJVLJOak6VaN1XB uQ1EC2V/Qolz2bm/Wt0q4EleHzkOTBIp57ErWTgR8KyO83DuGypbO9IHg U6mXpAS68pWAN0mIJDuT5IG9jBVxlMeurgX5fWPN7yuXNYZc1yZShVGcu 9A1lgceFF/wFwFl+ZZCsN4sdaKrBfXJZCPPpg9ELe3uHXF5KA04yu7XSg Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="316096262" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="316096262" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 02:38:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="971207532" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="971207532" Received: from bswcg005.iind.intel.com ([10.224.174.166]) by fmsmga005.fm.intel.com with ESMTP; 24 Nov 2022 02:38:24 -0800 From: m.chetan.kumar@linux.intel.com To: netdev@vger.kernel.org Cc: kuba@kernel.org, davem@davemloft.net, johannes@sipsolutions.net, ryazanov.s.a@gmail.com, loic.poulain@linaro.org, m.chetan.kumar@intel.com, linuxwwan@intel.com, edumazet@google.com, pabeni@redhat.com, M Chetan Kumar Subject: [PATCH v2 net 3/4] net: wwan: iosm: fix crash in peek throughput test Date: Thu, 24 Nov 2022 16:08:17 +0530 Message-Id: <20221124103817.1446013-1-m.chetan.kumar@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: M Chetan Kumar Peek throughput UL test is resulting in crash. If the UL transfer block free list is exhaust, the peeked skb is freed. In the next transfer freed skb is referred from UL list which results in crash. Don't free the skb if UL transfer blocks are unavailable. The pending skb will be picked for transfer on UL transfer block available. Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Signed-off-by: M Chetan Kumar --- v2: No Change. --- drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c index c16365123660..738420bd14af 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c @@ -1207,10 +1207,9 @@ static int mux_ul_dg_update_tbl_index(struct iosm_mux *ipc_mux, qlth_n_ql_size, ul_list); ipc_mux_ul_adb_finish(ipc_mux); if (ipc_mux_ul_adb_allocate(ipc_mux, adb, &ipc_mux->size_needed, - IOSM_AGGR_MUX_SIG_ADBH)) { - dev_kfree_skb(src_skb); + IOSM_AGGR_MUX_SIG_ADBH)) return -ENOMEM; - } + ipc_mux->size_needed = le32_to_cpu(adb->adbh->block_length); ipc_mux->size_needed += offsetof(struct mux_adth, dg); From patchwork Thu Nov 24 10:38:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, M Chetan" X-Patchwork-Id: 13054816 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08D06C433FE for ; Thu, 24 Nov 2022 10:38:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbiKXKix (ORCPT ); Thu, 24 Nov 2022 05:38:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbiKXKiq (ORCPT ); Thu, 24 Nov 2022 05:38:46 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B158E7A358 for ; Thu, 24 Nov 2022 02:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669286323; x=1700822323; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vQ6M/ScGrWch18nOti3VGyscZr0HjS0AnqiKYC+E4Yg=; b=TkZLlu0ALT9dutS/yxTqPLVhDPmy4PzRdMPQ4HuAs2Che8+9QM++dm18 dP5XmwmjSrF9JAaxgxSnliTXV0XPSTYfo5RFAGDD6HT6cAR/wxIHT/pWd GoOi5ryr1xlxgv6tdTDf8N2uzx/YsMMVGrU5FzrskNy300TSWejrHJ6S7 rPOMuMh42HKICp5qQ1wPlC13p2oC7IdWHGuusSBVFt6lL0jbwVfIXb57S eqBWgxfnglOY7CpNG1QeklSnf961LmeVmg2tdiZJUcSgmjzSlJJiTbsMG rv3nVIMM/LoXk3nVNS/IWgbIuzPFrJ6mhPCAYcUnTxL4+XbTP4LAo9dxW Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="293978751" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="293978751" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 02:38:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="619980173" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="619980173" Received: from bswcg005.iind.intel.com ([10.224.174.166]) by orsmga006.jf.intel.com with ESMTP; 24 Nov 2022 02:38:39 -0800 From: m.chetan.kumar@linux.intel.com To: netdev@vger.kernel.org Cc: kuba@kernel.org, davem@davemloft.net, johannes@sipsolutions.net, ryazanov.s.a@gmail.com, loic.poulain@linaro.org, m.chetan.kumar@intel.com, linuxwwan@intel.com, edumazet@google.com, pabeni@redhat.com, M Chetan Kumar Subject: [PATCH v2 net 4/4] net: wwan: iosm: fix incorrect skb length Date: Thu, 24 Nov 2022 16:08:32 +0530 Message-Id: <20221124103832.1446026-1-m.chetan.kumar@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: M Chetan Kumar skb passed to network layer contains incorrect length. In mux aggregation protocol, the datagram block received from device contains block signature, packet & datagram header. The right skb len to be calculated by subracting datagram pad len from datagram length. Whereas in mux lite protocol, the skb contains single datagram so skb len is calculated by subtracting the packet offset from datagram header. Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Signed-off-by: M Chetan Kumar --- v2: fix sparse warnings. --- drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c index 738420bd14af..d6b166fc5c0e 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c @@ -365,7 +365,8 @@ static void ipc_mux_dl_cmd_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb) /* Pass the DL packet to the netif layer. */ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id, struct iosm_wwan *wwan, u32 offset, - u8 service_class, struct sk_buff *skb) + u8 service_class, struct sk_buff *skb, + u32 pkt_len) { struct sk_buff *dest_skb = skb_clone(skb, GFP_ATOMIC); @@ -373,7 +374,7 @@ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id, return -ENOMEM; skb_pull(dest_skb, offset); - skb_set_tail_pointer(dest_skb, dest_skb->len); + skb_trim(dest_skb, pkt_len); /* Pass the packet to the netif layer. */ dest_skb->priority = service_class; @@ -429,7 +430,7 @@ static void ipc_mux_dl_fcth_decode(struct iosm_mux *ipc_mux, static void ipc_mux_dl_adgh_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb) { - u32 pad_len, packet_offset; + u32 pad_len, packet_offset, adgh_len; struct iosm_wwan *wwan; struct mux_adgh *adgh; u8 *block = skb->data; @@ -470,10 +471,12 @@ static void ipc_mux_dl_adgh_decode(struct iosm_mux *ipc_mux, packet_offset = sizeof(*adgh) + pad_len; if_id += ipc_mux->wwan_q_offset; + adgh_len = le16_to_cpu(adgh->length); /* Pass the packet to the netif layer */ rc = ipc_mux_net_receive(ipc_mux, if_id, wwan, packet_offset, - adgh->service_class, skb); + adgh->service_class, skb, + adgh_len - packet_offset); if (rc) { dev_err(ipc_mux->dev, "mux adgh decoding error"); return; @@ -547,7 +550,7 @@ static int mux_dl_process_dg(struct iosm_mux *ipc_mux, struct mux_adbh *adbh, int if_id, int nr_of_dg) { u32 dl_head_pad_len = ipc_mux->session[if_id].dl_head_pad_len; - u32 packet_offset, i, rc; + u32 packet_offset, i, rc, dg_len; for (i = 0; i < nr_of_dg; i++, dg++) { if (le32_to_cpu(dg->datagram_index) @@ -562,11 +565,12 @@ static int mux_dl_process_dg(struct iosm_mux *ipc_mux, struct mux_adbh *adbh, packet_offset = le32_to_cpu(dg->datagram_index) + dl_head_pad_len; + dg_len = le16_to_cpu(dg->datagram_length); /* Pass the packet to the netif layer. */ rc = ipc_mux_net_receive(ipc_mux, if_id, ipc_mux->wwan, packet_offset, - dg->service_class, - skb); + dg->service_class, skb, + dg_len - dl_head_pad_len); if (rc) goto dg_error; }