Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
231b6d8c
Commit
231b6d8c
authored
Jul 18, 2012
by
Tomasz Wlostowski
Committed by
Alessandro Rubini
Jul 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/wrsw_rtud: don't learn on ports that are down
parent
65d7fe71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
rtu_drv.c
userspace/wrsw_rtud/rtu_drv.c
+1
-0
rtud.c
userspace/wrsw_rtud/rtud.c
+15
-6
No files found.
userspace/wrsw_rtud/rtu_drv.c
View file @
231b6d8c
...
...
@@ -183,6 +183,7 @@ int rtu_read_learning_queue(struct rtu_request *req)
return
err
;
}
// read data from mapped IO memory
uint32_t
r0
=
rtu_rd
(
UFIFO_R0
);
uint32_t
r1
=
rtu_rd
(
UFIFO_R1
);
...
...
userspace/wrsw_rtud/rtud.c
View file @
231b6d8c
...
...
@@ -78,9 +78,8 @@ static int rtu_create_static_entries()
uint32_t
enabled_port_mask
=
0
;
// packets addressed to WR card interfaces are forwarded to NIC virtual port
TRACE
(
TRACE_INFO
,
"qp %d"
,
halexp_query_ports
(
&
ports
));
halexp_query_ports
(
&
ports
);
TRACE
(
TRACE_INFO
,
"Number of physical ports: %d, active ports: %d
\n
"
,
ports
.
num_physical_ports
,
ports
.
num_ports
);
// VLAN-aware Bridge reserved addresses (802.1Q-2005 Table 8.1)
...
...
@@ -92,7 +91,6 @@ static int rtu_create_static_entries()
return
err
;
}
memset
(
port_state
,
0
,
sizeof
(
port_state
));
for
(
i
=
0
;
i
<
ports
.
num_ports
;
i
++
)
{
...
...
@@ -211,7 +209,7 @@ static void *rtu_daemon_wripc_process(void *arg)
*/
static
int
rtu_daemon_learning_process
()
{
int
err
;
int
err
,
i
,
port_down
;
struct
rtu_request
req
;
// Request read from learning queue
uint32_t
port_map
;
// Destination port map
uint16_t
vid
;
// VLAN identifier
...
...
@@ -220,7 +218,7 @@ static int rtu_daemon_learning_process()
// Serve pending unrecognised request
err
=
rtu_read_learning_queue
(
&
req
);
if
(
!
err
)
{
TRACE
_DBG
(
TRACE
(
TRACE_INFO
,
"ureq: port %d src %s VID %d priority %d"
,
req
.
port_id
,
...
...
@@ -228,6 +226,17 @@ static int rtu_daemon_learning_process()
req
.
has_vid
?
req
.
vid
:
0
,
req
.
has_prio
?
req
.
prio
:
0
);
for
(
port_down
=
i
=
0
;
i
<=
MAX_PORT
;
i
++
)
if
(
port_state
[
i
].
in_use
&&
port_state
[
i
].
hw_index
==
req
.
port_id
&&
!
port_state
[
i
].
is_up
)
{
port_down
=
1
;
break
;
}
/* don't learn on ports that are down (FIFO tail?) */
if
(
port_down
)
continue
;
// If req has no VID, use 0 (untagged packet)
vid
=
req
.
has_vid
?
req
.
vid
:
0
;
port_map
=
(
1
<<
req
.
port_id
);
...
...
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