Re: [B.A.T.M.A.N.] switch routing algorithm at runtime

Simon Wunderlich
2011-12-06T17:36:45Z

[-- Attachment #1: Type: text/plain, Size: 2058 bytes --]

Hey there,

On Tue, Dec 06, 2011 at 11:30:54PM +0800, Marek Lindner wrote:
>
> Hi,
>
> > When it is in debugfs, it implies that the user has no choice, it is a
> > debug tool only. So when the development is finished, one day batman
> > will just swap from IV to V, and the user gets no choice?
> >
> > For the moment, i think it is O.K. in debugfs. However, there should
> > be some sort of idea how this is going to work when it comes to
> > actually mainstream use of V. Is it simply that IV is dead, you need
> > to use V now. Or do we give the user a choice and some file under /sys
> > to make this choice?
>
> the idea of using debugfs instead of sysfs was to avoid the chicken & egg
> problem (I guess). However, looking at my batman-adv debugfs entry tells me
> that we have the same problem there. Unless we want to move this file into the
> debugfs batman-adv root folder (/sys/kernel/debug/batman_adv) we can't move
> forward either. The whole init/config structure has been designed for "create
> bat0 first".
>
> If we don't want to rewrite this whole part I only see 2 options:
> * compile or module parameter
> * changing the routing algo on the fly

Yeah, we would have to move it into /sys/kernel/debug/batman_adv in the root,
but Andrew may be right about future "non-debug" algorithm selection.

Maybe we go back to Antonios idea with the module parameter, but make it
changeable in runtime. Haven't done that yet, but it seems to be possible [1]:

''Loadable modules, after being loaded into the running kernel, also
reveal their parameters in /sys/module/${modulename}/parameters/. Some of these
parameters may be changed at runtime by the command
"echo -n ${value} > /sys/module/${modulename}/parameters/${parm}" ''

The rest would work as described: having a default value, allow user
changes in runtime and use the configured algorithm value for the next
soft interface creation.

How about this?
Simon

[1] http://www.kernel.org/doc/Documentation/kernel-parameters.txt

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]