* [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
@ 2010-06-16 22:39 Sven Eckelmann
2010-06-16 22:42 ` Sven Eckelmann
0 siblings, 1 reply; 7+ messages in thread
From: Sven Eckelmann @ 2010-06-16 22:39 UTC (permalink / raw)
To: b.a.t.m.a.n
From: Jiri Pirko <jpirko@redhat.com>
Register net_bridge_port pointer as rx_handler data pointer. As br_port is
removed from struct net_device, another netdev priv_flag is added to indicate
the device serves as a bridge port. Also rcuized pointers are now correctly
dereferenced in br_fdb.c and in netfilter parts.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
batman-adv-kernelland/hard-interface.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/batman-adv-kernelland/hard-interface.c b/batman-adv-kernelland/hard-interface.c
index 70fd314..0773420 100644
--- a/batman-adv-kernelland/hard-interface.c
+++ b/batman-adv-kernelland/hard-interface.c
@@ -74,7 +74,7 @@ static int is_valid_iface(struct net_device *net_dev)
#endif
/* Device is being bridged */
- /* if (net_dev->br_port != NULL)
+ /* if (net_dev->priv_flags & IFF_BRIDGE_PORT)
return 0; */
return 1;
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
2010-06-16 22:39 [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer Sven Eckelmann
@ 2010-06-16 22:42 ` Sven Eckelmann
2010-06-16 22:52 ` Marek Lindner
0 siblings, 1 reply; 7+ messages in thread
From: Sven Eckelmann @ 2010-06-16 22:42 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: b.a.t.m.a.n
[-- Attachment #1: Type: Text/Plain, Size: 918 bytes --]
Sven Eckelmann wrote:
> From: Jiri Pirko <jpirko@redhat.com>
>
> Register net_bridge_port pointer as rx_handler data pointer. As br_port is
> removed from struct net_device, another netdev priv_flag is added to
> indicate the device serves as a bridge port. Also rcuized pointers are now
> correctly dereferenced in br_fdb.c and in netfilter parts.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
> ---
This patch was already merged by David S. Miller <davem@davemloft.net> on Tue
Jun 15 20:48:58 CEST 2010 (probably for 2.6.36).
I have merged it into maint (not into trunk), but somebody has to think about
a way to to get it working on older kernels. This patch has to made on top of
that patch to get it integrated into the next kernel merge window.
Best regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
2010-06-16 22:42 ` Sven Eckelmann
@ 2010-06-16 22:52 ` Marek Lindner
2010-06-16 23:10 ` Sven Eckelmann
0 siblings, 1 reply; 7+ messages in thread
From: Marek Lindner @ 2010-06-16 22:52 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Thursday 17 June 2010 00:42:11 Sven Eckelmann wrote:
> I have merged it into maint (not into trunk), but somebody has to think
> about a way to to get it working on older kernels. This patch has to made
> on top of that patch to get it integrated into the next kernel merge
> window.
The code in question has not been enabled yet. It is just there as a
possibility and could be enabled if it makes sense. I would say the one
activating this code has to deal with the backward compatibility when it
happens, ok ? :-)
Cheers,
Marek
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
2010-06-16 22:52 ` Marek Lindner
@ 2010-06-16 23:10 ` Sven Eckelmann
2010-06-17 5:42 ` Andrew Lunn
2010-06-17 8:57 ` Marek Lindner
0 siblings, 2 replies; 7+ messages in thread
From: Sven Eckelmann @ 2010-06-16 23:10 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Marek Lindner
[-- Attachment #1: Type: Text/Plain, Size: 2465 bytes --]
Marek Lindner wrote:
> On Thursday 17 June 2010 00:42:11 Sven Eckelmann wrote:
> > I have merged it into maint (not into trunk), but somebody has to think
> > about a way to to get it working on older kernels. This patch has to
> > made on top of that patch to get it integrated into the next kernel
> > merge window.
>
> The code in question has not been enabled yet. It is just there as a
> possibility and could be enabled if it makes sense. I would say the one
> activating this code has to deal with the backward compatibility when it
> happens, ok ? :-)
Ok, let me rewrite it:
I have merged it into maint (not in trunk) but somebody has to think about a
way to get it working on olders kernel _when he wants to enable it the
future_. This patch has to made on top of that patch to get it integrated in
_one of the next kernel merge windows_.
Better? :P
Personally I would do it with something like that:
diff --git a/batman-adv-kernelland/compat.h b/batman-adv-kernelland/compat.h
index 8302a58..c503a51 100644
--- a/batman-adv-kernelland/compat.h
+++ b/batman-adv-kernelland/compat.h
@@ -232,3 +232,14 @@ static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
}
#endif /* < KERNEL_VERSION(2, 6, 29) */
+
+#if !defined(IFF_BRIDGE_PORT)
+
+#ifdef netdev_isbridged
+#undef netdev_isbridged
+#endif
+
+#define netdev_isbridged(netdev) \
+ ((net_dev)->br_port != NULL)
+
+#endif /* defined(IFF_BRIDGE_PORT) */
diff --git a/batman-adv-kernelland/hard-interface.c b/batman-adv-kernelland/hard-interface.c
index 0773420..183d4c9 100644
--- a/batman-adv-kernelland/hard-interface.c
+++ b/batman-adv-kernelland/hard-interface.c
@@ -74,7 +74,7 @@ static int is_valid_iface(struct net_device *net_dev)
#endif
/* Device is being bridged */
- /* if (net_dev->priv_flags & IFF_BRIDGE_PORT)
+ /* if (netdev_isbridged(net_dev))
return 0; */
return 1;
diff --git a/batman-adv-kernelland/hard-interface.h b/batman-adv-kernelland/hard-interface.h
index 1e5fc3e..9bd1837 100644
--- a/batman-adv-kernelland/hard-interface.h
+++ b/batman-adv-kernelland/hard-interface.h
@@ -38,3 +38,8 @@ int batman_skb_recv(struct sk_buff *skb,
struct net_device *orig_dev);
int hardif_min_mtu(void);
void update_min_mtu(void);
+
+#ifndef netdev_isbridged
+#define netdev_isbridged(netdev) \
+ ((net_dev)->priv_flags & IFF_BRIDGE_PORT)
+#endif
Best regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
2010-06-16 23:10 ` Sven Eckelmann
@ 2010-06-17 5:42 ` Andrew Lunn
2010-06-17 7:25 ` Sven Eckelmann
2010-06-17 8:57 ` Marek Lindner
1 sibling, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2010-06-17 5:42 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Marek Lindner
> --- a/batman-adv-kernelland/hard-interface.h
> +++ b/batman-adv-kernelland/hard-interface.h
> @@ -38,3 +38,8 @@ int batman_skb_recv(struct sk_buff *skb,
> struct net_device *orig_dev);
> int hardif_min_mtu(void);
> void update_min_mtu(void);
> +
> +#ifndef netdev_isbridged
> +#define netdev_isbridged(netdev) \
> + ((net_dev)->priv_flags & IFF_BRIDGE_PORT)
> +#endif
Maybe this could be pushed upstream? Seems like a useful bit of code
in general?
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
2010-06-17 5:42 ` Andrew Lunn
@ 2010-06-17 7:25 ` Sven Eckelmann
0 siblings, 0 replies; 7+ messages in thread
From: Sven Eckelmann @ 2010-06-17 7:25 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Marek Lindner
[-- Attachment #1: Type: Text/Plain, Size: 734 bytes --]
Andrew Lunn wrote:
> > --- a/batman-adv-kernelland/hard-interface.h
> > +++ b/batman-adv-kernelland/hard-interface.h
> > @@ -38,3 +38,8 @@ int batman_skb_recv(struct sk_buff *skb,
> >
> > struct net_device *orig_dev);
> >
> > int hardif_min_mtu(void);
> > void update_min_mtu(void);
> >
> > +
> > +#ifndef netdev_isbridged
> > +#define netdev_isbridged(netdev) \
> > + ((net_dev)->priv_flags & IFF_BRIDGE_PORT)
> > +#endif
>
> Maybe this could be pushed upstream? Seems like a useful bit of code
> in general?
I don't think so. It is only used in ~7 places in the whole kernel. If you
want then please feel free to add something like this and submit it to David
S. Miller.
Best regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
2010-06-16 23:10 ` Sven Eckelmann
2010-06-17 5:42 ` Andrew Lunn
@ 2010-06-17 8:57 ` Marek Lindner
1 sibling, 0 replies; 7+ messages in thread
From: Marek Lindner @ 2010-06-17 8:57 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Thursday 17 June 2010 01:10:17 Sven Eckelmann wrote:
> I have merged it into maint (not in trunk) but somebody has to think about
> a way to get it working on olders kernel _when he wants to enable it the
> future_. This patch has to made on top of that patch to get it integrated
> in _one of the next kernel merge windows_.
Ok, I think we are on the same page then. :-)
I applied the patch (revision 1699).
Thanks,
Marek
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-06-17 8:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-16 22:39 [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer Sven Eckelmann
2010-06-16 22:42 ` Sven Eckelmann
2010-06-16 22:52 ` Marek Lindner
2010-06-16 23:10 ` Sven Eckelmann
2010-06-17 5:42 ` Andrew Lunn
2010-06-17 7:25 ` Sven Eckelmann
2010-06-17 8:57 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox