🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #397

[PATCH net-next v2 4/8] net: qualcomm: rmnet: Restrict supported MAP checksum configurations

#397
From: Subash Abhinov Kasiviswanathan
Date: Thu, 08 Oct 2026 00:55
84 lines
12117 bytes
RmNet only supports three MAP data format configurations: MAPv1 (no
checksum offload), MAPv4 (v4 checksum offload) and MAPv5 (v5 checksum
offload). MAP command support is orthogonal and may be combined with any
of the three. Checksum offload versions are selected independently for
ingress and egress, but only one version may be enabled across the device.
Mixing the v4 and v5 checksum offload flags together, whether on the same
direction or across directions, is not a valid configuration. A direction
may leave checksum offload disabled.

Validate the requested data format in both rmnet_newlink() and
rmnet_changelink() and reject any combination that sets both the v4 and
v5 checksum offload flags at the same time, regardless of direction. This
is in preparation for the next patch where coalescing support needs to be
allowed with MAPv5 format only.

Co-developed-by: Sean Tranchetti <sean.tranchetti@oss.qualcomm.com>
Signed-off-by: Sean Tranchetti <sean.tranchetti@oss.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subash.a.kasiviswanathan@oss.qualcomm.com>
---
v2: 
  - Document the restrictions on invalid combinations of data format as
    reported by Sashiko
v1: https://lore.kernel.org/all/20260930051345.857443-4-subash.a.kasiviswanathan@oss.qualcomm.com/

 .../ethernet/qualcomm/rmnet/rmnet_config.c    | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index e5a6289b018a..b68f5561680f 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -26,6 +26,23 @@ static int rmnet_is_real_dev_registered(const struct net_device *real_dev)
 	return rcu_access_pointer(real_dev->rx_handler) == rmnet_rx_handler;
 }
 
+/* Only three MAP configurations are supported: MAPv1 (no checksum
+ * offload), MAPv4 (v4 checksum offload) and MAPv5 (v5 checksum
+ * offload). MAP command support is orthogonal and permitted with any
+ * of the three. Checksum offload versions are selected independently
+ * for ingress and egress, but only one version may be enabled across
+ * the device. Mixing v4 and v5 checksum flags is not supported.
+ */
+static bool rmnet_config_data_format_valid(u32 data_format)
+{
+	u32 v4_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV4 |
+		      RMNET_FLAGS_EGRESS_MAP_CKSUMV4;
+	u32 v5_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV5 |
+		      RMNET_FLAGS_EGRESS_MAP_CKSUMV5;
+
+	return !(data_format & v4_mask) || !(data_format & v5_mask);
+}
+
 /* Needs rtnl lock */
 struct rmnet_port*
 rmnet_get_port_rtnl(const struct net_device *real_dev)
@@ -151,6 +168,12 @@ static int rmnet_newlink(struct net_device *dev,
 		data_format |= flags->flags & flags->mask;
 	}
 
+	if (!rmnet_config_data_format_valid(data_format)) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "unsupported MAP checksum flag combination");
+		return -EINVAL;
+	}
+
 	ep = kzalloc_obj(*ep);
 	if (!ep)
 		return -ENOMEM;
@@ -337,6 +360,12 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 		flags = nla_data(data[IFLA_RMNET_FLAGS]);
 		data_format = old_data_format & ~flags->mask;
 		data_format |= flags->flags & flags->mask;
+
+		if (!rmnet_config_data_format_valid(data_format)) {
+			NL_SET_ERR_MSG_MOD(extack,
+					   "unsupported MAP checksum flag combination");
+			return -EINVAL;
+		}
 	}
 
 	if (data[IFLA_RMNET_MUX_ID]) {
-- 
2.34.1
Technical Details
Message-ID: <20261008005543.2630828-5-subash.a.kasiviswanathan@oss.qualcomm.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342616-linux-kernel-netdev=dewy.ru
References: <20261008005543.2630828-1-subash.a.kasiviswanathan@oss.qualcomm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342616-linux-kernel-netdev=dewy.ru
From: subash.a.kasiviswanathan@oss.qualcomm.com (Subash Abhinov Kasiviswanathan)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2 4/8] net: qualcomm: rmnet: Restrict supported MAP checksum configurations
Date: Wed,  7 Oct 2026 17:55:41 -0700
Organization: Usenet Network
Message-ID: <20261008005543.2630828-5-subash.a.kasiviswanathan@oss.qualcomm.com>
References: <20261008005543.2630828-1-subash.a.kasiviswanathan@oss.qualcomm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="772066"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Dh+p5Bcj+b3knDUjK+3IEBBbsfA= sha256:C7MysLFSQJLzL2lUYa4pdDP4cRCuO4eOYfjnDZ5F2dc=
	sha1:3TXPSCkEgRY3z4T7mGVEtcOklRE= sha256:DpwvBPODVeXUETtk6WdGim1O0cxWIIVBj7xfoC7EQLs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id DB4C410F296; Thu,  8 Oct 2026 03:57:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=qualcomm.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id hwrBI542VYAE;
	Thu,  8 Oct 2026 03:57:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342616-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=oss.qualcomm.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id DCD1E10F260; Thu,  8 Oct 2026 03:57:44 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id 1274A604215; Thu,  8 Oct 2026 00:57:37 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FD0B2DECBA;
	Thu,  8 Oct 2026 00:57:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="B3Ir5yY9"
X-Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 346972931F5;
	Thu,  8 Oct 2026 00:57:24 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791421045; cv=none; b=UvmKL7h0MCL+t3Wi9Cl2Ao6d/MIG8D969oRG01A41EmYvi1Z/UIoopjUFjc3/n9TUQ/nVGTveesMzFrazuy5ijeXuDZ+WIMBFA/A9HODDMeaeKUVtDEwKIaj9wkbdXvx4sdGXmLyYp+rDdpPNJVz2/i+l4FXEpiMPqPoprCiQGA=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791421045; c=relaxed/simple;
	bh=qdJTaDfH3BztnEtjcsHe5mUeJu5bz79Nx6u7CBjjNB8=;
	h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
	 MIME-Version; b=YZu97v8FX0vd8jdffdM932+CpqcB0NcUHOogGA8UJynTNahZwBuguR9iCQE0BwcxKby4X9uJotzTpJC1RPBeREJdxoCcPJSTooUrCc4f+oulu60sRvTCZ/lamhk2BHCPdDxouohb/LO3POYHkaehd7ZmIKE/RzuJiwFOnpqAZsQ=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=B3Ir5yY9; arc=none smtp.client-ip=205.220.180.131
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com
X-Received: from pps.filterd (m0279873.ppops.net [127.0.0.1])
	by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 697LtcWF851364;
	Thu, 8 Oct 2026 00:56:59 GMT
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=qcppdkim1; bh=QZKJ0cvKRzA
	//5i3ewOfc/Z+bAN4D5zHwLEhtF2ML8g=; b=B3Ir5yY9N7uYVFMsZSbveSxI2HX
	oY0Y5fe7UP+MgSopGQ/vo+HXCnOZQ+dpzZkO6PIZvneDJuyWGN6rGpUrfk3vT+7I
	jgwAt8W1u56GT1px4el9IyEO/i/gKPKgdTLbv9/+FCVERz7TZWRMkjb1qTpIafrn
	FTfizZBp77eyQve3kPSSQ0Txlu9L7jfXNpWbsKRtX7gTju6QgbS9t9OijxjWpLbV
	Fbplqv+Ikym7RNQIOHpwMCOc9ZKRMJgp8pWdymfh+arTTZ+6mICRXqmI6Z+awumE
	AfZf+79qrEDjtjZbufLAKUmflyiZRMyE/PoAruh6ZU9kGUM/d9ONKV7ZPSQ==
