b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: b.a.t.m.a.n@lists.open-mesh.org, gregkh@suse.de
Cc: Greg KH <greg@kroah.com>, 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: Wed, 12 May 2010 20:55:56 +0200	[thread overview]
Message-ID: <201005122056.05476.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <20100512173830.GA27912@kroah.com>

[-- Attachment #1: Type: Text/Plain, Size: 4862 bytes --]

Thank you for the fast answer. 

Greg KH wrote:
> On Thu, May 13, 2010 at 01:19:38AM +0800, Marek Lindner wrote:
> > Hi Greg,
> > 
> > > Please document all sysfs files with a Documentation/ABI/ entry.  You
> > > can put it in the drivers/staging/batman-adv/ directory for now.
> > > 
> > > Also note, binary sysfs files are for things that are "pass-through",
> > > not for things that you try to intrepret like I think you are doing
> > > here.  What's wrong with configfs for something like this?
> > 
> > I drafted the ABI documentation which you will find attached to this
> > mail. Since this is my very first attempt I'd appreciate feedback from
> > your side before we submit it. I looked at various existing ABI docs in
> > the linux kernel tree to get an idea how it should look like. Bear with
> > me if it is not perfect yet.  ;-)
> > 
> > Regarding the question which kernel configuration interface to use, we
> > would be more than happy to receive some guidance. At this point we are
> > rather unsure which of the many (procfs/sysfs/configfs/etc) filesystems
> > are we supposed to go forward with. To better judge our case I recommend
> > reading this page http://www.open-mesh.org/wiki/tweaking-batman-adv
> > as it explains the purpose of the various sysfs files.
> > 
> > Right now, I would say that configfs does not belong to my favorite
> > solutions, simply because it seems to be a rather new/uncommon choice.
> 
> configfs is very old, and has been around almost as long as sysfs has
> been.  But yes, it's not used as much, that is true.
> 
> > Batman's main deployment field are embedded devices (mostly low cost
> > routers) that have quite some contraints regarding cpu power and
> > available disk space. Typically, those systems try to deactivate all
> > "unnecessary" functionality in the kernel to have a few more bytes
> > available for other stuff. For example OpenWRT: They deactivated
> > configfs on all platforms (except one). I fear we create more problems
> > than we solve if we go down this path.
> 
> Well, it is simple to enable configfs if you need/want batman, right?
> It's not that much extra kernel code.

Yes, it should be possible to enable it. It was just meant to describe the 
current situation and the target systems were batman-adv is currently used. 
There is for example the requirement by one developer that it runs on his 
hardware which currently only support 2.6.24 as kernel due to different out of 
kernel drivers. There were also some request to port it back to 2.6.15 to get 
the Atheros drivers working... which is out of scope for us due to different 
changes in the kernel since 2.6.15. It isn't always easy to support all those 
requirements and get it in the right shape for a merge in the mainline kernel 
(and my/our gap in education about all virtualfs doesn't help either).

This makes invalid entries in sysfs not better, but maybe helps you to get in 
the correct mood to point us in the right direction.

> > What:           /sys/class/net/<mesh_iface>/mesh/originators
[...]
> 
> Sorry, but sysfs is for "one value per file" attributes, which this one
> violates.
> 
> Is this something that everyone always needs to know?  Or could it be a
> debugfs file?

Everyone/always - not really. They are needed by someone who wants to test and 
debug the status of batman-adv - which sounds like a perfect target for 
debugfs, right?

So batctl has to check if /sys/kernel/debug/ is mounted (or the batman-
adv/mesh_iface/originator) file can be found and give the user a helpful error 
message that either batman-adv is not loaded, debugfs is not mounted at 
/sys/kernel/debug/ or the mesh_iface just doesn't exists.

> > What:           /sys/class/net/<mesh_iface>/mesh/transtable_global
[...]
> 
> Again, no "tables" in sysfs please.
> 
> > What:           /sys/class/net/<mesh_iface>/mesh/transtable_local
[...]
> 
> Same here.
> 
> > What:           /sys/class/net/<mesh_iface>/mesh/vis_mode
[...]
> > 
> > What:           /sys/class/net/<mesh_iface>/mesh/vis_data
[...]
> 
> Again, this is not a single value, so please move it somewhere else.

As far as I can see only these files with (more or less) debug information are 
the problem right now and should go to the debugfs?

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 (not sure about that one because
   it is in the no-list, but without comment. You can only write "client"/
   "server" into that file and read the same value. So probably in the sysfs
   list)


Best regards,
	Sven Eckelmann

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2010-05-12 18:55 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 [this message]
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
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=201005122056.05476.sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.de \
    --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).