[Devel] Re: [PATCH 1/1] cls_cgroup: unify classid syntax to tc

Minoru Usui usui at mxm.nes.nec.co.jp
Sun Jun 14 20:00:35 PDT 2009


Hi, Paul.

Thank you for your advice.

On Thu, 11 Jun 2009 22:06:00 -0700
Paul Menage <menage at google.com> wrote:

> On Thu, Jun 11, 2009 at 8:40 PM, Minoru Usui<usui at mxm.nes.nec.co.jp> wrote:
> >
> > It's true. If my patch applied, old syntax can't use.
> > But I think compatibility is important, too.
> > So I'll make a new patch which can use both old and new syntax, when we write classid to net_cls.classid file.
> >
> > Present implementation is an asymmetry with read and write.(read: decimal, write: hexadecimal)
> 
> You can write the classid value in decimal too, or even octal - it
> just uses strtoull() to convert the string to an integer, so
> 0x-prefixed hex values are handled automatically.
> 
> >
> > If it's ok, I'd like to be able to use tc syntax(X:Y style),
> > because cls_cgroup's purpose is select class which create by tc command.
> > tc command can only use classid syntax X:Y style, so we should be able to use X:Y style to cls_cgroup.
> 
> We should keep it as it is - purely apart from compatibility issues,
> there's no need to introduce the complexity of the tc interface into
> the cls_cgroup kernel code. When a cgroup control file represents a
> simple integer, then it should be exposed as such.

I understand your opinion.
You mean, kernel I/F should be simple, so we should use the same format as the kernel.
I completely agree.

Actually, In tc <-> kernel I/F (which uses netlink), tc sets classid to hexadecimal style not X:Y style.
X:Y style is result of translating by tc command.

I thought this patch was very useful at first, but it's not necessary to implementing to the kernel.
This function can be implemented on user space if we need.
And we can also keep compatibility of net_cls.classid I/F. :-)

I drop this patch. I'm sorry for confusing a lot of people.
-- 
Minoru Usui <usui at mxm.nes.nec.co.jp>


More information about the Containers mailing list