From: jamal <hadi@cyberus.ca>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>, netdev <netdev@oss.sgi.com>
Subject: Re: resend patch: xfrm policybyid
Date: Fri, 06 May 2005 07:53:00 -0400 [thread overview]
Message-ID: <1115380381.7660.123.camel@localhost.localdomain> (raw)
In-Reply-To: <20050506085404.GA26719@gondor.apana.org.au>
On Fri, 2005-06-05 at 18:54 +1000, Herbert Xu wrote:
> On Thu, May 05, 2005 at 10:10:03PM -0400, jamal wrote:
> >
> > > The way I'm seeing it is that the index is simply a read-only value
> > > that's only provided by the kernel to the user as an aid in locating
> > > policies.
> >
> > IOW, they are search keys.
>
> I'm afraid I still disagree.
You are a reasonable man, so i am hoping you will end agreeing
or agreeing to disagree;->
> There should only be one key that the
> user gets to set when adding policies that is guaranteed to be unique.
> As it is it's the selector.
>
Note: The index was already guaranteed to be unique even without my
patch.
Just to make sure we are not speaking past each other:
A key is a column in a table that can be uniquely used to identify said
row.
A table can have more than one key (a lot of relational databases do),
although it adds a lot of gunk in the kernel.
In this case actually the justification exists: The selector is needed
for data/packet path lookup key. The index for manager side
manageability.
> Letting the user specify two independent keys which need to be unique
> is what is making your patch ugly and what IMHO will make the code
> unmaintainable.
>
I did not add the code for index, Herbert ;->
whoever did missed some basic details - I am rectifying that.
It will be much easir to get rid of the index as a key - at which point
it has no real value or fix it. You cant have it both ways.
In my opinion the only key that should be used by the manager is the
index. User space should be able to map the selector to an index
- same with the SAD. Its a lot more manageable that way. But again thats
a separate discussion (amongst a few other issues i have distate for in
the SPD/SAD). This actually is the simple one ;->
> Here is an analogy. Think of the policies as files and the indicies
> as file descriptors. The index is only valid while the policy is in
> the policy list (the file descriptor is only valid while the file is
> open). When you add the policy, you don't get to specify what the
> index is (when you open a file, you don't get to specify what the
> file descriptor is).
Of course you can specify the index at creation time! it does make sense
to. It's user space that manages these tables - much easier to specify
an index that makes sense to the manager so it can manage its
side of things easier.
Otherwise all the MIBS and PIBS and policy management code that exists
and uses the concept of row indices in the world is wrong.
> Once the policy has been added, you will be
> given an index that you can use to read/delete the policy (once the
> file has been opened, you will be given a file descriptor that you
> can use to access/close the file).
>
Good example that serves to make my point actually.
Indeed you can look at the fd as a key that the kernel uses.
The manager of the table is the kernel. The kernel dictates what the
fd could be (with some exceptions) because it is easier that way to
manage the addition, lookup and removal of these files.
The SPD, OTOH, is a table of policies managed by some entity in user
space like a KM (and not in the kernel).
Standard approaches have long ago (probably before you and i were born)
to use indices to manage tables. Look at SNMP, COPS, etc. There are
some exceptions to this, but this is in cases where they cant be
avoided.
> However, I must say that I still have absolutely no idea why anyone
> would need to set the index to arbitrary values.
>
But you do know why someone would want to search or delete by it,
right?;->
cheers,
jamal
next prev parent reply other threads:[~2005-05-06 11:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-05 13:14 resend patch: xfrm policybyid jamal
2005-05-05 21:32 ` Herbert Xu
2005-05-05 22:17 ` jamal
2005-05-05 22:18 ` David S. Miller
2005-05-06 13:28 ` Herbert Xu
2005-05-06 18:20 ` David S. Miller
2005-05-05 23:12 ` Herbert Xu
2005-05-06 1:15 ` jamal
2005-05-06 1:31 ` Herbert Xu
2005-05-06 2:10 ` jamal
2005-05-06 2:20 ` jamal
2005-05-06 8:54 ` Herbert Xu
2005-05-06 11:53 ` jamal [this message]
2005-05-07 10:55 ` Herbert Xu
2005-05-07 12:38 ` jamal
2005-05-08 8:07 ` Herbert Xu
2005-05-08 14:30 ` jamal
2005-05-08 15:23 ` Patrick McHardy
2005-05-08 17:23 ` jamal
2005-05-09 11:45 ` Patrick McHardy
2005-05-09 13:10 ` jamal
2005-05-06 11:04 ` Herbert Xu
2005-05-06 11:56 ` jamal
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=1115380381.7660.123.camel@localhost.localdomain \
--to=hadi@cyberus.ca \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@oss.sgi.com \
/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).