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
f9eeb643
Commit
f9eeb643
authored
Sep 03, 2020
by
Antoine Kaufmann
Browse files
i40e: count pending fetches against descriptor limit
parent
cc4b0d1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
i40e_bm/i40e_bm.h
i40e_bm/i40e_bm.h
+1
-0
i40e_bm/i40e_queues.cc
i40e_bm/i40e_queues.cc
+5
-2
No files found.
i40e_bm/i40e_bm.h
View file @
f9eeb643
...
@@ -74,6 +74,7 @@ class queue_base {
...
@@ -74,6 +74,7 @@ class queue_base {
bool
enabled
;
bool
enabled
;
size_t
desc_len
;
size_t
desc_len
;
uint32_t
pending_fetches
;
void
trigger_fetch
();
void
trigger_fetch
();
void
data_fetch
(
const
void
*
desc
,
uint32_t
idx
,
uint64_t
addr
,
size_t
len
);
void
data_fetch
(
const
void
*
desc
,
uint32_t
idx
,
uint64_t
addr
,
size_t
len
);
...
...
i40e_bm/i40e_queues.cc
View file @
f9eeb643
...
@@ -13,7 +13,7 @@ extern nicbm::Runner *runner;
...
@@ -13,7 +13,7 @@ extern nicbm::Runner *runner;
queue_base
::
queue_base
(
uint32_t
&
reg_head_
,
uint32_t
&
reg_tail_
)
queue_base
::
queue_base
(
uint32_t
&
reg_head_
,
uint32_t
&
reg_tail_
)
:
base
(
0
),
len
(
0
),
fetch_head
(
0
),
reg_head
(
reg_head_
),
reg_tail
(
reg_tail_
),
:
base
(
0
),
len
(
0
),
fetch_head
(
0
),
reg_head
(
reg_head_
),
reg_tail
(
reg_tail_
),
enabled
(
false
),
desc_len
(
0
)
enabled
(
false
),
desc_len
(
0
)
,
pending_fetches
(
0
)
{
{
}
}
...
@@ -22,7 +22,7 @@ void queue_base::trigger_fetch()
...
@@ -22,7 +22,7 @@ void queue_base::trigger_fetch()
if
(
!
enabled
||
fetch_head
==
reg_tail
)
if
(
!
enabled
||
fetch_head
==
reg_tail
)
return
;
return
;
if
(
max_fetch_capacity
()
==
0
)
if
(
max_fetch_capacity
()
<
pending_fetches
+
1
)
return
;
return
;
dma_fetch
*
dma
=
new
dma_fetch
(
*
this
,
desc_len
);
dma_fetch
*
dma
=
new
dma_fetch
(
*
this
,
desc_len
);
...
@@ -30,6 +30,8 @@ void queue_base::trigger_fetch()
...
@@ -30,6 +30,8 @@ void queue_base::trigger_fetch()
dma
->
dma_addr
=
base
+
fetch_head
*
desc_len
;
dma
->
dma_addr
=
base
+
fetch_head
*
desc_len
;
dma
->
index
=
fetch_head
;
dma
->
index
=
fetch_head
;
pending_fetches
++
;
std
::
cerr
<<
"fetching "
<<
(
reg_tail
-
fetch_head
)
%
len
<<
std
::
cerr
<<
"fetching "
<<
(
reg_tail
-
fetch_head
)
%
len
<<
" descriptors from "
<<
dma
->
dma_addr
<<
std
::
endl
;
" descriptors from "
<<
dma
->
dma_addr
<<
std
::
endl
;
...
@@ -136,6 +138,7 @@ queue_base::dma_fetch::~dma_fetch()
...
@@ -136,6 +138,7 @@ queue_base::dma_fetch::~dma_fetch()
void
queue_base
::
dma_fetch
::
done
()
void
queue_base
::
dma_fetch
::
done
()
{
{
queue
.
pending_fetches
--
;
queue
.
desc_fetched
(
data
,
index
);
queue
.
desc_fetched
(
data
,
index
);
delete
this
;
delete
this
;
}
}
...
...
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