Эх сурвалжийг харах

rmnet: Control DL csum offload with RXCSUM

Similar to the UL direction, allow the hardware checksum offload support
to be toggled off with the NETIF_F_RXCSUM flag though ethtool.

Change-Id: I38e43cf9c13363eee340793878be7639f18254e3
Signed-off-by: Sean Tranchetti <[email protected]>
Sean Tranchetti 5 жил өмнө
parent
commit
94d3f634df

+ 3 - 1
core/rmnet_descriptor.c

@@ -1036,7 +1036,9 @@ int rmnet_frag_process_next_hdr_packet(struct rmnet_frag_descriptor *frag_desc,
 			rmnet_recycle_frag_descriptor(frag_desc, port);
 		break;
 	case RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD:
-		if (rmnet_frag_get_csum_valid(frag_desc)) {
+		if (unlikely(!(frag_desc->dev->features & NETIF_F_RXCSUM))) {
+			priv->stats.csum_sw++;
+		} else if (rmnet_frag_get_csum_valid(frag_desc)) {
 			priv->stats.csum_ok++;
 			frag_desc->csum_valid = true;
 		} else {

+ 3 - 1
core/rmnet_map_data.c

@@ -1172,7 +1172,9 @@ int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,
 			consume_skb(skb);
 		break;
 	case RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD:
-		if (rmnet_map_get_csum_valid(skb)) {
+		if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM))) {
+			priv->stats.csum_sw++;
+		} else if (rmnet_map_get_csum_valid(skb)) {
 			priv->stats.csum_ok++;
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
 		} else {