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
3e20e115
Commit
3e20e115
authored
Sep 15, 2020
by
Antoine Kaufmann
Browse files
i40e: add glstat and pfint_dyn_ctl0 registers
parent
b3d5e87b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
i40e_bm/i40e_bm.cc
i40e_bm/i40e_bm.cc
+10
-0
i40e_bm/i40e_bm.h
i40e_bm/i40e_bm.h
+2
-0
i40e_bm/i40e_lan.cc
i40e_bm/i40e_lan.cc
+9
-7
No files found.
i40e_bm/i40e_bm.cc
View file @
3e20e115
...
@@ -219,6 +219,9 @@ uint32_t i40e_bm::reg_mem_read32(uint64_t addr)
...
@@ -219,6 +219,9 @@ uint32_t i40e_bm::reg_mem_read32(uint64_t addr)
case
I40E_GLGEN_RSTCTL
:
case
I40E_GLGEN_RSTCTL
:
val
=
regs
.
glgen_rstctl
;
val
=
regs
.
glgen_rstctl
;
break
;
break
;
case
I40E_GLGEN_STAT
:
val
=
regs
.
glgen_stat
;
break
;
case
I40E_GLVFGEN_TIMER
:
case
I40E_GLVFGEN_TIMER
:
val
=
runner
->
time_ps
()
/
1000000
;
val
=
runner
->
time_ps
()
/
1000000
;
...
@@ -238,6 +241,10 @@ uint32_t i40e_bm::reg_mem_read32(uint64_t addr)
...
@@ -238,6 +241,10 @@ uint32_t i40e_bm::reg_mem_read32(uint64_t addr)
regs
.
pfint_icr0
=
0
;
regs
.
pfint_icr0
=
0
;
break
;
break
;
case
I40E_PFINT_DYN_CTL0
:
val
=
regs
.
pfint_dyn_ctl0
;
break
;
case
I40E_GLPCI_CNF2
:
case
I40E_GLPCI_CNF2
:
val
=
((
NUM_PFINTS
-
2
)
<<
I40E_GLPCI_CNF2_MSI_X_PF_N_SHIFT
)
|
val
=
((
NUM_PFINTS
-
2
)
<<
I40E_GLPCI_CNF2_MSI_X_PF_N_SHIFT
)
|
(
2
<<
I40E_GLPCI_CNF2_MSI_X_VF_N_SHIFT
);
/* that is ugly,
(
2
<<
I40E_GLPCI_CNF2_MSI_X_VF_N_SHIFT
);
/* that is ugly,
...
@@ -478,6 +485,9 @@ void i40e_bm::reg_mem_write32(uint64_t addr, uint32_t val)
...
@@ -478,6 +485,9 @@ void i40e_bm::reg_mem_write32(uint64_t addr, uint32_t val)
case
I40E_PFINT_ICR0
:
case
I40E_PFINT_ICR0
:
regs
.
pfint_icr0
=
val
;
regs
.
pfint_icr0
=
val
;
break
;
break
;
case
I40E_PFINT_DYN_CTL0
:
regs
.
pfint_dyn_ctl0
=
val
;
break
;
case
I40E_PFHMC_SDCMD
:
case
I40E_PFHMC_SDCMD
:
regs
.
pfhmc_sdcmd
=
val
;
regs
.
pfhmc_sdcmd
=
val
;
...
...
i40e_bm/i40e_bm.h
View file @
3e20e115
...
@@ -446,11 +446,13 @@ protected:
...
@@ -446,11 +446,13 @@ protected:
struct
i40e_regs
{
struct
i40e_regs
{
uint32_t
glgen_rstctl
;
uint32_t
glgen_rstctl
;
uint32_t
glgen_stat
;
uint32_t
gllan_rctl_0
;
uint32_t
gllan_rctl_0
;
uint32_t
pfint_lnklst0
;
uint32_t
pfint_lnklst0
;
uint32_t
pfint_icr0_ena
;
uint32_t
pfint_icr0_ena
;
uint32_t
pfint_icr0
;
uint32_t
pfint_icr0
;
uint32_t
pfint_dyn_ctl0
;
uint32_t
pfint_dyn_ctln
[
NUM_PFINTS
-
1
];
uint32_t
pfint_dyn_ctln
[
NUM_PFINTS
-
1
];
uint32_t
pfint_lnklstn
[
NUM_PFINTS
-
1
];
uint32_t
pfint_lnklstn
[
NUM_PFINTS
-
1
];
uint32_t
pfint_raten
[
NUM_PFINTS
-
1
];
uint32_t
pfint_raten
[
NUM_PFINTS
-
1
];
...
...
i40e_bm/i40e_lan.cc
View file @
3e20e115
...
@@ -141,16 +141,23 @@ void lan_queue_base::disable()
...
@@ -141,16 +141,23 @@ void lan_queue_base::disable()
void
lan_queue_base
::
interrupt
()
void
lan_queue_base
::
interrupt
()
{
{
uint32_t
qctl
=
reg_intqctl
;
uint32_t
qctl
=
reg_intqctl
;
uint32_t
gctl
=
lanmgr
.
dev
.
regs
.
pfint_dyn_ctl0
;
#ifdef DEBUG_LAN
#ifdef DEBUG_LAN
log
<<
" interrupt
int
ctl="
<<
qctl
<<
logger
::
endl
;
log
<<
" interrupt
q
ctl="
<<
qctl
<<
" gctl="
<<
gctl
<<
logger
::
endl
;
#endif
#endif
uint16_t
msix_idx
=
(
qctl
&
I40E_QINT_TQCTL_MSIX_INDX_MASK
)
>>
uint16_t
msix_idx
=
(
qctl
&
I40E_QINT_TQCTL_MSIX_INDX_MASK
)
>>
I40E_QINT_TQCTL_ITR_INDX_SHIFT
;
I40E_QINT_TQCTL_ITR_INDX_SHIFT
;
uint8_t
msix0_idx
=
(
qctl
&
I40E_QINT_TQCTL_MSIX0_INDX_MASK
)
>>
uint8_t
msix0_idx
=
(
qctl
&
I40E_QINT_TQCTL_MSIX0_INDX_MASK
)
>>
I40E_QINT_TQCTL_MSIX0_INDX_SHIFT
;
I40E_QINT_TQCTL_MSIX0_INDX_SHIFT
;
bool
cause_ena
=
!!
(
qctl
&
I40E_QINT_TQCTL_CAUSE_ENA_MASK
);
if
(
msix_idx
!=
0
)
{
log
<<
"TODO: only int 0 is supported"
<<
logger
::
endl
;
abort
();
}
bool
cause_ena
=
!!
(
qctl
&
I40E_QINT_TQCTL_CAUSE_ENA_MASK
)
&&
!!
(
gctl
&
I40E_PFINT_DYN_CTL0_INTENA_MASK
);
if
(
!
cause_ena
)
{
if
(
!
cause_ena
)
{
#ifdef DEBUG_LAN
#ifdef DEBUG_LAN
log
<<
" interrupt cause disabled"
<<
logger
::
endl
;
log
<<
" interrupt cause disabled"
<<
logger
::
endl
;
...
@@ -158,11 +165,6 @@ void lan_queue_base::interrupt()
...
@@ -158,11 +165,6 @@ void lan_queue_base::interrupt()
return
;
return
;
}
}
if
(
msix_idx
!=
0
)
{
log
<<
"TODO: only int 0 is supported"
<<
logger
::
endl
;
abort
();
}
// TODO throttling?
// TODO throttling?
#ifdef DEBUG_LAN
#ifdef DEBUG_LAN
log
<<
" setting int0.qidx="
<<
msix0_idx
<<
logger
::
endl
;
log
<<
" setting int0.qidx="
<<
msix0_idx
<<
logger
::
endl
;
...
...
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