From patchwork Mon May 20 13:53:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 164643 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp281269oca; Mon, 20 May 2019 06:54:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZa6/VpkU7A+UOFStEX88Nb/xp1bLojKsIkRoaC2jsqZnDbRCOoDMAWZIEWL4avutn5mNN X-Received: by 2002:a62:4d03:: with SMTP id a3mr82139421pfb.2.1558360445495; Mon, 20 May 2019 06:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558360445; cv=none; d=google.com; s=arc-20160816; b=Pzaxfd42XSdcrUxS+uzYizqFkD0DWI6AtJ8piZfAkNakte4c2JXpsrY1qKgpj712ew nbp3A0E/MFiAb+MyHXQ57+dgROkNMIegWlgNJOjOzAklc8MEb6twklgXsXK8jh272E0n ocW3DywqGP1EiYC1LJyEbYMnDItA8F5pxhh3AsQ53lJ34s3Tgxm4veduSYnWfYSxEnBM lu4v9kwcU8wUOWRSt5mc4DODTn9LfkhZieB06RkUfZxn03WI6vYoqIRuCE0toHikhFuZ 8awjVCw4ncO3NqMMnKnZjO1ywSBlmuKybABbbNnIMWKWo6QyOANCfC+xTo213OBo0qOX KmOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qLnbwDX9nYp0llQixdztrdIhtIxceeBj4sRkANMpAsM=; b=tE1q20PUCxL5+BtT2uwvhlpBU1tpXQGgXBHePkqe+RHjdAIuQK2UEAaxYqNU4a9IsL uIYMn7/BlUwsUsVd5oyAnxHpsgZXmBKL/g5Qa6UshxZpWpRfwm44Y6D8EAW8Qgh0/xZ1 XnjlvDlnANfMBIT3ZYFcLEMfjgCD6FobnBAroqbkcGOG1jcK+8oIHYbCILik6Kh8P2lr Vv4Wvxz2c/eWtAxT6sAtm7iVEhUw/2QZ1F5wlCtc5kfKBjSugYayZxFe9fOKPMSap1SZ nm4DhugX8Aw/EaBUTAOtFWeUrAjcSoPp4iZJytshJ1SzX0mCEyKRUqg6rNfCJF7cgSeN Et2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GjImSPDJ; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si1105703pfn.53.2019.05.20.06.54.05; Mon, 20 May 2019 06:54:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GjImSPDJ; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732383AbfETNyD (ORCPT + 9 others); Mon, 20 May 2019 09:54:03 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:33957 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732359AbfETNyC (ORCPT ); Mon, 20 May 2019 09:54:02 -0400 Received: by mail-io1-f65.google.com with SMTP id g84so11097115ioa.1 for ; Mon, 20 May 2019 06:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qLnbwDX9nYp0llQixdztrdIhtIxceeBj4sRkANMpAsM=; b=GjImSPDJy8ShaSr+Kmu8fSik802cD/opDqpkNym+Rodro2w5D8/smsz5ZmejQAI+3y rsMqynEsw+xD73XJE5d+sP0np/oEVRcnrXkMM30Bicl9+VFtXV9SuzefGaTp0w4dWx2d gi5l9+EIC4mBj33w5DZLCU64lejWFarf0dO7qDS6jpd6go9WsencnubQbU03VtsuVQGB Wi/mc7Rfz9MNa5VQGnlpXL+mSKXz08kZGb2y304tqMZ88wLNA/kRxIWRufMs4aVFw1eg THnozwMZuhU1xKj5vFnIDhkCPEcKJuuwv5I1KzcdIDa2FRbX69m2+OO9aXrAu/pemwyP obCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qLnbwDX9nYp0llQixdztrdIhtIxceeBj4sRkANMpAsM=; b=V0Bc4FFxT0wIX8NjC0ys/pTZCDLPbNEC2dEI57W7SJ2Dr2LYImydQnyKa074iARx0c DbWKx0kDpJy+cl2ivXBn3T5uBur41JOx+T8QVe4cNRPZqH4g30OnRvHfJvArPDwKlw7g ZfPlgJQSPpn6kbmdPAADc1tiFULLhHdof2phgsRVZTArujc5rgZ0zQi6BrAQZjcSzvjj nV/C4626Xoh/5KOi+4rl2x//NiYTcDnIR/T+RzfHfCWW3GSx1y4JBr8TfKWTxCriHVk0 UXesONjZk9gnCZ16TEsmhbWaO0a4ktneg/QJox7iTqPkfnLoIJoXbmamppEPIuE9BY3w ZtGQ== X-Gm-Message-State: APjAAAVxTr9BHKxe/HtJLNjyifCA/Q574q+QGg+qiCo/u7llYH8nMbJB ImfPiQxKOQoAvIFrL/wSf2Wocw== X-Received: by 2002:a6b:f305:: with SMTP id m5mr40986039ioh.271.1558360441814; Mon, 20 May 2019 06:54:01 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id n17sm6581185ioa.0.2019.05.20.06.54.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 06:54:01 -0700 (PDT) From: Alex Elder To: arnd@arndb.de, subashab@codeaurora.org, david.brown@linaro.org, agross@kernel.org, davem@davemloft.net Cc: bjorn.andersson@linaro.org, ilias.apalodimas@linaro.org, cpratapa@codeaurora.org, syadagir@codeaurora.org, evgreen@chromium.org, benchan@google.com, ejcaruso@google.com, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] net: qualcomm: rmnet: fix struct rmnet_map_header Date: Mon, 20 May 2019 08:53:47 -0500 Message-Id: <20190520135354.18628-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520135354.18628-1-elder@linaro.org> References: <20190520135354.18628-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The C bit-fields in the first byte of the rmnet_map_header structure are defined in the wrong order. The first byte should be formatted this way: +------- reserved_bit | +----- cd_bit | | v v +-----------+-+-+ | pad_len |R|C| +-----------+-+-+ 7 6 5 4 3 2 1 0 <-- bit position But the C bit-fields that define the first byte are defined this way: u8 pad_len:6; u8 reserved_bit:1; u8 cd_bit:1; And although this isn't portable, I can state that when I build it the result puts the bit-fields in the wrong location (e.g., the cd_bit is in bit position 7, when it should be position 0). Fix this by reordering the definitions of these struct members. Upcoming patches will reimplement these definitions portably. Signed-off-by: Alex Elder --- drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h index 884f1f52dcc2..b1ae9499c0b2 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h @@ -40,9 +40,9 @@ enum rmnet_map_commands { }; struct rmnet_map_header { - u8 pad_len:6; - u8 reserved_bit:1; u8 cd_bit:1; + u8 reserved_bit:1; + u8 pad_len:6; u8 mux_id; __be16 pkt_len; } __aligned(1); From patchwork Mon May 20 13:53:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 164648 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp281634oca; Mon, 20 May 2019 06:54:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyro+fYvk1X1zQBR7ST9pDVq6a1IYYWGJegP71GH2Q0jQ7M/RMndOZd8OCInkbfGoUUH2Mq X-Received: by 2002:a63:4c06:: with SMTP id z6mr74989879pga.296.1558360466533; Mon, 20 May 2019 06:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558360466; cv=none; d=google.com; s=arc-20160816; b=fVq+VZdMxHnM+lAPL0A3lez7GMdPUaetDYsHwa/HZ+DwsqUifu0adknSac9Bw/1oFG bqWAy1Y09mPqsZveGbvTG82U6gvMOzzY1+FdI6Qhi4319moiKBqWvir4x9XopN4zo/Wd adVK01su0rxkVwaCQ5QaJlZYsOrBhkk7voJZmPgN79aj5jy6PLfQu8PJgPwV0m0+ywtF SbS/a3r2BEKXyjR3DKPT3NF7A+4uIBgGMgSAJrN8pAClJM3VL7d98glgZD9n89ZZFRoj FTOHG1+EhxqsmKilMdYSwloPC1beeuQHVKn7WajtYONLbsU9k3M8ia2qZMCwEqocfv5g oAvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XZw+WK9Ep7KnMxZda1w63yeDixvAfUhz3fm/WPmj3DA=; b=ZHuwVP8to5LfJf1YegmwCLzQdaQIaKwZFnAS1icfGQfFDSRPsIiCJGJoEwTma8eTcY D2XLpYuDjSurSL76gulawM3tqBT5JYnU2ksRdZ9SaIOrfz5z0cjVeNeeX3csNn3aFNbg vKb+2NmRGotDgKA96x1rVCsEW3F3gaTTWkESLX9S3ENHpszVyU7M7kS0MYPhwBqCL+nH eI4EgO3/R8o/Re0304mGOQic1nMIfNjnS7DEj66/BSXOYpCLRWdKZ9BBArtrtH2xvlDF NHLgbh77g5Nl0F7ejidx7UJqGggBTSL5OxCpj4vqgx+AvqpSG2lwdpaPPyX/Rk2PY+q/ 9pkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S4enJUEK; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si3336589pgk.442.2019.05.20.06.54.26; Mon, 20 May 2019 06:54:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S4enJUEK; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390331AbfETNyI (ORCPT + 9 others); Mon, 20 May 2019 09:54:08 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:40421 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389909AbfETNyG (ORCPT ); Mon, 20 May 2019 09:54:06 -0400 Received: by mail-io1-f66.google.com with SMTP id s20so11072119ioj.7 for ; Mon, 20 May 2019 06:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XZw+WK9Ep7KnMxZda1w63yeDixvAfUhz3fm/WPmj3DA=; b=S4enJUEKqFT864sg1x+pjeXgA0rFex1SjESZsKd844hf6PlYJ/lInrfNmqEOqguWGV v/sA7bU/54p49Ul0mvtJoPCOE4RERlcCeEBgAqc6ixOlHzs9JxA3+4UmpSrMF15qrVL5 6XXbFTmgqIj+AIG2gMq/b85nHyGwQmD7fjftL9zhgNLDHE2/2RNMbuNJF7lg+nfa+HBP 10QEAwZN8k1AujAVFImb8YygjOKw2R+LlOE/RaKW8s5jIF9udsX2bzYc/O82HtUZr9ru NeLcGUtoPpNTkEHUelSE+L8Cms+GBrnjrD0zj6HCa/uvbBIzG64241jGNG22J3CqfMc9 U4KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XZw+WK9Ep7KnMxZda1w63yeDixvAfUhz3fm/WPmj3DA=; b=i42P3fIO3rEsL1Oa9Q//b0CZTK+706Zp76HVyQGWPdPVE1dc32EDIpC/mLK8EMvewf 6BtT81oetjt6ZWis8foAU0j0FIpx8TziPqwr/OF7tCJyFvlaI7143UCK3Ea+s+6KMln0 x1dnaRD+4aI59tQ8+THl7gNDNSFP4fJO6un/wyVOqNlSNyDLaSbi/MiWwOgpUS0aOGAG 0IRS6wR95zXwtyfLP/vKn24+RE4YYJgXn5jrwSnsN8C3cy6VcmYFRN4bdnDHP61I/kqe bRaHtnJThz0oUbWFgXUAVRN4xTUjoKa+VKeIoruJbJr8ijJtxEh2S8R8tHVLXfackNZ0 oBbg== X-Gm-Message-State: APjAAAXZidgk4xn0hC7ZM9YHvsLF6kxJyDQrKioAr5xewxVWmBkrISMR DUTArnf5SUhLpMKAr66m01Z1SQ== X-Received: by 2002:a05:6602:4e:: with SMTP id z14mr14015532ioz.93.1558360445436; Mon, 20 May 2019 06:54:05 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id n17sm6581185ioa.0.2019.05.20.06.54.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 06:54:04 -0700 (PDT) From: Alex Elder To: arnd@arndb.de, subashab@codeaurora.org, david.brown@linaro.org, agross@kernel.org, davem@davemloft.net Cc: bjorn.andersson@linaro.org, ilias.apalodimas@linaro.org, cpratapa@codeaurora.org, syadagir@codeaurora.org, evgreen@chromium.org, benchan@google.com, ejcaruso@google.com, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] net: qualcomm: rmnet: don't use C bit-fields in rmnet checksum header Date: Mon, 20 May 2019 08:53:50 -0500 Message-Id: <20190520135354.18628-5-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520135354.18628-1-elder@linaro.org> References: <20190520135354.18628-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Replace the use of C bit-fields in the rmnet_map_ul_csum_header structure with a single integral structure member, and use field masks to encode or get values within that member. Note that the previous C bit-fields were defined with CPU local endianness. Their values were computed and then forecfully converted to network byte order in rmnet_map_ipv4_ul_csum_header(). Simplify that function, and properly define the new csum_info member as a big endian value. Make similar simplifications in rmnet_map_ipv6_ul_csum_header(). Signed-off-by: Alex Elder --- .../net/ethernet/qualcomm/rmnet/rmnet_map.h | 9 ++-- .../ethernet/qualcomm/rmnet/rmnet_map_data.c | 50 ++++++++----------- 2 files changed, 26 insertions(+), 33 deletions(-) -- 2.20.1 diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h index a56209645c81..f3231c26badd 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h @@ -60,11 +60,14 @@ struct rmnet_map_dl_csum_trailer { struct rmnet_map_ul_csum_header { __be16 csum_start_offset; - u16 csum_insert_offset:14; - u16 udp_ip4_ind:1; - u16 csum_enabled:1; + __be16 csum_info; /* RMNET_MAP_UL_* */ } __aligned(1); +/* NOTE: These field masks are defined in CPU byte order */ +#define RMNET_MAP_UL_CSUM_INSERT_FMASK GENMASK(13, 0) +#define RMNET_MAP_UL_CSUM_UDP_FMASK GENMASK(14, 14) /* 0: IP; 1: UDP */ +#define RMNET_MAP_UL_CSUM_ENABLED_FMASK GENMASK(15, 15) + #define RMNET_MAP_COMMAND_REQUEST 0 #define RMNET_MAP_COMMAND_ACK 1 #define RMNET_MAP_COMMAND_UNSUPPORTED 2 diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c index 10d2d582a9ce..72b64114505a 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c @@ -207,22 +207,18 @@ rmnet_map_ipv4_ul_csum_header(void *iphdr, struct rmnet_map_ul_csum_header *ul_header, struct sk_buff *skb) { - struct iphdr *ip4h = (struct iphdr *)iphdr; - __be16 *hdr = (__be16 *)ul_header, offset; + struct iphdr *ip4h = iphdr; + u16 offset; + u16 val; - offset = htons((__force u16)(skb_transport_header(skb) - - (unsigned char *)iphdr)); - ul_header->csum_start_offset = offset; - ul_header->csum_insert_offset = skb->csum_offset; - ul_header->csum_enabled = 1; + offset = skb_transport_header(skb) - (unsigned char *)iphdr; + ul_header->csum_start_offset = htons(offset); + + val = u16_encode_bits(skb->csum_offset, RMNET_MAP_UL_CSUM_INSERT_FMASK); + val |= RMNET_MAP_UL_CSUM_ENABLED_FMASK; if (ip4h->protocol == IPPROTO_UDP) - ul_header->udp_ip4_ind = 1; - else - ul_header->udp_ip4_ind = 0; - - /* Changing remaining fields to network order */ - hdr++; - *hdr = htons((__force u16)*hdr); + val |= RMNET_MAP_UL_CSUM_UDP_FMASK; + ul_header->csum_info = htons(val); skb->ip_summed = CHECKSUM_NONE; @@ -249,18 +245,16 @@ rmnet_map_ipv6_ul_csum_header(void *ip6hdr, struct rmnet_map_ul_csum_header *ul_header, struct sk_buff *skb) { - __be16 *hdr = (__be16 *)ul_header, offset; + u16 offset; + u16 val; - offset = htons((__force u16)(skb_transport_header(skb) - - (unsigned char *)ip6hdr)); - ul_header->csum_start_offset = offset; - ul_header->csum_insert_offset = skb->csum_offset; - ul_header->csum_enabled = 1; - ul_header->udp_ip4_ind = 0; + offset = skb_transport_header(skb) - (unsigned char *)ip6hdr; + ul_header->csum_start_offset = htons(offset); - /* Changing remaining fields to network order */ - hdr++; - *hdr = htons((__force u16)*hdr); + val = u16_encode_bits(skb->csum_offset, RMNET_MAP_UL_CSUM_INSERT_FMASK); + val |= RMNET_MAP_UL_CSUM_ENABLED_FMASK; + /* Not UDP, so that field is 0 */ + ul_header->csum_info = htons(val); skb->ip_summed = CHECKSUM_NONE; @@ -400,8 +394,7 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb, struct rmnet_map_ul_csum_header *ul_header; void *iphdr; - ul_header = (struct rmnet_map_ul_csum_header *) - skb_push(skb, sizeof(struct rmnet_map_ul_csum_header)); + ul_header = skb_push(skb, sizeof(*ul_header)); if (unlikely(!(orig_dev->features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)))) @@ -428,10 +421,7 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb, } sw_csum: - ul_header->csum_start_offset = 0; - ul_header->csum_insert_offset = 0; - ul_header->csum_enabled = 0; - ul_header->udp_ip4_ind = 0; + memset(ul_header, 0, sizeof(*ul_header)); priv->stats.csum_sw++; }