From patchwork Tue Jul 6 17:58:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 58051 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5BFD2B6EEA for ; Wed, 7 Jul 2010 03:58:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753913Ab0GFR6Y (ORCPT ); Tue, 6 Jul 2010 13:58:24 -0400 Received: from mail.vyatta.com ([76.74.103.46]:57589 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907Ab0GFR6Y (ORCPT ); Tue, 6 Jul 2010 13:58:24 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id B9CF61828F31; Tue, 6 Jul 2010 10:55:35 -0700 (PDT) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oGyt0BD-Medp; Tue, 6 Jul 2010 10:55:35 -0700 (PDT) Received: from nehalam (unknown [10.250.0.104]) by mail.vyatta.com (Postfix) with ESMTPSA id BA3201828EFD; Tue, 6 Jul 2010 10:55:34 -0700 (PDT) Date: Tue, 6 Jul 2010 10:58:21 -0700 From: Stephen Hemminger To: David Miller , YOSHIFUJI Hideaki , Herbert Xu Cc: netdev@vger.kernel.org Subject: [RFC] gre: propagate ipv6 transport class Message-ID: <20100706105821.7b0e2538@nehalam> Organization: Vyatta X-Mailer: Claws Mail 3.7.5 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch makes IPV6 over IPv4 GRE tunnel propagate the transport class field from the underlying IPV6 header to the IPV4 Type Of Service field. Without the patch, all IPV6 packets in tunnel look the same to QoS. This assumes that IPV6 transport class is exactly the same as IPv4 TOS. Not sure if that is always the case? Maybe need to mask off some bits. The mask and shift to get tclass is copied from ipv6/datagram.c Signed-off-by: Stephen Hemminger --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/ipv4/ip_gre.c 2010-07-06 08:52:03.702096234 -0700 +++ b/net/ipv4/ip_gre.c 2010-07-06 08:59:18.416738831 -0700 @@ -731,6 +731,8 @@ static netdev_tx_t ipgre_tunnel_xmit(str tos = 0; if (skb->protocol == htons(ETH_P_IP)) tos = old_iph->tos; + else if (skb->protocol == htons(ETH_P_IPV6)) + tos = (ntohl(*(__be32 *)ipv6_hdr(skb)) >> 20) & 0xff; } {