Skip to contentSkip to conversation

Revert "net: Add driver helper functions to determine checksum offloadability"

PATCH Applied Stephen Hemminger 3 participants 5 messages Oct 11, 2016 – Oct 14, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "net: Add driver helper functions to determine checksum offloadability"

This reverts commit 6ae23ad36253a8033c5714c52b691b84456487c5.

The code has been in kernel since 4.4 but there are no in tree code that uses. Unused code is broken code, remove it.

---
 include/linux/netdevice.h |  78 --------------------------
 net/core/dev.c            | 136 ----------------------------------------------
 2 files changed, 214 deletions(-)
include/linux/netdevice.h +0 -78
index 136ae6bb..793155e 100644
@@ -2649,71 +2649,6 @@ static inline void skb_gro_remcsum_cleanup(struct sk_buff *skb,
 	remcsum_unadjust((__sum16 *)ptr, grc->delta);
 }
 
-struct skb_csum_offl_spec {
-	__u16		ipv4_okay:1,
-			ipv6_okay:1,
-			encap_okay:1,
-			ip_options_okay:1,
-			ext_hdrs_okay:1,
-			tcp_okay:1,
-			udp_okay:1,
-			sctp_okay:1,
-			vlan_okay:1,
-			no_encapped_ipv6:1,
-			no_not_encapped:1;
-};
-
-bool __skb_csum_offload_chk(struct sk_buff *skb,
-			    const struct skb_csum_offl_spec *spec,
-			    bool *csum_encapped,
-			    bool csum_help);
-
-static inline bool skb_csum_offload_chk(struct sk_buff *skb,
-					const struct skb_csum_offl_spec *spec,
-					bool *csum_encapped,
-					bool csum_help)
-{
-	if (skb->ip_summed != CHECKSUM_PARTIAL)
-		return false;
-
-	return __skb_csum_offload_chk(skb, spec, csum_encapped, csum_help);
-}
-
-static inline bool skb_csum_offload_chk_help(struct sk_buff *skb,
-					     const struct skb_csum_offl_spec *spec)
-{
-	bool csum_encapped;
-
-	return skb_csum_offload_chk(skb, spec, &csum_encapped, true);
-}
-
-static inline bool skb_csum_off_chk_help_cmn(struct sk_buff *skb)
-{
-	static const struct skb_csum_offl_spec csum_offl_spec = {
-		.ipv4_okay = 1,
-		.ip_options_okay = 1,
-		.ipv6_okay = 1,
-		.vlan_okay = 1,
-		.tcp_okay = 1,
-		.udp_okay = 1,
-	};
-
-	return skb_csum_offload_chk_help(skb, &csum_offl_spec);
-}
-
-static inline bool skb_csum_off_chk_help_cmn_v4_only(struct sk_buff *skb)
-{
-	static const struct skb_csum_offl_spec csum_offl_spec = {
-		.ipv4_okay = 1,
-		.ip_options_okay = 1,
-		.tcp_okay = 1,
-		.udp_okay = 1,
-		.vlan_okay = 1,
-	};
-
-	return skb_csum_offload_chk_help(skb, &csum_offl_spec);
-}
-
 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
 				  unsigned short type,
 				  const void *daddr, const void *saddr,
@@ -3957,19 +3892,6 @@ static inline bool can_checksum_protocol(netdev_features_t features,
 	}
 }
 
-/* Map an ethertype into IP protocol if possible */
-static inline int eproto_to_ipproto(int eproto)
-{
-	switch (eproto) {
-	case htons(ETH_P_IP):
-		return IPPROTO_IP;
-	case htons(ETH_P_IPV6):
-		return IPPROTO_IPV6;
-	default:
-		return -1;
-	}
-}
-
 #ifdef CONFIG_BUG
 void netdev_rx_csum_fault(struct net_device *dev);
 #else
net/core/dev.c +0 -136

148 lines not on this page · raw message

Signature · 1 line
2.9.3
maintainer
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Tue, 11 Oct 2016 13:04:09 -0700

Quoted 6 lines

This reverts commit 6ae23ad36253a8033c5714c52b691b84456487c5.

The code has been in kernel since 4.4 but there are no in tree code that uses. Unused code is broken code, remove it.

Tom if you have any real plans to develop on this work at all in the immediate future, please speak up now.

Otherwise I'm applying Stephen's patch.

Thanks.

#2 lore raw
Quoted 8 lines · David Miller

From: Stephen Hemminger <[email protected]>
Date: Tue, 11 Oct 2016 13:04:09 -0700

Quoted 5 lines

This reverts commit 6ae23ad36253a8033c5714c52b691b84456487c5.

The code has been in kernel since 4.4 but there are no in tree code that uses. Unused code is broken code, remove it.

Quoted 7 lines
Quoted 1 line

Tom if you have any real plans to develop on this work at all in the immediate future, please speak up now.

Otherwise I'm applying Stephen's patch.

Thanks.

We've used this in our overlay support, which we plan to upstream in the next month or two (or at least Soon(tm)), so we'd rather it stayed in otherwise we'll just have to reimplement it.

Jon

#3 lore raw
In reply to David Miller
Quoted 8 lines · David Miller

From: Stephen Hemminger <[email protected]>
Date: Tue, 11 Oct 2016 13:04:09 -0700

Quoted 5 lines

This reverts commit 6ae23ad36253a8033c5714c52b691b84456487c5.

The code has been in kernel since 4.4 but there are no in tree code that uses. Unused code is broken code, remove it.

Quoted 7 lines
Quoted 1 line

Tom if you have any real plans to develop on this work at all in the immediate future, please speak up now.

Otherwise I'm applying Stephen's patch.

Thanks.

Oops, nope, I tell a lie. We used it initially and then realised we didn't strictly need it since we only advertise IP_CSUM and IPV6_CSUM of inner packets, so we should never be presented with a packet we'd need to call the helper for. So we're not using it after all.

Jon

maintainer Applied
#4 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Tue, 11 Oct 2016 13:04:09 -0700

Quoted 7 lines

This reverts commit 6ae23ad36253a8033c5714c52b691b84456487c5.

The code has been in kernel since 4.4 but there are no in tree code that uses. Unused code is broken code, remove it.

Applied to net-next, thanks Stephen.

Please put proper "[PATCH net-next]" tags in your Subject lines when patches are targetting net-next.

Thanks.