Commit 4e5655fc authored by Adam Wujek's avatar Adam Wujek

Revert "RTU: use wrs_shm_follow at reopening of the shmem"

This reverts commit fe624dc1.
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent ca6248aa
Pipeline #856 failed with stage
in 57 minutes and 27 seconds
......@@ -163,6 +163,10 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
/* rtu_hdr was created at header->offset */
rtu_hdr = (void *)rtu_shmem_p + rtu_shmem_p->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",
......@@ -180,9 +184,16 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
clean_fd(SHM_NOT_LOCK); /* clean filtering database,
shem already locked */
} else {
pr_info("Using existing filtering table.\n");
pr_info("Use existing filtering table.\n");
/* next RTUd runs */
rtu_htab = wrs_shm_follow(rtu_shmem_p, rtu_hdr->filters);
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;
}
if (!rtu_hdr->vlans) {
......@@ -197,7 +208,14 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
} else {
pr_info("Using existing vlan table.\n");
/* next RTUd runs */
vlan_tab = wrs_shm_follow(rtu_shmem_p, rtu_hdr->vlans);
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;
}
if (!rtu_hdr->mirror) {
......@@ -212,7 +230,15 @@ int rtu_fd_init(uint16_t poly, unsigned long aging)
} else {
pr_info("Using existing port mirroring config.\n");
/* next RTUd runs */
mirror_cfg = wrs_shm_follow(rtu_shmem_p, rtu_hdr->mirror);
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;
}
if (!rtu_hdr->rtu_ports) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment