From: Tejun Heo <tj@kernel.org>
To: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: davem@davemloft.net, pablo@netfilter.org, kaber@trash.net,
kadlec@blackhole.kfki.hu, lizefan@huawei.com, hannes@cmpxchg.org,
netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com,
daniel@iogearbox.net, nhorman@tuxdriver.com
Subject: Re: [PATCH 6/7] sock, cgroup: add sock->sk_cgroup
Date: Fri, 20 Nov 2015 14:12:28 -0500 [thread overview]
Message-ID: <20151120191228.GA28383@mtj.duckdns.org> (raw)
In-Reply-To: <564EFE25.5000906@bmw-carit.de>
Hello, Daniel.
On Fri, Nov 20, 2015 at 12:04:05PM +0100, Daniel Wagner wrote:
> > static inline u16 sock_cgroup_prioidx(struct sock_cgroup_data *skcd)
> > {
> > - return skcd->prioidx;
> > + return (skcd->is_data & 1) ? skcd->prioidx : 1;
> > }
> >
> > static inline u32 sock_cgroup_classid(struct sock_cgroup_data *skcd)
> > {
> > - return skcd->classid;
> > + return (skcd->is_data & 1) ? skcd->classid : 0;
> > }
>
>
> I still try to understand what the code does, hence this stupid question:
>
> Why is sock_cgroup_prioidx() returning 1 if is not data and
> sock_cgroup_classid() a 0?
I prolly should have added comments there. prioidx carries the cgroup
ID on the hierarchy net_prio is attached to, so if nothing is
configured, the default value would be the ID of the root cgroup which
is always 1. For net_cls, the unconfigured default value is zero.
Will refresh the patch with comments.
Thanks.
--
tejun
next prev parent reply other threads:[~2015-11-20 19:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 18:52 [PATCHSET v2] netfilter, cgroup: implement xt_cgroup2 match Tejun Heo
2015-11-19 18:52 ` [PATCH 1/7] cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it Tejun Heo
2015-11-19 18:52 ` [PATCH 2/7] kernfs: implement kernfs_walk_and_get() Tejun Heo
2015-11-20 4:41 ` Greg Kroah-Hartman
2015-11-20 21:12 ` Tejun Heo
2015-11-20 21:41 ` Greg Kroah-Hartman
2015-11-19 18:52 ` [PATCH 3/7] cgroup: implement cgroup_get_from_path() and expose cgroup_put() Tejun Heo
2015-11-19 18:52 ` [PATCH 4/7] netprio_cgroup: limit the maximum css->id to USHRT_MAX Tejun Heo
2015-11-20 9:18 ` Daniel Wagner
2015-11-19 18:52 ` [PATCH 5/7] net: wrap sock->sk_cgrp_prioidx and ->sk_classid inside a struct Tejun Heo
2015-11-19 18:52 ` [PATCH 6/7] sock, cgroup: add sock->sk_cgroup Tejun Heo
2015-11-20 11:04 ` Daniel Wagner
2015-11-20 19:12 ` Tejun Heo [this message]
2015-11-19 18:52 ` [PATCH 7/7] netfilter: implement xt_cgroup2 match Tejun Heo
2015-11-19 18:57 ` [PATCH v2 iptables] libxt_cgroup2: add support for cgroup2 path matching Tejun Heo
2015-11-19 18:58 ` [PATCH iptables] libxt_cgroup: improve wording in the man page Tejun Heo
2015-11-20 18:59 ` [PATCHSET v2] netfilter, cgroup: implement xt_cgroup2 match David Miller
2015-11-20 19:56 ` Pablo Neira Ayuso
2015-11-20 19:57 ` Pablo Neira Ayuso
2015-11-20 21:06 ` Tejun Heo
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=20151120191228.GA28383@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=coreteam@netfilter.org \
--cc=daniel.wagner@bmw-carit.de \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hannes@cmpxchg.org \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=pablo@netfilter.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox