public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: don't free resources when DAT is disabled
@ 2012-10-29 15:10 Antonio Quartulli
  2012-10-29 15:11 ` Antonio Quartulli
  2012-10-29 15:30 ` Sven Eckelmann
  0 siblings, 2 replies; 4+ messages in thread
From: Antonio Quartulli @ 2012-10-29 15:10 UTC (permalink / raw)
  To: b.a.t.m.a.n

Freeing all the resources when DAT is disabled need a much more complicated
locking system to prevent concurrent enable/disable operations to destroy the
internal state of the component. For now it is safe to avoid such freeing
operation at all when DAT gets disabled.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 distributed-arp-table.c | 10 ----------
 sysfs.c                 |  3 +--
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index c933615..7921030 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -1061,13 +1061,3 @@ out:
 		batadv_dat_entry_free_ref(dat_entry);
 	return ret;
 }
-
-void batadv_dat_switch(struct net_device *net_dev)
-{
-	struct batadv_priv *bat_priv = netdev_priv(net_dev);
-
-	if (atomic_read(&bat_priv->distributed_arp_table))
-		batadv_dat_init(bat_priv);
-	else
-		batadv_dat_free(bat_priv);
-}
diff --git a/sysfs.c b/sysfs.c
index 9dc58b5..84a55cb 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -422,8 +422,7 @@ BATADV_ATTR_SIF_BOOL(bonding, S_IRUGO | S_IWUSR, NULL);
 BATADV_ATTR_SIF_BOOL(bridge_loop_avoidance, S_IRUGO | S_IWUSR, NULL);
 #endif
 #ifdef CONFIG_BATMAN_ADV_DAT
-BATADV_ATTR_SIF_BOOL(distributed_arp_table, S_IRUGO | S_IWUSR,
-		     batadv_dat_switch);
+BATADV_ATTR_SIF_BOOL(distributed_arp_table, S_IRUGO | S_IWUSR, NULL);
 #endif
 BATADV_ATTR_SIF_BOOL(fragmentation, S_IRUGO | S_IWUSR, batadv_update_min_mtu);
 BATADV_ATTR_SIF_BOOL(ap_isolation, S_IRUGO | S_IWUSR, NULL);
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: don't free resources when DAT is disabled
  2012-10-29 15:10 [B.A.T.M.A.N.] [PATCH] batman-adv: don't free resources when DAT is disabled Antonio Quartulli
@ 2012-10-29 15:11 ` Antonio Quartulli
  2012-10-29 15:30 ` Sven Eckelmann
  1 sibling, 0 replies; 4+ messages in thread
From: Antonio Quartulli @ 2012-10-29 15:11 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

On Mon, Oct 29, 2012 at 04:10:01PM +0100, Antonio Quartulli wrote:
> Freeing all the resources when DAT is disabled need a much more complicated
> locking system to prevent concurrent enable/disable operations to destroy the
> internal state of the component. For now it is safe to avoid such freeing
> operation at all when DAT gets disabled.
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---


This was introduced with ("batman-adv: Distributed ARP Table - add runtime
switch")


Cheers,
-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: don't free resources when DAT is disabled
  2012-10-29 15:10 [B.A.T.M.A.N.] [PATCH] batman-adv: don't free resources when DAT is disabled Antonio Quartulli
  2012-10-29 15:11 ` Antonio Quartulli
@ 2012-10-29 15:30 ` Sven Eckelmann
  2012-10-29 15:31   ` Antonio Quartulli
  1 sibling, 1 reply; 4+ messages in thread
From: Sven Eckelmann @ 2012-10-29 15:30 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

On Monday 29 October 2012 16:10:01 Antonio Quartulli wrote:
> Freeing all the resources when DAT is disabled need a much more complicated
> locking system to prevent concurrent enable/disable operations to destroy
> the internal state of the component. For now it is safe to avoid such
> freeing operation at all when DAT gets disabled.
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---
>  distributed-arp-table.c | 10 ----------
>  sysfs.c                 |  3 +--
>  2 files changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/distributed-arp-table.c b/distributed-arp-table.c
> index c933615..7921030 100644
> --- a/distributed-arp-table.c
> +++ b/distributed-arp-table.c
> @@ -1061,13 +1061,3 @@ out:
>  		batadv_dat_entry_free_ref(dat_entry);
>  	return ret;
>  }
> -
> -void batadv_dat_switch(struct net_device *net_dev)
> -{
> -	struct batadv_priv *bat_priv = netdev_priv(net_dev);
> -
> -	if (atomic_read(&bat_priv->distributed_arp_table))
> -		batadv_dat_init(bat_priv);
> -	else
> -		batadv_dat_free(bat_priv);
> -}

Also remove it from distributed-arp-table.h

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: don't free resources when DAT is disabled
  2012-10-29 15:30 ` Sven Eckelmann
@ 2012-10-29 15:31   ` Antonio Quartulli
  0 siblings, 0 replies; 4+ messages in thread
From: Antonio Quartulli @ 2012-10-29 15:31 UTC (permalink / raw)
  To: Sven Eckelmann; +Cc: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

On Mon, Oct 29, 2012 at 04:30:10PM +0100, Sven Eckelmann wrote:
> On Monday 29 October 2012 16:10:01 Antonio Quartulli wrote:
> > Freeing all the resources when DAT is disabled need a much more complicated
> > locking system to prevent concurrent enable/disable operations to destroy
> > the internal state of the component. For now it is safe to avoid such
> > freeing operation at all when DAT gets disabled.
> > 
> > Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> > ---
> >  distributed-arp-table.c | 10 ----------
> >  sysfs.c                 |  3 +--
> >  2 files changed, 1 insertion(+), 12 deletions(-)
> > 
> > diff --git a/distributed-arp-table.c b/distributed-arp-table.c
> > index c933615..7921030 100644
> > --- a/distributed-arp-table.c
> > +++ b/distributed-arp-table.c
> > @@ -1061,13 +1061,3 @@ out:
> >  		batadv_dat_entry_free_ref(dat_entry);
> >  	return ret;
> >  }
> > -
> > -void batadv_dat_switch(struct net_device *net_dev)
> > -{
> > -	struct batadv_priv *bat_priv = netdev_priv(net_dev);
> > -
> > -	if (atomic_read(&bat_priv->distributed_arp_table))
> > -		batadv_dat_init(bat_priv);
> > -	else
> > -		batadv_dat_free(bat_priv);
> > -}
> 
> Also remove it from distributed-arp-table.h

Right, thanks.


-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-29 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 15:10 [B.A.T.M.A.N.] [PATCH] batman-adv: don't free resources when DAT is disabled Antonio Quartulli
2012-10-29 15:11 ` Antonio Quartulli
2012-10-29 15:30 ` Sven Eckelmann
2012-10-29 15:31   ` Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox