Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a058b1a1 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: qualcomm: rmnet: Fix incorrect UL checksum offload logic"

parents b3b4ca5b 5fd9214f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ 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 udp_ind:1;
	u16 csum_enabled:1;
} __aligned(1);

+9 −4
Original line number Diff line number Diff line
@@ -230,9 +230,9 @@ rmnet_map_ipv4_ul_csum_header(void *iphdr,
	ul_header->csum_insert_offset = skb->csum_offset;
	ul_header->csum_enabled = 1;
	if (ip4h->protocol == IPPROTO_UDP)
		ul_header->udp_ip4_ind = 1;
		ul_header->udp_ind = 1;
	else
		ul_header->udp_ip4_ind = 0;
		ul_header->udp_ind = 0;

	/* Changing remaining fields to network order */
	hdr++;
@@ -263,6 +263,7 @@ rmnet_map_ipv6_ul_csum_header(void *ip6hdr,
			      struct rmnet_map_ul_csum_header *ul_header,
			      struct sk_buff *skb)
{
	struct ipv6hdr *ip6h = (struct ipv6hdr *)ip6hdr;
	__be16 *hdr = (__be16 *)ul_header, offset;

	offset = htons((__force u16)(skb_transport_header(skb) -
@@ -270,7 +271,11 @@ rmnet_map_ipv6_ul_csum_header(void *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;

	if (ip6h->nexthdr == IPPROTO_UDP)
		ul_header->udp_ind = 1;
	else
		ul_header->udp_ind = 0;

	/* Changing remaining fields to network order */
	hdr++;
@@ -479,7 +484,7 @@ void rmnet_map_v4_checksum_uplink_packet(struct sk_buff *skb,
	ul_header->csum_start_offset = 0;
	ul_header->csum_insert_offset = 0;
	ul_header->csum_enabled = 0;
	ul_header->udp_ip4_ind = 0;
	ul_header->udp_ind = 0;

	priv->stats.csum_sw++;
}