netdev
[Top] [All Lists]

Re: [RFC] Extend netlink error codes

To: Thomas Graf <tgraf@xxxxxxx>
Subject: Re: [RFC] Extend netlink error codes
From: Sam Leffler <sam@xxxxxxxxx>
Date: Sat, 11 Sep 2004 11:48:52 -0700
Cc: Andi Kleen <ak@xxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20040911162433.GC21181@xxxxxxxxxxxxxx>
References: <20040910225158.GO20088@xxxxxxxxxxxxxx> <20040911155839.GN4431@xxxxxxxxxxxxx> <20040911162433.GC21181@xxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Sep 11, 2004, at 9:24 AM, Thomas Graf wrote:

* Andi Kleen <20040911155839.GN4431@xxxxxxxxxxxxx> 2004-09-11 17:58
IMHO it would be far better to just pass text errors
in a variable length packet back.  It's a bit plan9ish,
but it would work nicely here and be a bit improvement
(especially for the qdiscs)

I had the same idea and the only good way to do so would
be to add a char * errbuf or alike to struct netlink_opt
and access it via skb.sk.sk_protinfo.

The bad side is that the for example cls and sch api don't
provide the skb to the implementing modules and therefore
they can't access the error buffer. I don't want to change
all netlink users because of this.

Changing all paths back to netlink_ack to provide a struct
containing the errno and an additional text error buffer is
no option for me either.

Correct me if I'm wrong.

Otherwise you will end up with a mainteance nightmare of a
long list of error codes that needs to be updated for every new
subsystem.

I would suggst to split them up and assign blocks of free codes
to subsystems.

And everybody who has a patch to add a new netlink
user would always fight with conflicts in this file.

This is indeed a problem.

I don't think an very specific error like
"CFQ subsystem parameter X is FOO, can be only upto BAR"
can be nicely put into a global error file.

True, I would really like to have such error messages.

A technique used for mbuf packet tags in FreeBSD is to define a 32-bit cookie that uniquely identifies a module or ABI code and concatenate this with the 16-bit tag number. The ABI code is defined as the date+time that the module is created, expressed as the number of seconds since the epoch (e.g. the output of date -u +'%s'). Tag numbers are meaningful only within the context of the module/ABI. A default/compatibility cookie is used for compatibility with previously defined tag values. This scheme effectively distributes management of tags (so far there have been no collisions).

Check the comments in sys/sys/mbuf.h on FreeBSD for more details.

        Sam


<Prev in Thread] Current Thread [Next in Thread>