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
fe624dc1
Commit
fe624dc1
authored
Oct 16, 2020
by
Adam Wujek
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTU: use wrs_shm_follow at reopening of the shmem
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
33abdd3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
30 deletions
+4
-30
rtu_fd.c
userspace/wrsw_rtud/rtu_fd.c
+4
-30
No files found.
userspace/wrsw_rtud/rtu_fd.c
View file @
fe624dc1
...
...
@@ -152,10 +152,6 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
}
else
{
/* rtu_hdr was created at header->offset */
rtu_hdr
=
(
void
*
)
rtu_port_shmem
+
rtu_port_shmem
->
data_off
;
/* move data_size to have have similar behavior like
* wrs_shm_alloc, needed for future allocations */
/* force 8-alignment */
rtu_port_shmem
->
data_size
+=
(
sizeof
(
*
rtu_hdr
)
+
7
)
&
~
7
;
}
if
(
!
rtu_hdr
)
{
pr_error
(
"%s: Cannot allocate mem in shmem rtu_hdr
\n
"
,
...
...
@@ -175,16 +171,9 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
clean_fd
(
SHM_NOT_LOCK
);
/* clean filtering database,
shem already locked */
}
else
{
pr_info
(
"Us
e
existing filtering table.
\n
"
);
pr_info
(
"Us
ing
existing filtering table.
\n
"
);
/* next RTUd runs */
rtu_hdr
->
filters
=
(
void
*
)
rtu_port_shmem
+
rtu_hdr
->
filters_offset
;
rtu_htab
=
(
void
*
)
rtu_hdr
->
filters
;
/* move data_size to have have similar behavior like
* wrs_shm_alloc, needed for future allocations */
/* force 8-alignment */
rtu_port_shmem
->
data_size
+=
(
sizeof
(
*
rtu_htab
)
*
HTAB_ENTRIES
+
7
)
&
~
7
;
rtu_htab
=
wrs_shm_follow
(
rtu_shmem_p
,
rtu_hdr
->
filters
);
}
if
(
!
rtu_hdr
->
vlans
)
{
...
...
@@ -201,14 +190,7 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
}
else
{
pr_info
(
"Using existing vlan table.
\n
"
);
/* next RTUd runs */
rtu_hdr
->
vlans
=
(
void
*
)
rtu_port_shmem
+
rtu_hdr
->
vlans_offset
;
vlan_tab
=
(
void
*
)
rtu_hdr
->
vlans
;
/* move data_size to have have similar behavior like
* wrs_shm_alloc, needed for future allocations */
/* force 8-alignment */
rtu_port_shmem
->
data_size
+=
(
sizeof
(
*
vlan_tab
)
*
NUM_VLANS
+
7
)
&
~
7
;
vlan_tab
=
wrs_shm_follow
(
rtu_shmem_p
,
rtu_hdr
->
vlans
);
}
if
(
!
rtu_hdr
->
mirror
)
{
...
...
@@ -225,15 +207,7 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
}
else
{
pr_info
(
"Using existing port mirroring config.
\n
"
);
/* next RTUd runs */
rtu_hdr
->
mirror
=
(
void
*
)
rtu_port_shmem
+
rtu_hdr
->
mirror_offset
;
mirror_cfg
=
(
void
*
)
rtu_hdr
->
mirror
;
/* move data_size to have have similar behavior like
* wrs_shm_alloc, needed for future allocations
* force 8-alignment
*/
rtu_port_shmem
->
data_size
+=
(
sizeof
(
*
mirror_cfg
)
*
NUM_MIRROR
+
7
)
&
~
7
;
mirror_cfg
=
wrs_shm_follow
(
rtu_shmem_p
,
rtu_hdr
->
mirror
);
}
if
((
!
rtu_htab
)
||
(
!
vlan_tab
)
||
(
!
mirror_cfg
))
{
...
...
Adam Wujek
💬
@awujek
mentioned in commit
4e5655fc
·
Jan 28, 2021
mentioned in commit
4e5655fc
mentioned in commit 4e5655fc198ad47b3c57880df0c1fd96cfc10380
Toggle commit list
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