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
9651bf16
Commit
9651bf16
authored
Sep 09, 2020
by
Antoine Kaufmann
Browse files
i40e: more of an actual reset propagated through all components
parent
c997952b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
5 deletions
+49
-5
i40e_bm/i40e_bm.cc
i40e_bm/i40e_bm.cc
+10
-4
i40e_bm/i40e_bm.h
i40e_bm/i40e_bm.h
+6
-1
i40e_bm/i40e_hmc.cc
i40e_bm/i40e_hmc.cc
+5
-0
i40e_bm/i40e_lan.cc
i40e_bm/i40e_lan.cc
+22
-0
i40e_bm/i40e_queues.cc
i40e_bm/i40e_queues.cc
+6
-0
No files found.
i40e_bm/i40e_bm.cc
View file @
9651bf16
...
@@ -15,7 +15,7 @@ i40e_bm::i40e_bm()
...
@@ -15,7 +15,7 @@ i40e_bm::i40e_bm()
:
pf_atq
(
*
this
,
regs
.
pf_atqba
,
regs
.
pf_atqlen
,
regs
.
pf_atqh
,
regs
.
pf_atqt
),
:
pf_atq
(
*
this
,
regs
.
pf_atqba
,
regs
.
pf_atqlen
,
regs
.
pf_atqh
,
regs
.
pf_atqt
),
hmc
(
*
this
),
shram
(
*
this
),
lanmgr
(
*
this
,
NUM_QUEUES
)
hmc
(
*
this
),
shram
(
*
this
),
lanmgr
(
*
this
,
NUM_QUEUES
)
{
{
mem
set
(
&
regs
,
0
,
sizeof
(
regs
)
);
re
set
(
false
);
}
}
i40e_bm
::~
i40e_bm
()
i40e_bm
::~
i40e_bm
()
...
@@ -416,7 +416,7 @@ void i40e_bm::reg_mem_write32(uint64_t addr, uint32_t val)
...
@@ -416,7 +416,7 @@ void i40e_bm::reg_mem_write32(uint64_t addr, uint32_t val)
case
I40E_PFGEN_CTRL
:
case
I40E_PFGEN_CTRL
:
if
((
val
&
I40E_PFGEN_CTRL_PFSWR_MASK
)
==
if
((
val
&
I40E_PFGEN_CTRL_PFSWR_MASK
)
==
I40E_PFGEN_CTRL_PFSWR_MASK
)
I40E_PFGEN_CTRL_PFSWR_MASK
)
reset
();
reset
(
true
);
break
;
break
;
case
I40E_GL_FWSTS
:
case
I40E_GL_FWSTS
:
...
@@ -515,11 +515,17 @@ void i40e_bm::reg_mem_write32(uint64_t addr, uint32_t val)
...
@@ -515,11 +515,17 @@ void i40e_bm::reg_mem_write32(uint64_t addr, uint32_t val)
}
}
}
}
void
i40e_bm
::
reset
()
void
i40e_bm
::
reset
(
bool
indicate_done
)
{
{
std
::
cout
<<
"reset triggered"
<<
std
::
endl
;
std
::
cout
<<
"reset triggered"
<<
std
::
endl
;
regs
.
glnvm_srctl
=
I40E_GLNVM_SRCTL_DONE_MASK
;
pf_atq
.
reset
();
hmc
.
reset
();
lanmgr
.
reset
();
memset
(
&
regs
,
0
,
sizeof
(
regs
));
if
(
indicate_done
)
regs
.
glnvm_srctl
=
I40E_GLNVM_SRCTL_DONE_MASK
;
}
}
shadow_ram
::
shadow_ram
(
i40e_bm
&
dev_
)
shadow_ram
::
shadow_ram
(
i40e_bm
&
dev_
)
...
...
i40e_bm/i40e_bm.h
View file @
9651bf16
...
@@ -96,6 +96,7 @@ class queue_base {
...
@@ -96,6 +96,7 @@ class queue_base {
public:
public:
queue_base
(
uint32_t
&
reg_head_
,
uint32_t
&
reg_tail_
);
queue_base
(
uint32_t
&
reg_head_
,
uint32_t
&
reg_tail_
);
virtual
void
reset
();
void
reg_updated
();
void
reg_updated
();
bool
is_enabled
();
bool
is_enabled
();
};
};
...
@@ -154,6 +155,7 @@ class host_mem_cache {
...
@@ -154,6 +155,7 @@ class host_mem_cache {
};
};
host_mem_cache
(
i40e_bm
&
dev
);
host_mem_cache
(
i40e_bm
&
dev
);
void
reset
();
void
reg_updated
(
uint64_t
addr
);
void
reg_updated
(
uint64_t
addr
);
// issue a hmc memory operation (address is in the context
// issue a hmc memory operation (address is in the context
...
@@ -193,6 +195,7 @@ class lan_queue_base : public queue_base {
...
@@ -193,6 +195,7 @@ class lan_queue_base : public queue_base {
lan_queue_base
(
lan
&
lanmgr_
,
uint32_t
&
reg_tail
,
size_t
idx_
,
lan_queue_base
(
lan
&
lanmgr_
,
uint32_t
&
reg_tail
,
size_t
idx_
,
uint32_t
&
reg_ena_
,
uint32_t
&
fpm_basereg
,
uint32_t
&
reg_intqctl
,
uint32_t
&
reg_ena_
,
uint32_t
&
fpm_basereg
,
uint32_t
&
reg_intqctl
,
uint16_t
ctx_size
);
uint16_t
ctx_size
);
virtual
void
reset
();
void
enable
();
void
enable
();
void
disable
();
void
disable
();
};
};
...
@@ -257,6 +260,7 @@ class lan_queue_rx : public lan_queue_base {
...
@@ -257,6 +260,7 @@ class lan_queue_rx : public lan_queue_base {
lan_queue_rx
(
lan
&
lanmgr_
,
uint32_t
&
reg_tail
,
size_t
idx
,
lan_queue_rx
(
lan
&
lanmgr_
,
uint32_t
&
reg_tail
,
size_t
idx
,
uint32_t
&
reg_ena
,
uint32_t
&
fpm_basereg
,
uint32_t
&
reg_ena
,
uint32_t
&
fpm_basereg
,
uint32_t
&
reg_intqctl
);
uint32_t
&
reg_intqctl
);
virtual
void
reset
();
void
packet_received
(
const
void
*
data
,
size_t
len
);
void
packet_received
(
const
void
*
data
,
size_t
len
);
};
};
...
@@ -274,6 +278,7 @@ class lan {
...
@@ -274,6 +278,7 @@ class lan {
public:
public:
lan
(
i40e_bm
&
dev
,
size_t
num_qs
);
lan
(
i40e_bm
&
dev
,
size_t
num_qs
);
void
reset
();
void
qena_updated
(
uint16_t
idx
,
bool
rx
);
void
qena_updated
(
uint16_t
idx
,
bool
rx
);
void
tail_updated
(
uint16_t
idx
,
bool
rx
);
void
tail_updated
(
uint16_t
idx
,
bool
rx
);
void
packet_received
(
const
void
*
data
,
size_t
len
);
void
packet_received
(
const
void
*
data
,
size_t
len
);
...
@@ -384,7 +389,7 @@ protected:
...
@@ -384,7 +389,7 @@ protected:
/** 32-bit write to the memory bar (should be the default) */
/** 32-bit write to the memory bar (should be the default) */
virtual
void
reg_mem_write32
(
uint64_t
addr
,
uint32_t
val
);
virtual
void
reg_mem_write32
(
uint64_t
addr
,
uint32_t
val
);
void
reset
();
void
reset
(
bool
indicate_done
);
};
};
// places the tcp checksum in the packet (assuming ipv4)
// places the tcp checksum in the packet (assuming ipv4)
...
...
i40e_bm/i40e_hmc.cc
View file @
9651bf16
...
@@ -13,6 +13,11 @@ extern nicbm::Runner *runner;
...
@@ -13,6 +13,11 @@ extern nicbm::Runner *runner;
host_mem_cache
::
host_mem_cache
(
i40e_bm
&
dev_
)
host_mem_cache
::
host_mem_cache
(
i40e_bm
&
dev_
)
:
dev
(
dev_
)
:
dev
(
dev_
)
{
reset
();
}
void
host_mem_cache
::
reset
()
{
{
for
(
size_t
i
=
0
;
i
<
MAX_SEGMENTS
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
MAX_SEGMENTS
;
i
++
)
{
segs
[
i
].
addr
=
0
;
segs
[
i
].
addr
=
0
;
...
...
i40e_bm/i40e_lan.cc
View file @
9651bf16
...
@@ -27,6 +27,14 @@ lan::lan(i40e_bm &dev_, size_t num_qs_)
...
@@ -27,6 +27,14 @@ lan::lan(i40e_bm &dev_, size_t num_qs_)
}
}
}
}
void
lan
::
reset
()
{
for
(
size_t
i
=
0
;
i
<
num_qs
;
i
++
)
{
rxqs
[
i
]
->
reset
();
txqs
[
i
]
->
reset
();
}
}
void
lan
::
qena_updated
(
uint16_t
idx
,
bool
rx
)
void
lan
::
qena_updated
(
uint16_t
idx
,
bool
rx
)
{
{
std
::
cerr
<<
"lan: qena updated idx="
<<
idx
<<
" rx="
<<
rx
<<
std
::
endl
;
std
::
cerr
<<
"lan: qena updated idx="
<<
idx
<<
" rx="
<<
rx
<<
std
::
endl
;
...
@@ -70,6 +78,12 @@ lan_queue_base::lan_queue_base(lan &lanmgr_, uint32_t ®_tail_, size_t idx_,
...
@@ -70,6 +78,12 @@ lan_queue_base::lan_queue_base(lan &lanmgr_, uint32_t ®_tail_, size_t idx_,
ctx
=
new
uint8_t
[
ctx_size_
];
ctx
=
new
uint8_t
[
ctx_size_
];
}
}
void
lan_queue_base
::
reset
()
{
enabling
=
false
;
queue_base
::
reset
();
}
void
lan_queue_base
::
enable
()
void
lan_queue_base
::
enable
()
{
{
if
(
enabling
||
enabled
)
if
(
enabling
||
enabled
)
...
@@ -157,6 +171,14 @@ lan_queue_rx::lan_queue_rx(lan &lanmgr_, uint32_t ®_tail_, size_t idx_,
...
@@ -157,6 +171,14 @@ lan_queue_rx::lan_queue_rx(lan &lanmgr_, uint32_t ®_tail_, size_t idx_,
{
{
}
}
void
lan_queue_rx
::
reset
()
{
dcache_first_idx
=
0
;
dcache_first_pos
=
0
;
dcache_first_cnt
=
0
;
queue_base
::
reset
();
}
void
lan_queue_rx
::
initialize
()
void
lan_queue_rx
::
initialize
()
{
{
std
::
cerr
<<
"lan_queue_rx::initialize()"
<<
std
::
endl
;
std
::
cerr
<<
"lan_queue_rx::initialize()"
<<
std
::
endl
;
...
...
i40e_bm/i40e_queues.cc
View file @
9651bf16
...
@@ -54,6 +54,12 @@ void queue_base::data_fetch(const void *desc, uint32_t idx, uint64_t addr,
...
@@ -54,6 +54,12 @@ void queue_base::data_fetch(const void *desc, uint32_t idx, uint64_t addr,
runner
->
issue_dma
(
*
dma
);
runner
->
issue_dma
(
*
dma
);
}
}
void
queue_base
::
reset
()
{
enabled
=
false
;
fetch_head
=
0
;
}
void
queue_base
::
reg_updated
()
void
queue_base
::
reg_updated
()
{
{
if
(
!
enabled
)
if
(
!
enabled
)
...
...
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