All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Qiang <h.huangqiang@huawei.com>
To: David Miller <davem@davemloft.net>
Cc: <glommer@parallels.com>, <netdev@vger.kernel.org>,
	<containers@lists.linux-foundation.org>,
	<yangzhenzhang@huawei.com>
Subject: Re: [PATCH v2] netns: correctly use per-netns ipv4 sysctl_tcp_mem
Date: Thu, 19 Jul 2012 10:29:18 +0800	[thread overview]
Message-ID: <500770FE.5080006@huawei.com> (raw)
In-Reply-To: <20120718.094137.2279894799753732191.davem@davemloft.net>

On 2012-7-19 0:41, David Miller wrote:

> From: Huang Qiang <h.huangqiang@huawei.com>
> Date: Thu, 12 Jul 2012 17:33:34 +0800
> 
>> From: Yang Zhenzhang <yangzhenzhang@huawei.com>
>>
>> Now, kernel allows each net namespace to independently set up its levels
>> for tcp memory pressure thresholds.
>>
>> But it seems there is a bug, as using the following steps:
>>
>> [root@host socket]# lxc-start -n test -f config /bin/bash
>> [root@net-test socket]# ip route add default via 192.168.58.2
>> [root@net-test socket]# echo 0 0 0 > /proc/sys/net/ipv4/tcp_mem
>> [root@net-test socket]# scp root@192.168.58.174:/home/tcp_mem_test .
>>
>> and it still can transport the "tcp_mem_test" file which we hope it
>> would not.
>>
>> It's because inet_init() (net/ipv4/af_inet.c)initialize the tcp_prot.sysctl_mem:
>> tcp_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem;
>>
>> So when the protocal is TCP, sk->sk_prot->sysctl_mem(following code)
>> always use the ipv4 sysctl_tcp_mem of init_net namespace rather than
>> it's own net namespace.
>> This patch simply set "prot" equal to net->ipv4.sysctl_tcp_mem when
>> the protocol type is TCP.
>>
>> Signed-off-by: Yang Zhenzhang <yangzhenzhang@huawei.com>
>> Signed-off-by: Huang Qiang <h.huangqiang@huawei.com>
> 
> This patch doesn't apply cleanly to net-next, please respin it.
> 
> Thank you.

Ok, I will send patch v3 for net-next. Thank you!

  reply	other threads:[~2012-07-19  2:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  9:33 [PATCH v2] netns: correctly use per-netns ipv4 sysctl_tcp_mem Huang Qiang
2012-07-12 11:17 ` Lin Ming
     [not found] ` <4FFE99EE.70003-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-07-12 11:17   ` Lin Ming
2012-07-18 16:41   ` David Miller
2012-07-19  2:29     ` Huang Qiang [this message]
     [not found]     ` <20120718.094137.2279894799753732191.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-07-19  2:29       ` Huang Qiang
  -- strict thread matches above, loose matches on Subject: below --
2012-07-12  9:33 Huang Qiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=500770FE.5080006@huawei.com \
    --to=h.huangqiang@huawei.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=glommer@parallels.com \
    --cc=netdev@vger.kernel.org \
    --cc=yangzhenzhang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.