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
721dbbba
Commit
721dbbba
authored
Oct 07, 2020
by
Leonardo Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
9c13289b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
apps/pingpong/main.c
apps/pingpong/main.c
+12
-6
No files found.
apps/pingpong/main.c
View file @
721dbbba
...
@@ -125,7 +125,8 @@ static void pong_body(void)
...
@@ -125,7 +125,8 @@ static void pong_body(void)
static
void
usage
(
void
)
static
void
usage
(
void
)
{
{
printf
(
"%s [EAL options] -- -f FUNCTION
\n
"
printf
(
"%s -c CONFIG -f FUNCTION
\n
"
" -c CONFIG: .ini configuration file"
" -f FUNCTION: 'ping' or 'pong'
\n
"
" -f FUNCTION: 'ping' or 'pong'
\n
"
,
progname
);
,
progname
);
}
}
...
@@ -137,8 +138,11 @@ static int parse_app_args(int argc, char *argv[])
...
@@ -137,8 +138,11 @@ static int parse_app_args(int argc, char *argv[])
progname
=
argv
[
0
];
progname
=
argv
[
0
];
while
((
c
=
getopt
(
argc
,
argv
,
"
f:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"c:
f:"
))
!=
-
1
)
{
switch
(
c
)
{
switch
(
c
)
{
case
'c'
:
// this is for the .ini cfg file needed by DPDK, not by the app
break
;
case
'f'
:
case
'f'
:
if
(
strcmp
(
optarg
,
"ping"
)
==
0
)
{
if
(
strcmp
(
optarg
,
"ping"
)
==
0
)
{
mode
=
PING
;
mode
=
PING
;
...
@@ -168,18 +172,18 @@ int main(int argc, char *argv[])
...
@@ -168,18 +172,18 @@ int main(int argc, char *argv[])
// Initialize UDPDK
// Initialize UDPDK
retval
=
udpdk_init
(
argc
,
argv
);
retval
=
udpdk_init
(
argc
,
argv
);
if
(
retval
!=
0
)
{
if
(
retval
<
0
)
{
goto
pingpong_end
;
return
-
1
;
return
-
1
;
}
}
argc
-=
retval
;
argv
+=
retval
;
sleep
(
2
);
sleep
(
2
);
printf
(
"UDPDK Intialized
\n
"
);
printf
(
"
App:
UDPDK Intialized
\n
"
);
// Parse app-specific arguments
// Parse app-specific arguments
printf
(
"Parsing app arguments...
\n
"
);
printf
(
"Parsing app arguments...
\n
"
);
retval
=
parse_app_args
(
argc
,
argv
);
retval
=
parse_app_args
(
argc
,
argv
);
if
(
retval
!=
0
)
{
if
(
retval
!=
0
)
{
goto
pingpong_end
;
return
-
1
;
return
-
1
;
}
}
...
@@ -190,6 +194,8 @@ int main(int argc, char *argv[])
...
@@ -190,6 +194,8 @@ int main(int argc, char *argv[])
pong_body
();
pong_body
();
}
}
pingpong_end:
udpdk_interrupt
(
0
);
udpdk_cleanup
();
udpdk_cleanup
();
return
0
;
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