Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
U
udpdk
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ywj
udpdk
Commits
6ac4152f
Commit
6ac4152f
authored
Nov 05, 2020
by
Leonardo Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leak
parent
e14a8f93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
udpdk/udpdk_bind_table.h
udpdk/udpdk_bind_table.h
+2
-0
udpdk/udpdk_init.c
udpdk/udpdk_init.c
+15
-4
No files found.
udpdk/udpdk_bind_table.h
View file @
6ac4152f
...
...
@@ -20,4 +20,6 @@ void btable_del_binding(int s, int port);
list_t
*
btable_get_bindings
(
int
port
);
void
btable_destroy
(
void
);
#endif //UDPDK_BIND_TABLE_H
udpdk/udpdk_init.c
View file @
6ac4152f
...
...
@@ -223,7 +223,7 @@ static void check_port_link_status(uint16_t portid) {
}
/* Initialize a shared memory region to contain descriptors for the exchange slots */
static
int
init_
shared
_memzone
(
void
)
static
int
init_
exch
_memzone
(
void
)
{
const
struct
rte_memzone
*
mz
;
...
...
@@ -238,7 +238,15 @@ static int init_shared_memzone(void)
return
0
;
}
/* Initialize table in shared memory for UDP port switching */
static
int
destroy_exch_memzone
(
void
)
{
const
struct
rte_memzone
*
mz
;
mz
=
rte_memzone_lookup
(
EXCH_MEMZONE_NAME
);
return
rte_memzone_free
(
mz
);
}
/* Initialize a shared memory region to store the L4 switching table */
static
int
init_udp_bind_table
(
void
)
{
const
struct
rte_memzone
*
mz
;
...
...
@@ -345,7 +353,7 @@ int udpdk_init(int argc, char *argv[])
}
// Initialize memzone for exchange
retval
=
init_
shared
_memzone
();
retval
=
init_
exch
_memzone
();
if
(
retval
<
0
)
{
RTE_LOG
(
ERR
,
INIT
,
"Cannot initialize memzone for exchange zone descriptors
\n
"
);
return
-
1
;
...
...
@@ -414,8 +422,11 @@ void udpdk_cleanup(void)
// Close all open sockets
udpdk_close_all_sockets
();
// Free the
bindings
table
// Free the
memory of L4 switching
table
destroy_udp_bind_table
();
// Free the memory for exch zone
destroy_exch_memzone
();
// Release linked-list memory allocators
udpdk_list_deinit
();
...
...
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