Re: [PATCH v2 next-next 04/12] udp: Don't set skb->encapsulation with RCO

2016-05-06 Thread Alexander Duyck
On Fri, May 6, 2016 at 1:04 PM, Tom Herbert  wrote:
> When RCO is in effect we want to ensure that the outer checksum is
> properly offloaded. Don't set skb->encapsulation in this case to
> ensure that checksum offload is later considered for hw_features
> instead of hw_enc_features.
>
> Signed-off-by: Tom Herbert 
> ---
>  net/ipv4/udp_offload.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
> index b556ef6..92a9222 100644
> --- a/net/ipv4/udp_offload.c
> +++ b/net/ipv4/udp_offload.c
> @@ -94,11 +94,12 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct 
> sk_buff *skb,
> do {
> unsigned int len;
>
> -   if (remcsum)
> +   if (remcsum) {
> skb->ip_summed = CHECKSUM_NONE;
> -
> -   /* Set up inner headers if we are offloading inner checksum */
> -   if (skb->ip_summed == CHECKSUM_PARTIAL) {
> +   } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
> +   /* Set up inner headers if we are offloading inner
> +* checksum
> +*/
> skb_reset_inner_headers(skb);
> skb->encapsulation = 1;
> }

You can just drop this patch.  It doesn't actually change anything
behaviorwise.  If remcsum is set then skb->ip_summed is set to
CHECKSUM_NONE so it isn't going to hit the CHECKSUM_PARTIAL code so
you don't need the else.

- Alex


[PATCH v2 next-next 04/12] udp: Don't set skb->encapsulation with RCO

2016-05-06 Thread Tom Herbert
When RCO is in effect we want to ensure that the outer checksum is
properly offloaded. Don't set skb->encapsulation in this case to
ensure that checksum offload is later considered for hw_features
instead of hw_enc_features.

Signed-off-by: Tom Herbert 
---
 net/ipv4/udp_offload.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index b556ef6..92a9222 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -94,11 +94,12 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct 
sk_buff *skb,
do {
unsigned int len;
 
-   if (remcsum)
+   if (remcsum) {
skb->ip_summed = CHECKSUM_NONE;
-
-   /* Set up inner headers if we are offloading inner checksum */
-   if (skb->ip_summed == CHECKSUM_PARTIAL) {
+   } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
+   /* Set up inner headers if we are offloading inner
+* checksum
+*/
skb_reset_inner_headers(skb);
skb->encapsulation = 1;
}
-- 
2.8.0.rc2