Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
123dd0e7
Commit
123dd0e7
authored
Apr 28, 2003
by
Stephen Hemminger
Committed by
David S. Miller
Apr 28, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BRIDGE}: More user hz conversions.
parent
bc261db7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
17 deletions
+20
-17
net/bridge/br_fdb.c
net/bridge/br_fdb.c
+4
-4
net/bridge/br_ioctl.c
net/bridge/br_ioctl.c
+16
-13
No files found.
net/bridge/br_fdb.c
View file @
123dd0e7
...
...
@@ -41,15 +41,15 @@ static __inline__ int has_expired(struct net_bridge *br,
return
0
;
}
static
__inline__
void
copy_fdb
(
struct
__fdb_entry
*
ent
,
struct
net_bridge_fdb_entry
*
f
)
static
__inline__
void
copy_fdb
(
struct
__fdb_entry
*
ent
,
const
struct
net_bridge_fdb_entry
*
f
)
{
memset
(
ent
,
0
,
sizeof
(
struct
__fdb_entry
));
memcpy
(
ent
->
mac_addr
,
f
->
addr
.
addr
,
ETH_ALEN
);
ent
->
port_no
=
f
->
dst
?
f
->
dst
->
port_no
:
0
;
ent
->
is_local
=
f
->
is_local
;
ent
->
ageing_timer_value
=
0
;
if
(
!
f
->
is_static
)
ent
->
ageing_timer_value
=
jiffies
-
f
->
ageing_timer
;
ent
->
ageing_timer_value
=
f
->
is_static
?
0
:
((
jiffies
-
f
->
ageing_timer
)
*
USER_HZ
)
/
HZ
;
}
static
__inline__
int
br_mac_hash
(
unsigned
char
*
mac
)
...
...
net/bridge/br_ioctl.c
View file @
123dd0e7
...
...
@@ -19,19 +19,22 @@
#include <asm/uaccess.h>
#include "br_private.h"
/* import values in USER_HZ */
static
inline
unsigned
long
user_to_ticks
(
unsigned
long
utick
)
{
return
(
utick
*
HZ
)
/
USER_HZ
;
}
/*
Report time remaining in user HZ for compatibility.
*/
static
inline
unsigned
long
ti
mer_residue
(
const
struct
br_timer
*
timer
)
/*
export values in USER_HZ
*/
static
inline
unsigned
long
ti
cks_to_user
(
unsigned
long
tick
)
{
return
timer
->
running
?
((
jiffies
-
timer
->
expires
)
*
USER_HZ
)
/
HZ
:
0
;
return
(
tick
*
USER_HZ
)
/
HZ
;
}
/*
Convert API times in USER_HZ to kernel
*/
static
inline
unsigned
long
user_to_ticks
(
unsigned
long
utick
)
/*
Report time remaining in user HZ
*/
static
unsigned
long
timer_residue
(
const
struct
br_timer
*
timer
)
{
return
(
utick
*
HZ
)
/
USER_HZ
;
return
ticks_to_user
(
timer
->
running
?
(
jiffies
-
timer
->
expires
)
:
0
)
;
}
static
int
br_ioctl_device
(
struct
net_bridge
*
br
,
...
...
@@ -73,18 +76,18 @@ static int br_ioctl_device(struct net_bridge *br,
memcpy
(
&
b
.
designated_root
,
&
br
->
designated_root
,
8
);
memcpy
(
&
b
.
bridge_id
,
&
br
->
bridge_id
,
8
);
b
.
root_path_cost
=
br
->
root_path_cost
;
b
.
max_age
=
br
->
max_age
;
b
.
hello_time
=
br
->
hello_time
;
b
.
max_age
=
ticks_to_user
(
br
->
max_age
)
;
b
.
hello_time
=
ticks_to_user
(
br
->
hello_time
)
;
b
.
forward_delay
=
br
->
forward_delay
;
b
.
bridge_max_age
=
br
->
bridge_max_age
;
b
.
bridge_hello_time
=
br
->
bridge_hello_time
;
b
.
bridge_forward_delay
=
br
->
bridge_forward_delay
;
b
.
bridge_forward_delay
=
ticks_to_user
(
br
->
bridge_forward_delay
)
;
b
.
topology_change
=
br
->
topology_change
;
b
.
topology_change_detected
=
br
->
topology_change_detected
;
b
.
root_port
=
br
->
root_port
;
b
.
stp_enabled
=
br
->
stp_enabled
;
b
.
ageing_time
=
br
->
ageing_time
;
b
.
gc_interval
=
br
->
gc_interval
;
b
.
ageing_time
=
ticks_to_user
(
br
->
ageing_time
)
;
b
.
gc_interval
=
ticks_to_user
(
br
->
gc_interval
)
;
b
.
hello_timer_value
=
timer_residue
(
&
br
->
hello_timer
);
b
.
tcn_timer_value
=
timer_residue
(
&
br
->
tcn_timer
);
b
.
topology_change_timer_value
=
timer_residue
(
&
br
->
topology_change_timer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment