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
ef89d0c5
Commit
ef89d0c5
authored
Nov 05, 2020
by
Leonardo Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaner retrieval of allocators
parent
52de4502
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
22 deletions
+26
-22
udpdk/list/udpdk_list_init.c
udpdk/list/udpdk_list_init.c
+22
-0
udpdk/list/udpdk_list_init.h
udpdk/list/udpdk_list_init.h
+2
-0
udpdk/udpdk_poller.c
udpdk/udpdk_poller.c
+2
-22
No files found.
udpdk/list/udpdk_list_init.c
View file @
ef89d0c5
...
...
@@ -4,6 +4,7 @@
extern
const
void
*
list_t_alloc
;
extern
const
void
*
list_node_t_alloc
;
extern
const
void
*
list_iterator_t_alloc
;
extern
const
void
*
bind_info_alloc
;
void
udpdk_list_init
(
void
)
{
...
...
@@ -12,6 +13,27 @@ void udpdk_list_init(void)
list_iterator_t_alloc
=
udpdk_init_allocator
(
"list_iterator_t_alloc"
,
10
,
sizeof
(
list_iterator_t
));
}
int
udpdk_list_reinit
(
void
)
{
list_t_alloc
=
udpdk_retrieve_allocator
(
"list_t_alloc"
);
if
(
list_t_alloc
==
NULL
)
{
return
-
1
;
}
list_node_t_alloc
=
udpdk_retrieve_allocator
(
"list_node_t_alloc"
);
if
(
list_node_t_alloc
==
NULL
)
{
return
-
1
;
}
list_iterator_t_alloc
=
udpdk_retrieve_allocator
(
"list_iterator_t_alloc"
);
if
(
list_iterator_t_alloc
==
NULL
)
{
return
-
1
;
}
bind_info_alloc
=
udpdk_retrieve_allocator
(
"bind_info_alloc"
);
if
(
bind_info_alloc
==
NULL
)
{
return
-
1
;
}
return
0
;
}
void
udpdk_list_deinit
(
void
)
{
udpdk_destroy_allocator
(
list_t_alloc
);
...
...
udpdk/list/udpdk_list_init.h
View file @
ef89d0c5
...
...
@@ -11,6 +11,8 @@
void
udpdk_list_init
(
void
);
int
udpdk_list_reinit
(
void
);
void
udpdk_list_deinit
(
void
);
#endif // UDPDK_LIST_INIT_H
udpdk/udpdk_poller.c
View file @
ef89d0c5
...
...
@@ -38,10 +38,6 @@ static volatile int poller_alive = 1;
extern
struct
exch_zone_info
*
exch_zone_desc
;
extern
struct
exch_slot
*
exch_slots
;
extern
list_t
**
sock_bind_table
;
extern
const
void
*
list_t_alloc
;
extern
const
void
*
list_node_t_alloc
;
extern
const
void
*
list_iterator_t_alloc
;
extern
const
void
*
bind_info_alloc
;
/* Descriptor of a RX queue */
struct
rx_queue
{
...
...
@@ -90,24 +86,8 @@ static inline const char * get_exch_ring_name(unsigned id, enum exch_ring_func f
/* Initialize the allocators */
static
int
setup_allocators
(
void
)
{
list_t_alloc
=
udpdk_retrieve_allocator
(
"list_t_alloc"
);
if
(
list_t_alloc
==
NULL
)
{
RTE_LOG
(
ERR
,
POLLINIT
,
"Cannot retrieve list_t allocator
\n
"
);
return
-
1
;
}
list_node_t_alloc
=
udpdk_retrieve_allocator
(
"list_node_t_alloc"
);
if
(
list_node_t_alloc
==
NULL
)
{
RTE_LOG
(
ERR
,
POLLINIT
,
"Cannot retrieve list_node_t allocator
\n
"
);
return
-
1
;
}
list_iterator_t_alloc
=
udpdk_retrieve_allocator
(
"list_iterator_t_alloc"
);
if
(
list_iterator_t_alloc
==
NULL
)
{
RTE_LOG
(
ERR
,
POLLINIT
,
"Cannot retrieve list_iterator_t allocator
\n
"
);
return
-
1
;
}
bind_info_alloc
=
udpdk_retrieve_allocator
(
"bind_info_alloc"
);
if
(
bind_info_alloc
==
NULL
)
{
RTE_LOG
(
ERR
,
POLLINIT
,
"Cannot retrieve bind_info allocator
\n
"
);
if
(
udpdk_list_reinit
()
<
0
)
{
RTE_LOG
(
ERR
,
POLLINIT
,
"Cannot retrieve shmem allocators
\n
"
);
return
-
1
;
}
return
0
;
...
...
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