Received: by 10.192.165.148 with SMTP id m20csp3959707imm; Mon, 30 Apr 2018 09:14:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo+JzAlgyPgM0Mr8aBQo7+y7DuuJLGHF63vQn8ZfmD/g1Rkfxu6ryhoVzxnRMnm+hoQZVJf X-Received: by 2002:a17:902:850a:: with SMTP id bj10-v6mr4629378plb.239.1525104873140; Mon, 30 Apr 2018 09:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525104873; cv=none; d=google.com; s=arc-20160816; b=g7PdBkkUFPirlTb6TZze33EvETYg6HbRA2Ugo24rr5waTn9QQkt0dIR4EIZXjeayXg Q+gR/HzSnSFA0OrPNUz0p8FWCc8yLfxx8wqXddBVrRFJo7BNGTEVhEDW/C7Zka8zHKbv 60x8Ltav2BIA7TD+2d1iXb05E9S2p3Rt8031anGXnE6j7w5B2CP9VA4efcI+F5eMuXe6 5H6/4PFqHGHEQVQG/TPR+cLYqE+3o2JRf923xo/AE3UCre2H0F4SQQFxVi8RArT/r0Wh c+T2tBOlDMQJ5Tx+ZZquyyOTx8VhToySOjclcYT/U13pSL4zzmDv00xAI7F6hyef2De0 qbOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=SJwxPouYXF1qAYQ3YW+UuwxeZ5BWr1Ma2Q/U59FASBU=; b=V29bcBTtDZXsmUZApGOZwSIjOOc3RZZkI/rtnAETI2Qaqe/jVRCcXddoHF2mDcNYSS u7+xhBr0/RrR9Uby/eDdTy2gK0JhxygrCqXSkvBKj38J9TGVrzdIcQfogBpzFVixDofE H9PC2qefrJSOdV6NzZue2EUmxG1PeHLa93rvEXxwTESK/lV4EtQ8KtjVoiJ63VBkH6nZ YkyxJ8H2i4+zLDPTyoBZ03pP+BiebHXVT6Pk8R11/t/eI7Aed6p3kGZNBcl0xrSWcDVD puwaUS02Qk9xzJaKb0A5PLpLlqbKHa2V0zUF3Cdz4LMXbSDCXnF866uCE2gwRmoAdaMy qi8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z124si7893607pfb.188.2018.04.30.09.14.18; Mon, 30 Apr 2018 09:14:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754749AbeD3QOA (ORCPT + 99 others); Mon, 30 Apr 2018 12:14:00 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:33700 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754555AbeD3QN6 (ORCPT ); Mon, 30 Apr 2018 12:13:58 -0400 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 387D7133F46C1; Mon, 30 Apr 2018 09:13:58 -0700 (PDT) Date: Mon, 30 Apr 2018 12:13:57 -0400 (EDT) Message-Id: <20180430.121357.2257158218189689071.davem@davemloft.net> To: amsalam20@gmail.com Cc: dav.lebrun@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next v2] ipv6: sr: extract the right key values for "seg6_make_flowlabel" From: David Miller In-Reply-To: <1524910715-12097-1-git-send-email-amsalam20@gmail.com> References: <1524910715-12097-1-git-send-email-amsalam20@gmail.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 30 Apr 2018 09:13:58 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahmed Abdelsalam Date: Sat, 28 Apr 2018 12:18:35 +0200 > The seg6_make_flowlabel() is used by seg6_do_srh_encap() to compute the > flowlabel from a given skb. It relies on skb_get_hash() which eventually > calls __skb_flow_dissect() to extract the flow_keys struct values from > the skb. > > In case of IPv4 traffic, calling seg6_make_flowlabel() after skb_push(), > skb_reset_network_header(), and skb_mac_header_rebuild() will results in > flow_keys struct of all key values set to zero. > > This patch calls seg6_make_flowlabel() before resetting the headers of skb > to get the right key values. > > Extracted Key values are based on the type inner packet as follows: > 1) IPv6 traffic: src_IP, dst_IP, L4 proto, and flowlabel of inner packet. > 2) IPv4 traffic: src_IP, dst_IP, L4 proto, src_port, and dst_port > 3) L2 traffic: depends on what kind of traffic carried into the L2 > frame. IPv6 and IPv4 traffic works as discussed 1) and 2) > > Here a hex_dump of struct flow_keys for IPv4 and IPv6 traffic > 10.100.1.100: 47302 > 30.0.0.2: 5001 > 00000000: 14 00 02 00 00 00 00 00 08 00 11 00 00 00 00 00 > 00000010: 00 00 00 00 00 00 00 00 13 89 b8 c6 1e 00 00 02 > 00000020: 0a 64 01 64 > > fc00:a1:a > b2::2 > 00000000: 28 00 03 00 00 00 00 00 86 dd 11 00 99 f9 02 00 > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 b2 00 00 > 00000020: 00 00 00 00 00 00 00 00 00 00 00 02 fc 00 00 a1 > 00000030: 00 00 00 00 00 00 00 00 00 00 00 0a > > Signed-off-by: Ahmed Abdelsalam Looks good, applied, thank you.