Received: by 10.192.165.148 with SMTP id m20csp1150338imm; Thu, 10 May 2018 06:28:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoq3VZ6Ev2Xz0ZK4soYGSTa86TBzuARgnmiCGGqmSrfTxJkGto34Bh0B2B0H8vXIav0vy5m X-Received: by 2002:a62:b204:: with SMTP id x4-v6mr1415651pfe.21.1525958925480; Thu, 10 May 2018 06:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525958925; cv=none; d=google.com; s=arc-20160816; b=l87pAmbFi5ufAsAkjzSybomw2So8rSvgeseGvwXG4SC1nJQSzTirq95/FNnTD7fs6P JE7caxW+KZx02QwEoIizjKasZu52b1NTpRF1Le+IWM7X7c9QImfKyBfMAq3kCKWO2cyr wjl5MKrOv67lNdhdJGuUBLqrghUapSqGSxEqVrL+m7AD3KvoZ1kdZfTumopJ5coYaZ6c BlOIo1Q60ANQKMp98SbWk96g2pGaW/dfHO0pZYEl9OzpdSWU+weVpuXnIA3ymm8sqJZ5 d8u7J6NbaN/nTuceZZ3RDNIAMj1usTO4cEF037WZgOcsf1t3o3ffPI1DpPDdawuRNjgK 2Y2g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=8PRMwID4uSJIlmV+NrSk1pGT7wReBjJvgT3nKO1C+Io=; b=HpedU6qZCPHICvjvmqk1uXoUNXcBPGfvEymTc/ABjgpF/8Eg8RR43OaH4KS+uxpRp9 f4tqJHvh8+dRuFzOJiDjCwR/qQOz8haUuAyXEtR6uXBOdFsberObcSBvyfyPOC8weGIm DpReetNGqsqDYvhMorCBjUEu6qaJDDZ4mFYQVcrGd7AwUyEnUGNH06ylbrhkZ99LNXP+ SxxvO8zSgDIQfzRY7gRBGPVR2ziWTCeFB+zPOziy1ZY8GhsmkPbsFxsLWDaYsnlFjDWZ vi4VOnZFpQMSxk0EmuCRjCEWaeGWgB1StHqWVXJrLCMtTxWLLc4G10RrbQ9PDkJPe518 nQtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LXAG0S3i; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63-v6si767452pld.429.2018.05.10.06.28.30; Thu, 10 May 2018 06:28:45 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LXAG0S3i; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757386AbeEJN1G (ORCPT + 99 others); Thu, 10 May 2018 09:27:06 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:38770 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756998AbeEJN1F (ORCPT ); Thu, 10 May 2018 09:27:05 -0400 Received: by mail-pf0-f172.google.com with SMTP id o76-v6so1082638pfi.5; Thu, 10 May 2018 06:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8PRMwID4uSJIlmV+NrSk1pGT7wReBjJvgT3nKO1C+Io=; b=LXAG0S3il4nfLgNj6sTUa2ijYWDjSlHP6khSnkzA9KRMFlRC2NU4FVpQrta7WapDEc RNxUal9v/pWzioxyrg2hCaTX24AsQLT+ix4kBbaV+5SLTeq72bnvbCWMBjrfSvpPcUOe 5/FT9pacqQZiwT/0uNfAns8BKyY5Pl4bQf/8BcDsxHWVb2ftXqSX0jqXHM1DZ4enMqvL L3/8Pair/6C7mFBGEnc0/BYBRIM9lS6HJzuz2Ztb+os4emSi1RWe/8AWLvoCqJpWTVIu EYW1cYyjwvfmJH2gbdWUmLt3Dw2KByCRVquDfpOczPjYz/piQcDhWUHoT79ItuxB386Z CUsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8PRMwID4uSJIlmV+NrSk1pGT7wReBjJvgT3nKO1C+Io=; b=mcLWiTIorAOZmtRmoFDjEX3mqG658ONV620km6/MxymJSosSsVEH/pFvvmMB8UM3jq I9tfIFyCpqe36biXm2r6/2s/YiUQ9fvGML1othtWUiOtjmtx7TWowE/WDSANnr0jB5KV TrhRnXhm6r0sXIjmpxBkHlMtz9c0w03RlgeRpXBezCfZer0qTDsmwvlKCYdGJCl9NpNZ dCFweTP0uZiXlY42mmlIglmoHJVCqIM4xel+O6QcC06mZYbwA3Sn2mD+XDHTQBFX+rqV hofH5BYOrFdUOEYrBPnXj1rCiiP4PHLnpJKr+KE2RaT8T7oH0bUVUXCReLqn8/CVlBN6 SPMQ== X-Gm-Message-State: ALKqPwe/x+bz7JdSjtVvhuz2e6wtMvKHii7Pghii51dufSm5Ji4Ap6sP AgJkVUdfXjtBZnNG8LOdBDA= X-Received: by 2002:a62:c2:: with SMTP id 185-v6mr1412762pfa.238.1525958824413; Thu, 10 May 2018 06:27:04 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id r20-v6sm2473511pff.152.2018.05.10.06.27.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 06:27:02 -0700 (PDT) Subject: Re: [PATCH net-next v2] tcp: Add mark for TIMEWAIT sockets To: Jon Maxwell , davem@davemloft.net Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jmaxwell@redhat.com References: <20180510065351.22535-1-jmaxwell37@gmail.com> From: Eric Dumazet Message-ID: <9889abda-a022-44ae-30b6-ce2484c3bd90@gmail.com> Date: Thu, 10 May 2018 06:27:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180510065351.22535-1-jmaxwell37@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/09/2018 11:53 PM, Jon Maxwell wrote: > This version has some suggestions by Eric Dumazet: > > - Use a local variable for the mark in IPv6 instead of ctl_sk to avoid SMP > races. > - Use the more elegant "IP4_REPLY_MARK(net, skb->mark) ?: sk->sk_mark" > statement. > - Factorize code as sk_fullsock() check is not necessary. > > Aidan McGurn from Openwave Mobility systems reported the following bug: > > "Marked routing is broken on customer deployment. Its effects are large > increase in Uplink retransmissions caused by the client never receiving > the final ACK to their FINACK - this ACK misses the mark and routes out > of the incorrect route." > > Currently marks are added to sk_buffs for replies when the "fwmark_reflect" > sysctl is enabled. But not for TW sockets that had sk->sk_mark set via > setsockopt(SO_MARK..). > > Fix this in IPv4/v6 by adding tw->tw_mark for TIME_WAIT sockets. Copy the the > original sk->sk_mark in __inet_twsk_hashdance() to the new tw->tw_mark location. > Then progate this so that the skb gets sent with the correct mark. Do the same > for resets. Give the "fwmark_reflect" sysctl precedence over sk->sk_mark so that > netfilter rules are still honored. > > Signed-off-by: Jon Maxwell Reviewed-by: Eric Dumazet Thanks Jon.