Rules and groups
Subsystems (2)
Hi,
With your new protocol independent rules code, I see that there is an entry in struct fib_rules_ops for a netlink group for notification of rule changes. For whatever reason (historical I guess) DECnet has never had a nl group assigned for this, so I'm left with two choices when moving the code over to ues your new scheme.
Either I could send a patch to put the content of notify_rule_change() conditional on nlgroup being non-zero, or I could assign a suitable group for DECnet rule changes. I'm leaning towards the latter as the best solution, so that at least it matches up with the other protocols.
Is there anything to stop me using RTNLGRP_NOP3 for that? (suitable renamed of course!) So far as I can see its never been assigned to anything else...
Steve.
David Miller
maintainerFrom: Steven Whitehouse <[email protected]>
Date: Wed, 9 Aug 2006 09:01:39 +0100
Quoted 3 lines
Is there anything to stop me using
RTNLGRP_NOP3for that? (suitable renamed of course!) So far as I can see its never been assigned to anything else...
I have no objection to you using it.
These nops exist because the table used to be a bunch of bitmask defines instead of the present enum:
#define RTMGRP_LINK 1
#define RTMGRP_NOTIFY 2
#define RTMGRP_NEIGH 4
#define RTMGRP_TC 8
#define RTMGRP_IPV4_IFADDR 0x10
#define RTMGRP_IPV4_MROUTE 0x20
#define RTMGRP_IPV4_ROUTE 0x40
#define RTMGRP_IPV6_IFADDR 0x100
#define RTMGRP_IPV6_MROUTE 0x200
#define RTMGRP_IPV6_ROUTE 0x400
#define RTMGRP_DECnet_IFADDR 0x1000
#define RTMGRP_DECnet_ROUTE 0x4000
That is from 2.4.x
* Steven Whitehouse <[email protected]> 2006-08-09 09:01
Quoted 10 lines
With your new protocol independent rules code, I see that there is an entry in struct
fib_rules_opsfor a netlink group for notification of rule changes. For whatever reason (historical I guess) DECnet has never had a nl group assigned for this, so I'm left with two choices when moving the code over to ues your new scheme.Either I could send a patch to put the content of
notify_rule_change()conditional on nlgroup being non-zero, or I could assign a suitable group for DECnet rule changes. I'm leaning towards the latter as the best solution, so that at least it matches up with the other protocols.
Absolutely, notification for DECnet rule changes would be nice to have.
Hi,
Quoted 9 lines · David Miller
From: Steven Whitehouse <[email protected]>
Date: Wed, 9 Aug 2006 09:01:39 +0100Quoted 3 lines
Is there anything to stop me using
RTNLGRP_NOP3for that? (suitable renamed of course!) So far as I can see its never been assigned to anything else...I have no objection to you using it.
Excellent. Please find attached my attempt at doing the conversion to the generic rules code. It appears to work ok for me. You can also pull this patch from the decnet git tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/steve/decnet-2.6.19.git
which was cloned from net-2.6.19.git quite recently. In addition the git tree has another patch which is in a following email.
Patrick: does this patch get your blessing?
Steve.
-----------------------------------------------------------------------------
[DECnet] Covert rules to use generic code
This patch converts the DECnet rules code to use the generic rules system created by Thomas Graf <[email protected]>.
---
include/linux/rtnetlink.h | 3 include/net/dn_fib.h | 8 - net/decnet/Kconfig | 1 net/decnet/af_decnet.c | 1 net/decnet/dn_dev.c | 3 net/decnet/dn_fib.c | 1 net/decnet/dn_route.c | 3 net/decnet/dn_rules.c | 492 +++++++++++++++++---------------------------- net/decnet/dn_table.c | 1 9 files changed, 195 insertions(+), 318 deletions(-)
0ff88cb56e1674234a8aaacb7869bc004252c0c2
include/linux/rtnetlink.h +2 -1
@@ -885,7 +885,8 @@ enum rtnetlink_groups { RTNLGRP_NOP2, RTNLGRP_DECnet_ROUTE,#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE -RTNLGRP_NOP3 , + RTNLGRP_DECnet_RULE, +#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE RTNLGRP_NOP4, RTNLGRP_IPV6_PREFIX,#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
include/net/dn_fib.h +3 -5
@@ -22,7 +22,7 @@ struct dn_kern_rta };struct dn_fib_res { -struct dn_fib_rule *r; +struct fib_rule *r;struct dn_fib_info *fi;unsigned char prefixlen;unsigned char nh_sel;
@@ -147,10 +147,8 @@ extern void dn_fib_table_cleanup(void);*/ extern void dn_fib_rules_init (void );extern void dn_fib_rules_cleanup (void ); -extern void dn_fib_rule_put (struct dn_fib_rule *); -extern __le16 dn_fib_rules_policy (__le16 saddr,struct dn_fib_res *res,unsigned *flags);extern unsigned dnet_addr_type (__le16 addr); -extern int dn_fib_lookup (const struct flowi *fl,struct dn_fib_res *res); +extern int dn_fib_lookup (struct flowi *fl,struct dn_fib_res *res);/* * rtnetlink interface
@@ -176,7 +174,7 @@ static inline void dn_fib_res_put(structif (res->fi)dn_fib_info_put (res->fi);if (res->r) -dn_fib_rule_put (res->r); +fib_rule_put (res->r); }extern struct dn_fib_table *dn_fib_tables[];
net/decnet/Kconfig +1 -0
@@ -27,6 +27,7 @@ config DECNET config DECNET_ROUTER bool "DECnet: router support (EXPERIMENTAL)" depends on DECNET && EXPERIMENTAL + select FIB_RULES ---help--- Add support for turning your DECnet Endnode into a level 1 or 2 router. This is an experimental, but functional option. If you
net/decnet/af_decnet.c +1 -0
@@ -130,6 +130,7 @@ Version 0.0.6 2.1.110 07-aug-98 E#include <linux/poll.h> #include <net/neighbour.h> #include <net/dst.h> +#include <net/fib_rules.h> #include <net/dn.h> #include <net/dn_nsp.h> #include <net/dn_dev.h>
net/decnet/dn_dev.c +1 -2
@@ -45,6 +45,7 @@#include <net/neighbour.h> #include <net/dst.h> #include <net/flow.h> +#include <net/fib_rules.h> #include <net/dn.h> #include <net/dn_dev.h> #include <net/dn_route.h>
@@ -1417,8 +1418,6 @@ static struct rtnetlink_link dnet_rtnetl [RTM_DELROUTE - RTM_BASE] = { .doit = dn_fib_rtm_delroute, }, [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, .dumpit = dn_fib_dump, }, - [RTM_NEWRULE - RTM_BASE] = { .doit = dn_fib_rtm_newrule, }, - [RTM_DELRULE - RTM_BASE] = { .doit = dn_fib_rtm_delrule, }, [RTM_GETRULE - RTM_BASE] = { .dumpit = dn_fib_dump_rules, }, #else [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute,
net/decnet/dn_fib.c +1 -0
@@ -34,6 +34,7 @@#include <net/neighbour.h> #include <net/dst.h> #include <net/flow.h> +#include <net/fib_rules.h> #include <net/dn.h> #include <net/dn_route.h> #include <net/dn_fib.h>
net/decnet/dn_route.c +2 -1
@@ -80,6 +80,7 @@#include <net/neighbour.h> #include <net/dst.h> #include <net/flow.h> +#include <net/fib_rules.h> #include <net/dn.h> #include <net/dn_dev.h> #include <net/dn_nsp.h>
@@ -1279,7 +1280,7 @@ static int dn_route_input_slow(struct skdev_hold (out_dev);if (res.r) - src_map =dn_fib_rules_policy (fl.fld_src, &res, &flags); + src_map = fl.fld_src;/* no NAT support for now */ gateway =DN_FIB_RES_GW (res);if (res.type ==RTN_NAT ) {
net/decnet/dn_rules.c +183 -309
584 lines not on this page · raw message
net/decnet/dn_table.c +1 -0
@@ -30,6 +30,7 @@#include <net/neighbour.h> #include <net/dst.h> #include <net/flow.h> +#include <net/fib_rules.h> #include <net/dn.h> #include <net/dn_route.h> #include <net/dn_fib.h>
Signature · 1 line
1.2.2
* Steven Whitehouse <[email protected]> 2006-08-09 11:03
Quoted 8 lines · David Miller
Quoted 7 lines
From: Steven Whitehouse <[email protected]>
Date: Wed, 9 Aug 2006 09:01:39 +0100Quoted 3 lines
Is there anything to stop me using
RTNLGRP_NOP3for that? (suitable renamed of course!) So far as I can see its never been assigned to anything else...
Quoted 5 lines
Quoted 2 lines
I have no objection to you using it.
Excellent. Please find attached my attempt at doing the conversion to the generic rules code. It appears to work ok for me. You can also pull this patch from the decnet git tree at:
Looks good to me.
Quoted 15 lines · Steven Whitehouse
Hi,
Quoted 8 lines · David Miller
From: Steven Whitehouse <[email protected]>
Date: Wed, 9 Aug 2006 09:01:39 +0100Quoted 3 lines
Is there anything to stop me using
RTNLGRP_NOP3for that? (suitable renamed of course!) So far as I can see its never been assigned to anything else...I have no objection to you using it.
Excellent. Please find attached my attempt at doing the conversion to the generic rules code. It appears to work ok for me. You can also pull this patch from the decnet git tree at:
Quoted 7 lines
git://git.kernel.org/pub/scm/linux/kernel/git/steve/decnet-2.6.19.gitwhich was cloned from net-2.6.19.git quite recently. In addition the git tree has another patch which is in a following email.
Patrick: does this patch get your blessing?
Yes, that works fine for me.
Signature · 1 line
patrick
David Miller
maintainerFrom: Steven Whitehouse <[email protected]>
Date: Wed, 9 Aug 2006 11:03:26 +0100
Quoted 6 lines
[DECnet] Covert rules to use generic code
This patch converts the DECnet rules code to use the generic rules system created by Thomas Graf <[email protected]>.
Signed-off-by Steven Whitehouse <[email protected]>
Patch applied, thanks Steven.
I know it may seem like a minor detail, but can you format your top comment line like this:
[DECNET]: Covert rules to use generic code
I've been making this transformation by hand.
The important parts for me are:
[X]: blah
Where X is the main subsystem name in all capital letters, and there is a colon after the closing right bracket. If there is a specific sub-area being effected, the following is a nice way to show that:
[X] subarea: blah
This makes all of the networking changesets look consistent and it's easier for human eyes to scan the changeset lines if we make an effort to do it this way.
Thanks!