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
bc6b3490
Commit
bc6b3490
authored
Aug 31, 2020
by
Antoine Kaufmann
Browse files
i40e: properly handle disabled queues
parent
e26c1219
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
i40e_bm/i40e_adminq.cc
i40e_bm/i40e_adminq.cc
+6
-0
i40e_bm/i40e_bm.h
i40e_bm/i40e_bm.h
+1
-1
i40e_bm/i40e_queues.cc
i40e_bm/i40e_queues.cc
+9
-1
No files found.
i40e_bm/i40e_adminq.cc
View file @
bc6b3490
...
...
@@ -267,6 +267,9 @@ void queue_admin_tx::cmd_run(void *desc, uint32_t idx, void *data)
void
queue_admin_tx
::
desc_fetched
(
void
*
desc
,
uint32_t
idx
)
{
if
(
!
enabled
)
return
;
struct
i40e_aq_desc
*
d
=
reinterpret_cast
<
struct
i40e_aq_desc
*>
(
desc
);
if
((
d
->
flags
&
I40E_AQ_FLAG_RD
))
{
uint64_t
addr
=
d
->
params
.
external
.
addr_low
|
...
...
@@ -281,6 +284,9 @@ void queue_admin_tx::desc_fetched(void *desc, uint32_t idx)
void
queue_admin_tx
::
data_fetched
(
void
*
desc
,
uint32_t
idx
,
void
*
data
)
{
if
(
!
enabled
)
return
;
cmd_run
(
desc
,
idx
,
data
);
}
...
...
i40e_bm/i40e_bm.h
View file @
bc6b3490
...
...
@@ -89,7 +89,7 @@ class queue_base {
public:
queue_base
(
uint32_t
&
reg_head_
,
uint32_t
&
reg_tail_
);
void
reg_updated
();
bool
is_enabled
();
};
class
queue_admin_tx
:
public
queue_base
{
...
...
i40e_bm/i40e_queues.cc
View file @
bc6b3490
...
...
@@ -19,7 +19,7 @@ queue_base::queue_base(uint32_t ®_head_, uint32_t ®_tail_)
void
queue_base
::
trigger_fetch
()
{
if
(
fetch_head
==
reg_tail
)
if
(
!
enabled
||
fetch_head
==
reg_tail
)
return
;
...
...
@@ -58,6 +58,11 @@ void queue_base::reg_updated()
trigger_fetch
();
}
bool
queue_base
::
is_enabled
()
{
return
enabled
;
}
void
queue_base
::
desc_writeback
(
const
void
*
desc
,
uint32_t
idx
)
{
dma_wb
*
dma
=
new
dma_wb
(
*
this
,
desc_len
);
...
...
@@ -92,6 +97,9 @@ void queue_base::desc_writeback_indirect(const void *desc, uint32_t idx,
void
queue_base
::
desc_written_back
(
uint32_t
idx
)
{
if
(
!
enabled
)
return
;
std
::
cerr
<<
"descriptor "
<<
idx
<<
" written back"
<<
std
::
endl
;
reg_head
=
(
idx
+
1
)
%
len
;
}
...
...
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