netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net] switchdev: bridge: Pass ageing time as clock_t instead of jiffies
@ 2015-12-21  8:56 Jiri Pirko
  2015-12-21 15:53 ` David Ahern
  2015-12-22 20:57 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jiri Pirko @ 2015-12-21  8:56 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, stephen, Jiri Pirko

From: Ido Schimmel <idosch@mellanox.com>

The bridge's ageing time is offloaded to hardware when:
	1) A port joins a bridge
	2) The ageing time of the bridge is changed

In the first case the ageing time is offloaded as jiffies, but in the
second case it's offloaded as clock_t, which is what existing switchdev
drivers expect to receive.

Fixes: 6ac311ae8bfb ("Adding switchdev ageing notification on port bridged")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/bridge/br_stp_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 5396ff08..12045de 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -39,7 +39,7 @@ void br_init_port(struct net_bridge_port *p)
 	struct switchdev_attr attr = {
 		.id = SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
 		.flags = SWITCHDEV_F_SKIP_EOPNOTSUPP | SWITCHDEV_F_DEFER,
-		.u.ageing_time = p->br->ageing_time,
+		.u.ageing_time = jiffies_to_clock_t(p->br->ageing_time),
 	};
 	int err;
 
-- 
2.4.3

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

* Re: [patch net] switchdev: bridge: Pass ageing time as clock_t instead of jiffies
  2015-12-21  8:56 [patch net] switchdev: bridge: Pass ageing time as clock_t instead of jiffies Jiri Pirko
@ 2015-12-21 15:53 ` David Ahern
  2015-12-21 16:50   ` Ido Schimmel
  2015-12-22 20:57 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: David Ahern @ 2015-12-21 15:53 UTC (permalink / raw)
  To: Jiri Pirko, netdev; +Cc: davem, idosch, eladr, yotamg, stephen, Jiri Pirko

On 12/21/15 3:56 AM, Jiri Pirko wrote:
> diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
> index 5396ff08..12045de 100644
> --- a/net/bridge/br_stp_if.c
> +++ b/net/bridge/br_stp_if.c
> @@ -39,7 +39,7 @@ void br_init_port(struct net_bridge_port *p)
>   	struct switchdev_attr attr = {
>   		.id = SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
>   		.flags = SWITCHDEV_F_SKIP_EOPNOTSUPP | SWITCHDEV_F_DEFER,
> -		.u.ageing_time = p->br->ageing_time,
> +		.u.ageing_time = jiffies_to_clock_t(p->br->ageing_time),
>   	};
>   	int err;


ageing_time is a u32; clock_t is a long.

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

* Re: [patch net] switchdev: bridge: Pass ageing time as clock_t instead of jiffies
  2015-12-21 15:53 ` David Ahern
@ 2015-12-21 16:50   ` Ido Schimmel
  0 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2015-12-21 16:50 UTC (permalink / raw)
  To: David Ahern; +Cc: Jiri Pirko, netdev, davem, eladr, yotamg, stephen, Jiri Pirko

Mon, Dec 21, 2015 at 05:53:19PM IST, dsahern@gmail.com wrote:
>On 12/21/15 3:56 AM, Jiri Pirko wrote:
>> diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
>> index 5396ff08..12045de 100644
>> --- a/net/bridge/br_stp_if.c
>> +++ b/net/bridge/br_stp_if.c
>> @@ -39,7 +39,7 @@ void br_init_port(struct net_bridge_port *p)
>>   	struct switchdev_attr attr = {
>>   		.id = SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
>>   		.flags = SWITCHDEV_F_SKIP_EOPNOTSUPP | SWITCHDEV_F_DEFER,
>> -		.u.ageing_time = p->br->ageing_time,
>> +		.u.ageing_time = jiffies_to_clock_t(p->br->ageing_time),
>>   	};
>>   	int err;
>
>
>ageing_time is a u32; clock_t is a long.

Hi,

p->br->ageing_time is set in br_set_ageing_time, where it's converted to
jiffies from clock_t, that is treated as u32.

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

* Re: [patch net] switchdev: bridge: Pass ageing time as clock_t instead of jiffies
  2015-12-21  8:56 [patch net] switchdev: bridge: Pass ageing time as clock_t instead of jiffies Jiri Pirko
  2015-12-21 15:53 ` David Ahern
@ 2015-12-22 20:57 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2015-12-22 20:57 UTC (permalink / raw)
  To: jiri; +Cc: netdev, idosch, eladr, yotamg, stephen, jiri

From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 21 Dec 2015 09:56:01 +0100

> From: Ido Schimmel <idosch@mellanox.com>
> 
> The bridge's ageing time is offloaded to hardware when:
> 	1) A port joins a bridge
> 	2) The ageing time of the bridge is changed
> 
> In the first case the ageing time is offloaded as jiffies, but in the
> second case it's offloaded as clock_t, which is what existing switchdev
> drivers expect to receive.
> 
> Fixes: 6ac311ae8bfb ("Adding switchdev ageing notification on port bridged")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied and queued up for -stable, thanks!

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

end of thread, other threads:[~2015-12-22 20:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21  8:56 [patch net] switchdev: bridge: Pass ageing time as clock_t instead of jiffies Jiri Pirko
2015-12-21 15:53 ` David Ahern
2015-12-21 16:50   ` Ido Schimmel
2015-12-22 20:57 ` David Miller

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).