X-Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20])
	by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h5xe3gh1s-1
	(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
	Thu, 08 Oct 2026 00:56:58 +0000 (GMT)
X-Received: from pps.filterd (nalasppmta03.qualcomm.com [127.0.0.1])
	by NALASPPMTA03.qualcomm.com (8.18.1.11/8.18.1.11) with ESMTP id 6980uvLx1477126;
	Thu, 8 Oct 2026 00:56:57 GMT
X-Received: from hu-devc-lv-u22-c.qualcomm.com (hu-subashab-lv.qualcomm.com [10.81.24.15])
	by NALASPPMTA03.qualcomm.com (PPS) with ESMTPS id 6980uutH1477113
	(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
	Thu, 08 Oct 2026 00:56:57 +0000 (GMT)
X-Received: by hu-devc-lv-u22-c.qualcomm.com (Postfix, from userid 212624)
	id ACEC7AD7; Wed,  7 Oct 2026 17:56:56 -0700 (PDT)
X-Cc: horms@kernel.org, skhan@linuxfoundation.org, rdunlap@infradead.org,
        netdev@vger.kernel.org, linux-doc@vger.kernel.org,
        linux-kernel@vger.kernel.org,
        Subash Abhinov Kasiviswanathan <subash.a.kasiviswanathan@oss.qualcomm.com>,
        Sean Tranchetti <sean.tranchetti@oss.qualcomm.com>
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <20261008005543.2630828-1-subash.a.kasiviswanathan@oss.qualcomm.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-Proofpoint-Reinject: loops=2 maxloops=12
X-QCInternal: smtphost
X-QCInternal: smtphost
X-Authority-Analysis: v=2.4 cv=NchzRGD4 c=1 sm=1 tr=0 ts=6ac6ea5a cx=c_pps
 a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17
 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22
 a=rJkE3RaqiGZ5pbrm-msn:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8
 a=x0N0Csb9lgv-IS86onMA:9
X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA4MDAwMyBTYWx0ZWRfXzZ5qhGgaOrJw
 yb4QDO6gu5O+U99gyiRxLrHO9yjHBdIk9b4Me0aUfWBeiJ3Y0kjiCQ7zvkTHH5A13kBQfQAuwGI
 wB+f2uxg7G0IS8VngEDfzBXbq4aev3o=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA4MDAwMyBTYWx0ZWRfXyLUo+kgRUwC5
 k7us8Cwb7110s77ISB916qxKnielqQSn7O/lkSW9Hi2cSdQ7PtqDa79kl7dVz0o8HBB+DUCl3jB
 6m0iPPrwBTt+oRgGoHJ8v0WTSLce11cWClYUlHatWG8NVoL0AZ4XUdxxs1oJKZ6YmINI26tbr9F
 HSzgniWGJAfhyfrvHZgYfOlwt8iEfaGMhS9yzKSOlVvijYIGskyPPtWObVqykjCDVMF/q8/gvVg
 XwbEN+BZqwDz1/x5F8PYSbB4CHtc7pNgXKJcx3W9jIfWKFE2wLRvwchf23O3e+JB81s6HkpODeI
 FUvRS/YcQj3VVP5yH0YgVRjlRZr0gJpekGbMXgIGRbpNLNQZ6Xr+QHCEbvPialM1t6O8PMDU5qv
 opZe8iNdEiFHnlWe3ziat3Twbm3zrFYNhvqOK95o+cqupgvMkw7AEm+hb1uFfIKloRAjV03Va/l
 oMb24b8loaUb1boEWFg==
X-Proofpoint-ORIG-GUID: qxBnEEvH3H0HSqRBNde85630rV1S4xxQ
X-Proofpoint-GUID: qxBnEEvH3H0HSqRBNde85630rV1S4xxQ
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-10-07_07,2026-10-06_03,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 impostorscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 spamscore=0
 malwarescore=0 adultscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2610020000 definitions=main-2610080003