Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1274360
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 6/7] sock, cgroup: add sock->sk_cgroup |
| Date | 2015-11-20 20:20 +0100 |
| Message-ID | <qwZnX-2Zc-1@gated-at.bofh.it> (permalink) |
| References | <qwCB4-4K6-3@gated-at.bofh.it> <qwCB5-4K6-43@gated-at.bofh.it> <qwRJL-6qF-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHSET v2] netfilter, cgroup: implement xt_cgroup2 match Tejun Heo <tj@kernel.org> - 2015-11-19 20:00 +0100
[PATCH 2/7] kernfs: implement kernfs_walk_and_get() Tejun Heo <tj@kernel.org> - 2015-11-19 20:00 +0100
Re: [PATCH 2/7] kernfs: implement kernfs_walk_and_get() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-11-20 05:50 +0100
Re: [PATCH 2/7] kernfs: implement kernfs_walk_and_get() Tejun Heo <tj@kernel.org> - 2015-11-20 22:20 +0100
Re: [PATCH 2/7] kernfs: implement kernfs_walk_and_get() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-11-20 22:50 +0100
[PATCH 7/7] netfilter: implement xt_cgroup2 match Tejun Heo <tj@kernel.org> - 2015-11-19 20:00 +0100
[PATCH v2 iptables] libxt_cgroup2: add support for cgroup2 path matching Tejun Heo <tj@kernel.org> - 2015-11-19 20:00 +0100
[PATCH 3/7] cgroup: implement cgroup_get_from_path() and expose cgroup_put() Tejun Heo <tj@kernel.org> - 2015-11-19 20:00 +0100
[PATCH 6/7] sock, cgroup: add sock->sk_cgroup Tejun Heo <tj@kernel.org> - 2015-11-19 20:00 +0100
Re: [PATCH 6/7] sock, cgroup: add sock->sk_cgroup Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-20 12:10 +0100
Re: [PATCH 6/7] sock, cgroup: add sock->sk_cgroup Tejun Heo <tj@kernel.org> - 2015-11-20 20:20 +0100
Re: [PATCHSET v2] netfilter, cgroup: implement xt_cgroup2 match David Miller <davem@davemloft.net> - 2015-11-20 20:00 +0100
Re: [PATCHSET v2] netfilter, cgroup: implement xt_cgroup2 match Pablo Neira Ayuso <pablo@netfilter.org> - 2015-11-20 21:00 +0100
Re: [PATCHSET v2] netfilter, cgroup: implement xt_cgroup2 match Pablo Neira Ayuso <pablo@netfilter.org> - 2015-11-20 21:00 +0100
Re: [PATCHSET v2] netfilter, cgroup: implement xt_cgroup2 match Tejun Heo <tj@kernel.org> - 2015-11-20 22:10 +0100
csiph-web