b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Greg KH <greg@kroah.com>,
	gregkh@suse.de, Marek Lindner <lindner_marek@yahoo.de>,
	b.a.t.m.a.n@lists.open-mesh.net
Subject: Re: [B.A.T.M.A.N.] [PATCH 13/26] staging:batman-adv: convert multiple /proc files to use sysfs
Date: Thu, 13 May 2010 13:45:07 +0200	[thread overview]
Message-ID: <20100513114507.GF4946@lunn.ch> (raw)
In-Reply-To: <201005122056.05476.sven.eckelmann@gmx.de>

> The rest can be in sysfs?:
>  * /sys/class/net/<iface>/batman-adv/mesh_iface
>  * /sys/class/net/<iface>/batman-adv/iface_status
>  * /sys/class/net/<mesh_iface>/mesh/aggregate_ogm
>  * /sys/class/net/<mesh_iface>/mesh/orig_interval
>  * /sys/class/net/<mesh_iface>/mesh/vis_mode

As far as i can see, these are all single values. I would however
suggest a few changes, to make it a bit clearer what the values are
and what units are used.

* /sys/class/net/<mesh_iface>/mesh/enable_aggregated_OGMs
* /sys/class/net/<mesh_iface>/mesh/enable_vis_data
* /sys/class/net/<mesh_iface>/mesh/orig_interval_msec

"enable" suggests the control can be enabled/disabled. It gives the
user a hint to try Boolean values: 0/1, true/false, enable/disable.
Our current code accepts 0/1 and enable/disable, so the user has a
good chance of guessing correct.

enable_aggregated_OGMs is more grammatically correct. We are
aggregating multiple OGMs into one big OGM packet.

"_msec" gives the user the units to use for the orig_interval.

I would also change the values read from the files. Currently it is
not a simple value. It is a value, plus some text which batctl uses,
or hints for the user when using cat/echo. eg:

        return sprintf(buff, "status: %s\ncommands: enable, disable, 0, 1\n",
                       aggr_status == 0 ? "disabled" : "enabled");

IMHO, we should just output 0/1, true/false/ enabled/disabled. I don't
really care which, but is should be only a single word.

For me, batctl parsing the hint the kernel returns does not make much
sense. Once this kernel ABI is defined, it will never change,
ever. Since it will never change, we can hard code the hint into
batctl. That then brings the syfs files in line with the single value
requirement. 

What we loose is the hint for people using cat/echo, not batctl. How
big a problem is this? I don't think it is a big problem. When you cat
the file you see "enabled", go guessing "disabled" is not too hard. We
already return -EINVAL when in invalid value is tried and log a
message to the kernel log. It would be easy to extend this kernel log
message with: "Usage: enable | disable.
For orig_interval_msec, i would extend the kernel log message with: 
"Usage: integer between %d  and %d", (JITTER * 2)+1, 0x00ffffff.

That i think covers all the mainline configuration options. We have a
few more in trunk. I would suggest a rename to be consistent:

enable_bonding

gateway is a bigger problem. I think it needs splitting up into a
number of files, but i don't know the code well enough, and could not
quickly find a good description of the options.

	Andrew



  parent reply	other threads:[~2010-05-13 11:45 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 20:18 [B.A.T.M.A.N.] [PATCH 00/26] staging:batman-adv Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 01/26] staging:batman-adv: only modify hna-table on active module Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 02/26] staging:batman-adv: Clone shared bat packets before modifying them Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 03/26] staging:batman-adv: fix aggregation timing bug Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 04/26] staging:batman-adv: Fix aggregation direct-link bug Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 05/26] staging:batman-adv: Update copyright years Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 06/26] staging:batman-adv: remove the beta from main.h for release Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 07/26] staging:batman-adv: Remove dead max addr and obsolete VIS_FORMAT strings Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 08/26] staging:batman-adv: Add 0.2.1 changes to the CHANGELOG Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 09/26] staging:batman-adv: Update README about vis raw output Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 10/26] staging:batman-adv: Changing version to 0.2.2-beta Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 11/26] staging:batman-adv: cleanup: change test for end of array Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 12/26] staging:batman-adv: fix whitespace style issues Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 13/26] staging:batman-adv: convert multiple /proc files to use sysfs Andrew Lunn
2010-05-06 20:41   ` Greg KH
2010-05-12 17:19     ` Marek Lindner
2010-05-12 17:38       ` Greg KH
2010-05-12 18:55         ` Sven Eckelmann
2010-05-12 19:17           ` Greg KH
2010-05-12 23:51             ` Marek Lindner
2010-05-14 16:10               ` Greg KH
2010-05-13 11:45           ` Andrew Lunn [this message]
2010-05-16 13:18             ` Simon Wunderlich
2010-05-12 23:25         ` Marek Lindner
2010-05-12 19:43       ` Andrew Lunn
2010-05-12 19:47         ` Sven Eckelmann
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 14/26] staging:batman-adv: convert more files from /proc to /sys Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 15/26] staging:batman-adv: move originator interval setting " Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 16/26] staging:batman-adv: remove redundant pointer to originator interface Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 17/26] staging:batman-adv: move /proc interface handling to /sys Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 18/26] staging:batman-adv: fix whitespace style issues Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 19/26] staging:batman-adv: Reorganize sequence number handling Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 20/26] staging:batman-adv: Limit queue lengths for batman and broadcast packets Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 21/26] staging:batman-adv: kfree_skb() in interface_tx() in error case Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 22/26] staging:batman-adv: Update pointer to ethhdr after skb_copy Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 23/26] staging:batman-adv: Update TODO file to reflect current state Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 24/26] staging:batman-adv: Fix whitespace problems criticized by checkpatch.pl Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 25/26] staging:batman-adv: Reduce max characters on a line to 80 Andrew Lunn
2010-05-06 20:18 ` [B.A.T.M.A.N.] [PATCH 26/26] staging:batman-adv: updating README Andrew Lunn
2010-05-06 21:44 ` [B.A.T.M.A.N.] [PATCH 00/26] staging:batman-adv Sven Eckelmann
2010-05-07  3:14   ` Marek Lindner
2010-05-07 10:48     ` Sven Eckelmann
2010-05-07  5:25   ` Andrew Lunn
2010-05-07 19:47 [B.A.T.M.A.N.] [PATCH 00/26] Staging: batman-adv: linux-next Andrew Lunn
2010-05-07 19:47 ` [B.A.T.M.A.N.] [PATCH 13/26] Staging: batman-adv: convert multiple /proc files to use sysfs Andrew Lunn

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=20100513114507.GF4946@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=lindner_marek@yahoo.de \
    /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;
as well as URLs for NNTP newsgroup(s).