Thread (2 messages) flat view 2 messages, 2 authors, 2014-06-03

Re: [PATCH v4 net-next] MPLS: Use mpls_features to activate software MPLS GSO segmentation

From: Eric Dumazet <hidden>
Date: 2014-06-03 03:42:02

Possibly related (same subject, not in this thread)

Hi Simon

On Tue, 2014-06-03 at 11:38 +0900, Simon Horman wrote:
+/* If MPLS offload request, verify we are testing hardware MPLS features
+ * instead of standard features for the netdev.
+ */
+#ifdef CONFIG_NET_MPLS_GSO
+static netdev_features_t net_mpls_features(struct sk_buff *skb,
+					   netdev_features_t features)
+{
+	int tmp;
+	__be16 type;
+
+	type = skb_network_protocol(skb, &tmp);
+	if (unlikely(type == cpu_to_be16(ETH_P_MPLS_UC) ||
+		     type == cpu_to_be16(ETH_P_MPLS_MC)))
I believe net/core/dev.c prefers to use htons(ETH_P_MPLS_UC)

(check netif_skb_features())
+		features &= skb->dev->mpls_features;
+
+	return features;
+}
+#else
+static netdev_features_t net_mpls_features(struct sk_buff *skb,
+					   netdev_features_t features)
+{
+	return features;
+}
+#endif
+
 static netdev_features_t harmonize_features(struct sk_buff *skb,
 	netdev_features_t features)
 {
 	int tmp;
	_be16 type;

	type = skb_network_protocol(skb, &tmp);
 
+	features = net_mpls_features(skb, features);
	features = net_mpls_features(skb, features, type);
+
 	if (skb->ip_summed != CHECKSUM_NONE &&
 	    !can_checksum_protocol(features, skb_network_protocol(skb, &tmp))) {
	!can_checksum_protocol(features, type)) {
 		features &= ~NETIF_F_ALL_CSUM;


I guess CONFIG_NET_MPLS_GSO will be set by all distros, right ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help