netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: fix checksum features handling in netif_skb_features()
@ 2014-08-15  9:56 Michal Kubecek
  2014-08-21 23:33 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Kubecek @ 2014-08-15  9:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel

This is follow-up to

  da08143b8520 ("vlan: more careful checksum features handling")

which introduced more careful feature intersection in vlan code,
taking into account that HW_CSUM should be considered superset
of IP_CSUM/IPV6_CSUM. The same is needed in netif_skb_features()
in order to avoid offloading mismatch warning when vlan is
created on top of a bond consisting of slaves supporting IP/IPv6
checksumming but not vlan Tx offloading.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 net/core/dev.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index b65a505..75f0096 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2587,13 +2587,18 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
 		return harmonize_features(skb, features);
 	}
 
-	features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
-					       NETIF_F_HW_VLAN_STAG_TX);
+	features = netdev_intersect_features(features, skb->dev->vlan_features |
+						       NETIF_F_HW_VLAN_CTAG_TX |
+						       NETIF_F_HW_VLAN_STAG_TX);
 
 	if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD))
-		features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
-				NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX |
-				NETIF_F_HW_VLAN_STAG_TX;
+		features = netdev_intersect_features(features,
+						     NETIF_F_SG |
+						     NETIF_F_HIGHDMA |
+						     NETIF_F_FRAGLIST |
+						     NETIF_F_GEN_CSUM |
+						     NETIF_F_HW_VLAN_CTAG_TX |
+						     NETIF_F_HW_VLAN_STAG_TX);
 
 	return harmonize_features(skb, features);
 }
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: fix checksum features handling in netif_skb_features()
  2014-08-15  9:56 [PATCH net] net: fix checksum features handling in netif_skb_features() Michal Kubecek
@ 2014-08-21 23:33 ` David Miller
  2014-08-25 13:16   ` [PATCH net v2] " Michal Kubecek
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2014-08-21 23:33 UTC (permalink / raw)
  To: mkubecek; +Cc: netdev, linux-kernel

From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 15 Aug 2014 11:56:17 +0200 (CEST)

> @@ -2587,13 +2587,18 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
>  		return harmonize_features(skb, features);
>  	}
>  
> -	features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
> -					       NETIF_F_HW_VLAN_STAG_TX);
> +	features = netdev_intersect_features(features, skb->dev->vlan_features |
> +						       NETIF_F_HW_VLAN_CTAG_TX |
> +						       NETIF_F_HW_VLAN_STAG_TX);

This is not indented properly.

The second and subsequent lines of the function call should start precisely
at the first column after the openning parenthesis on the first line.  You
should use the appropriate number of TAB and SPACE characters necessary
to do so.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net v2] net: fix checksum features handling in netif_skb_features()
  2014-08-21 23:33 ` David Miller
@ 2014-08-25 13:16   ` Michal Kubecek
  2014-08-26  0:23     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Kubecek @ 2014-08-25 13:16 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel

This is follow-up to

  da08143b8520 ("vlan: more careful checksum features handling")

which introduced more careful feature intersection in vlan code,
taking into account that HW_CSUM should be considered superset
of IP_CSUM/IPV6_CSUM. The same is needed in netif_skb_features()
in order to avoid offloading mismatch warning when vlan is
created on top of a bond consisting of slaves supporting IP/IPv6
checksumming but not vlan Tx offloading.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 net/core/dev.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index b65a505..a964017 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2587,13 +2587,19 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
 		return harmonize_features(skb, features);
 	}
 
-	features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
-					       NETIF_F_HW_VLAN_STAG_TX);
+	features = netdev_intersect_features(features,
+					     skb->dev->vlan_features |
+					     NETIF_F_HW_VLAN_CTAG_TX |
+					     NETIF_F_HW_VLAN_STAG_TX);
 
 	if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD))
-		features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
-				NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX |
-				NETIF_F_HW_VLAN_STAG_TX;
+		features = netdev_intersect_features(features,
+						     NETIF_F_SG |
+						     NETIF_F_HIGHDMA |
+						     NETIF_F_FRAGLIST |
+						     NETIF_F_GEN_CSUM |
+						     NETIF_F_HW_VLAN_CTAG_TX |
+						     NETIF_F_HW_VLAN_STAG_TX);
 
 	return harmonize_features(skb, features);
 }
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] net: fix checksum features handling in netif_skb_features()
  2014-08-25 13:16   ` [PATCH net v2] " Michal Kubecek
@ 2014-08-26  0:23     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-08-26  0:23 UTC (permalink / raw)
  To: mkubecek; +Cc: netdev, linux-kernel

From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 25 Aug 2014 15:16:22 +0200 (CEST)

> This is follow-up to
> 
>   da08143b8520 ("vlan: more careful checksum features handling")
> 
> which introduced more careful feature intersection in vlan code,
> taking into account that HW_CSUM should be considered superset
> of IP_CSUM/IPV6_CSUM. The same is needed in netif_skb_features()
> in order to avoid offloading mismatch warning when vlan is
> created on top of a bond consisting of slaves supporting IP/IPv6
> checksumming but not vlan Tx offloading.
> 
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-26  0:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15  9:56 [PATCH net] net: fix checksum features handling in netif_skb_features() Michal Kubecek
2014-08-21 23:33 ` David Miller
2014-08-25 13:16   ` [PATCH net v2] " Michal Kubecek
2014-08-26  0:23     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).