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
e19aba65
Commit
e19aba65
authored
Sep 16, 2020
by
Antoine Kaufmann
Browse files
i40e: support for large (>4k) descriptor data fetch
parent
f8212a66
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
i40e_bm/i40e_bm.h
i40e_bm/i40e_bm.h
+4
-0
i40e_bm/i40e_queues.cc
i40e_bm/i40e_queues.cc
+20
-2
No files found.
i40e_bm/i40e_bm.h
View file @
e19aba65
...
@@ -150,6 +150,8 @@ class queue_base {
...
@@ -150,6 +150,8 @@ class queue_base {
desc_ctx
&
ctx
;
desc_ctx
&
ctx
;
public:
public:
size_t
total_len
;
size_t
part_offset
;
dma_data_fetch
(
desc_ctx
&
ctx_
,
size_t
len
,
void
*
buffer
);
dma_data_fetch
(
desc_ctx
&
ctx_
,
size_t
len
,
void
*
buffer
);
virtual
~
dma_data_fetch
();
virtual
~
dma_data_fetch
();
virtual
void
done
();
virtual
void
done
();
...
@@ -159,6 +161,8 @@ class queue_base {
...
@@ -159,6 +161,8 @@ class queue_base {
protected:
protected:
desc_ctx
&
ctx
;
desc_ctx
&
ctx
;
public:
public:
size_t
total_len
;
size_t
part_offset
;
dma_data_wb
(
desc_ctx
&
ctx_
,
size_t
len
);
dma_data_wb
(
desc_ctx
&
ctx_
,
size_t
len
);
virtual
~
dma_data_wb
();
virtual
~
dma_data_wb
();
virtual
void
done
();
virtual
void
done
();
...
...
i40e_bm/i40e_queues.cc
View file @
e19aba65
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include <string.h>
#include <string.h>
#include <cassert>
#include <cassert>
#include <iostream>
#include <iostream>
#include <algorithm>
#include "i40e_bm.h"
#include "i40e_bm.h"
...
@@ -289,6 +290,8 @@ void queue_base::desc_ctx::processed()
...
@@ -289,6 +290,8 @@ void queue_base::desc_ctx::processed()
state
=
DESC_PROCESSED
;
state
=
DESC_PROCESSED
;
}
}
#define MAX_DMA_SIZE ((size_t) 0x1000)
void
queue_base
::
desc_ctx
::
data_fetch
(
uint64_t
addr
,
size_t
data_len
)
void
queue_base
::
desc_ctx
::
data_fetch
(
uint64_t
addr
,
size_t
data_len
)
{
{
if
(
data_capacity
<
data_len
)
{
if
(
data_capacity
<
data_len
)
{
...
@@ -302,7 +305,10 @@ void queue_base::desc_ctx::data_fetch(uint64_t addr, size_t data_len)
...
@@ -302,7 +305,10 @@ void queue_base::desc_ctx::data_fetch(uint64_t addr, size_t data_len)
data_capacity
=
data_len
;
data_capacity
=
data_len
;
}
}
dma_data_fetch
*
dma
=
new
dma_data_fetch
(
*
this
,
data_len
,
data
);
dma_data_fetch
*
dma
=
new
dma_data_fetch
(
*
this
,
std
::
min
(
data_len
,
MAX_DMA_SIZE
),
data
);
dma
->
part_offset
=
0
;
dma
->
total_len
=
data_len
;
dma
->
write
=
false
;
dma
->
write
=
false
;
dma
->
dma_addr
=
addr
;
dma
->
dma_addr
=
addr
;
...
@@ -387,7 +393,19 @@ queue_base::dma_data_fetch::~dma_data_fetch()
...
@@ -387,7 +393,19 @@ queue_base::dma_data_fetch::~dma_data_fetch()
void
queue_base
::
dma_data_fetch
::
done
()
void
queue_base
::
dma_data_fetch
::
done
()
{
{
ctx
.
data_fetched
(
dma_addr
,
len
);
part_offset
+=
len
;
dma_addr
+=
len
;
data
=
(
uint8_t
*
)
data
+
len
;
if
(
part_offset
<
total_len
)
{
#ifdef DEBUG_QUEUES
ctx
.
queue
.
log
<<
" dma_fetch: next part of multi part dma"
<<
logger
::
endl
;
#endif
len
=
std
::
min
(
total_len
-
part_offset
,
MAX_DMA_SIZE
);
runner
->
issue_dma
(
*
this
);
return
;
}
ctx
.
data_fetched
(
dma_addr
-
part_offset
,
total_len
);
ctx
.
queue
.
trigger
();
ctx
.
queue
.
trigger
();
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