summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-06-02 03:11:41 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-02 03:11:41 +0300
commit92c35cfd9366efae8ee420197a8163a8b4284efe (patch)
tree4a3655b77448cf59444b097c5db4ca2a380f363c /include
parente0ae757c32353f7d185779f104e7309af81491e1 (diff)
parentb6e5d27e32ef6089d316ce7e1ecaf595584d4b84 (diff)
downloadlinux-92c35cfd9366efae8ee420197a8163a8b4284efe.tar.xz
Merge branch 'qualcomm-rmnet-mapv5'
Sharath Chandra Vurukala says: ==================== net: qualcomm: rmnet: Enable Mapv5 This series introduces the MAPv5 packet format. Patch 0 documents the MAPv4/v5. Patch 1 introduces the MAPv5 and the Inline checksum offload for RX/Ingress. Patch 2 introduces the MAPv5 and the Inline checksum offload for TX/Egress. A new checksum header format is used as part of MAPv5.For RX checksum offload, the checksum is verified by the HW and the validity is marked in the checksum header of MAPv5. For TX, the required metadata is filled up so hardware can compute the checksum. v1->v2: - Fixed the compilation errors, warnings reported by kernel test robot. - Checksum header definition is expanded to support big, little endian formats as mentioned by Jakub. v2->v3: - Fixed compilation errors reported by kernel bot for big endian flavor. v3->v4: - Made changes to use masks instead of C bit-fields as suggested by Jakub/Alex. v4->v5: - Corrected checkpatch errors and warnings reported by patchwork. v5->v6: - Corrected the bug identified by Alex and incorporated all his comments. v6->v7: - Removed duplicate inclusion of linux/bitfield.h in rmnet_map_data.c v7->v8: - Have addressed comments given by JAkub on v7 patches. - As suggested by Jakub, skb_cow_head() is used instead of expanding the head directly. This is now done in rmnet_map_egress_handler(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_rmnet.h30
-rw-r--r--include/uapi/linux/if_link.h2
2 files changed, 29 insertions, 3 deletions
diff --git a/include/linux/if_rmnet.h b/include/linux/if_rmnet.h
index 4efb537f57f3..be17610a981e 100644
--- a/include/linux/if_rmnet.h
+++ b/include/linux/if_rmnet.h
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only
- * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2019, 2021 The Linux Foundation. All rights reserved.
*/
#ifndef _LINUX_IF_RMNET_H_
@@ -12,10 +12,12 @@ struct rmnet_map_header {
} __aligned(1);
/* rmnet_map_header flags field:
- * PAD_LEN: number of pad bytes following packet data
- * CMD: 1 = packet contains a MAP command; 0 = packet contains data
+ * PAD_LEN: number of pad bytes following packet data
+ * CMD: 1 = packet contains a MAP command; 0 = packet contains data
+ * NEXT_HEADER: 1 = packet contains V5 CSUM header 0 = no V5 CSUM header
*/
#define MAP_PAD_LEN_MASK GENMASK(5, 0)
+#define MAP_NEXT_HEADER_FLAG BIT(6)
#define MAP_CMD_FLAG BIT(7)
struct rmnet_map_dl_csum_trailer {
@@ -45,4 +47,26 @@ struct rmnet_map_ul_csum_header {
#define MAP_CSUM_UL_UDP_FLAG BIT(14)
#define MAP_CSUM_UL_ENABLED_FLAG BIT(15)
+/* MAP CSUM headers */
+struct rmnet_map_v5_csum_header {
+ u8 header_info;
+ u8 csum_info;
+ __be16 reserved;
+} __aligned(1);
+
+/* v5 header_info field
+ * NEXT_HEADER: represents whether there is any next header
+ * HEADER_TYPE: represents the type of this header
+ *
+ * csum_info field
+ * CSUM_VALID_OR_REQ:
+ * 1 = for UL, checksum computation is requested.
+ * 1 = for DL, validated the checksum and has found it valid
+ */
+
+#define MAPV5_HDRINFO_NXT_HDR_FLAG BIT(0)
+#define MAPV5_HDRINFO_HDR_TYPE_FMASK GENMASK(7, 1)
+#define MAPV5_CSUMINFO_VALID_FLAG BIT(7)
+
+#define RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD 2
#endif /* !(_LINUX_IF_RMNET_H_) */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index cd5b382a4138..a5a7f0e64865 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -1236,6 +1236,8 @@ enum {
#define RMNET_FLAGS_INGRESS_MAP_COMMANDS (1U << 1)
#define RMNET_FLAGS_INGRESS_MAP_CKSUMV4 (1U << 2)
#define RMNET_FLAGS_EGRESS_MAP_CKSUMV4 (1U << 3)
+#define RMNET_FLAGS_INGRESS_MAP_CKSUMV5 (1U << 4)
+#define RMNET_FLAGS_EGRESS_MAP_CKSUMV5 (1U << 5)
enum {
IFLA_RMNET_UNSPEC,