Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
348ef09c
Commit
348ef09c
authored
Jun 15, 2020
by
Jialin Li
Browse files
add queueEnable and check for queue CONT mode
parent
aca9dc80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
corundum_bm/corundum_bm.cc
corundum_bm/corundum_bm.cc
+25
-2
corundum_bm/corundum_bm.h
corundum_bm/corundum_bm.h
+7
-0
No files found.
corundum_bm/corundum_bm.cc
View file @
348ef09c
...
...
@@ -4,6 +4,7 @@
#include <sys/socket.h>
#include <unistd.h>
#include <signal.h>
#include <cassert>
#include "corundum_bm.h"
...
...
@@ -83,7 +84,8 @@ DescRing::setSizeLog(size_t size_log)
void
DescRing
::
setIndex
(
unsigned
index
)
{
this
->
_index
=
index
;
assert
(
!
(
index
&
QUEUE_CONT_MASK
));
this
->
_index
=
index
&
0xFF
;
}
void
...
...
@@ -101,7 +103,8 @@ DescRing::setTailPtr(unsigned ptr)
Port
::
Port
()
:
_id
(
0
),
_features
(
0
),
_mtu
(
0
),
_schedCount
(
0
),
_schedOffset
(
0
),
_schedStride
(
0
),
_schedType
(
0
),
_rssMask
(
0
),
_schedEnable
(
false
)
_schedType
(
0
),
_rssMask
(
0
),
_schedEnable
(
false
),
_queueEnable
(
false
)
{
}
...
...
@@ -222,6 +225,19 @@ Port::schedDisable()
this
->
_schedEnable
=
false
;
}
void
Port
::
queueEnable
()
{
this
->
_queueEnable
=
true
;
}
void
Port
::
queueDisable
()
{
this
->
_queueEnable
=
false
;
}
void
queueDisable
();
Corundum
::
Corundum
()
{
this
->
port
.
setId
(
0
);
...
...
@@ -437,6 +453,13 @@ Corundum::writeReg(addr_t addr, reg_t val)
case
PORT_REG_RSS_MASK
:
this
->
port
.
setRssMask
(
val
);
break
;
case
PORT_QUEUE_ENABLE
:
if
(
val
)
{
this
->
port
.
queueEnable
();
}
else
{
this
->
port
.
queueDisable
();
}
break
;
default:
fprintf
(
stderr
,
"Unknown register write %lx
\n
"
,
addr
);
abort
();
...
...
corundum_bm/corundum_bm.h
View file @
348ef09c
...
...
@@ -45,6 +45,8 @@ typedef uint64_t addr_t;
#define IF_REG_PORT_STRIDE 0x80048
#define QUEUE_ACTIVE_MASK 0x80000000
#define QUEUE_ARM_MASK 0x80000000
#define QUEUE_CONT_MASK 0x40000000
#define EVENT_QUEUE_BASE_ADDR_REG 0x100000
#define EVENT_QUEUE_ACTIVE_LOG_SIZE_REG 0x100008
...
...
@@ -86,6 +88,8 @@ typedef uint64_t addr_t;
#define PORT_REG_SCHED_ENABLE 0x800040
#define PORT_REG_RSS_MASK 0x800080
#define PORT_QUEUE_ENABLE 0x900000
namespace
corundum
{
class
DescRing
{
...
...
@@ -140,6 +144,8 @@ public:
void
setRssMask
(
unsigned
mask
);
void
schedEnable
();
void
schedDisable
();
void
queueEnable
();
void
queueDisable
();
private:
unsigned
_id
;
...
...
@@ -151,6 +157,7 @@ private:
unsigned
_schedType
;
unsigned
_rssMask
;
bool
_schedEnable
;
bool
_queueEnable
;
};
class
Corundum
{
...
...
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