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
c208339b
Commit
c208339b
authored
May 04, 2021
by
Jialin Li
Browse files
Merge branch 'master' of github.com:simbricks/simbricks
parents
1bf41fae
e6fbe164
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
52 additions
and
26 deletions
+52
-26
experiments/pyexps/ScaleHost.py
experiments/pyexps/ScaleHost.py
+1
-1
experiments/pyexps/ScaleLoad.py
experiments/pyexps/ScaleLoad.py
+10
-9
experiments/simbricks/experiments.py
experiments/simbricks/experiments.py
+1
-1
experiments/simbricks/nodeconfig.py
experiments/simbricks/nodeconfig.py
+12
-10
experiments/simbricks/simulators.py
experiments/simbricks/simulators.py
+2
-1
images/packer-wrap.sh
images/packer-wrap.sh
+1
-1
sims/external/gem5
sims/external/gem5
+1
-1
sims/nic/i40e_bm/i40e_bm.h
sims/nic/i40e_bm/i40e_bm.h
+3
-0
sims/nic/i40e_bm/i40e_hmc.cc
sims/nic/i40e_bm/i40e_hmc.cc
+1
-1
sims/nic/i40e_bm/i40e_lan.cc
sims/nic/i40e_bm/i40e_lan.cc
+4
-1
sims/nic/i40e_bm/xsums.cc
sims/nic/i40e_bm/xsums.cc
+16
-0
No files found.
experiments/pyexps/
udp-miciobench
.py
→
experiments/pyexps/
ScaleHost
.py
View file @
c208339b
...
@@ -25,7 +25,7 @@ import simbricks.simulators as sim
...
@@ -25,7 +25,7 @@ import simbricks.simulators as sim
import
simbricks.nodeconfig
as
node
import
simbricks.nodeconfig
as
node
# iperf
TCP_single
test
# iperf
UDP
test
# naming convention following host-nic-net-app
# naming convention following host-nic-net-app
# host: gem5-timing
# host: gem5-timing
# nic: cv/cb/ib
# nic: cv/cb/ib
...
...
experiments/pyexps/
gt_udp_single
.py
→
experiments/pyexps/
ScaleLoad
.py
View file @
c208339b
...
@@ -25,8 +25,8 @@ import simbricks.simulators as sim
...
@@ -25,8 +25,8 @@ import simbricks.simulators as sim
import
simbricks.nodeconfig
as
node
import
simbricks.nodeconfig
as
node
# iperf
TCP_single
test
# iperf
UDP Load Scalability
test
# naming convention following host-nic-net
-app
# naming convention following host-nic-net
# host: gem5-timing
# host: gem5-timing
# nic: cv/cb/ib
# nic: cv/cb/ib
# net: wire/switch/dumbbell/bridge
# net: wire/switch/dumbbell/bridge
...
@@ -34,13 +34,13 @@ import simbricks.nodeconfig as node
...
@@ -34,13 +34,13 @@ import simbricks.nodeconfig as node
host_types
=
[
'gt'
,
'qt'
,
'qemu'
]
host_types
=
[
'gt'
,
'qt'
,
'qemu'
]
nic_types
=
[
'cv'
,
'cb'
,
'ib'
]
nic_types
=
[
'cv'
,
'cb'
,
'ib'
]
net_types
=
[
'wire'
,
'sw
itch
'
,
'br
idge
'
]
net_types
=
[
'wire'
,
'sw'
,
'br'
]
app
=
[
'UDPs'
]
app
=
[
'UDPs'
]
rate_types
=
[]
rate_types
=
[]
rate_start
=
0
rate_start
=
0
rate_end
=
1
4
0
rate_end
=
1
00
0
rate_step
=
2
0
rate_step
=
10
0
for
r
in
range
(
rate_start
,
rate_end
+
1
,
rate_step
):
for
r
in
range
(
rate_start
,
rate_end
+
1
,
rate_step
):
rate
=
f
'
{
r
}
m'
rate
=
f
'
{
r
}
m'
rate_types
.
append
(
rate
)
rate_types
.
append
(
rate
)
...
@@ -53,11 +53,11 @@ for rate in rate_types:
...
@@ -53,11 +53,11 @@ for rate in rate_types:
for
nic_type
in
nic_types
:
for
nic_type
in
nic_types
:
for
net_type
in
net_types
:
for
net_type
in
net_types
:
e
=
exp
.
Experiment
(
host_type
+
'-'
+
nic_type
+
'-'
+
net_type
+
'-
UDPs
-'
+
rate
)
e
=
exp
.
Experiment
(
host_type
+
'-'
+
nic_type
+
'-'
+
net_type
+
'-
Load
-'
+
rate
)
# network
# network
if
net_type
==
'sw
itch
'
:
if
net_type
==
'sw'
:
net
=
sim
.
SwitchNet
()
net
=
sim
.
SwitchNet
()
elif
net_type
==
'br
idge
'
:
elif
net_type
==
'br'
:
net
=
sim
.
NS3BridgeNet
()
net
=
sim
.
NS3BridgeNet
()
elif
net_type
==
'wire'
:
elif
net_type
==
'wire'
:
net
=
sim
.
WireNet
()
net
=
sim
.
WireNet
()
...
@@ -76,7 +76,7 @@ for rate in rate_types:
...
@@ -76,7 +76,7 @@ for rate in rate_types:
host_class
=
qemu_timing
host_class
=
qemu_timing
elif
host_type
==
'gt'
:
elif
host_type
==
'gt'
:
host_class
=
sim
.
Gem5Host
host_class
=
sim
.
Gem5Host
e
.
checkpoint
=
Fals
e
e
.
checkpoint
=
Tru
e
else
:
else
:
raise
NameError
(
host_type
)
raise
NameError
(
host_type
)
...
@@ -106,6 +106,7 @@ for rate in rate_types:
...
@@ -106,6 +106,7 @@ for rate in rate_types:
clients
[
0
].
wait
=
True
clients
[
0
].
wait
=
True
clients
[
0
].
node_config
.
app
.
server_ip
=
servers
[
0
].
node_config
.
ip
clients
[
0
].
node_config
.
app
.
server_ip
=
servers
[
0
].
node_config
.
ip
clients
[
0
].
node_config
.
app
.
is_last
=
True
clients
[
0
].
node_config
.
app
.
rate
=
rate
clients
[
0
].
node_config
.
app
.
rate
=
rate
print
(
e
.
name
)
print
(
e
.
name
)
...
...
experiments/simbricks/experiments.py
View file @
c208339b
...
@@ -190,7 +190,7 @@ class ExpEnv(object):
...
@@ -190,7 +190,7 @@ class ExpEnv(object):
self
.
qemu_img_path
=
self
.
repodir
+
'/sims/external/qemu/build/qemu-img'
self
.
qemu_img_path
=
self
.
repodir
+
'/sims/external/qemu/build/qemu-img'
self
.
qemu_path
=
self
.
repodir
+
'/sims/external/qemu/build/x86_64-softmmu/qemu-system-x86_64'
self
.
qemu_path
=
self
.
repodir
+
'/sims/external/qemu/build/x86_64-softmmu/qemu-system-x86_64'
self
.
qemu_kernel_path
=
self
.
repodir
+
'/images/bzImage'
self
.
qemu_kernel_path
=
self
.
repodir
+
'/images/bzImage'
self
.
gem5_path
=
self
.
repodir
+
'/sims/external/gem5/build/X86/gem5.
op
t'
self
.
gem5_path
=
self
.
repodir
+
'/sims/external/gem5/build/X86/gem5.
fas
t'
self
.
gem5_py_path
=
self
.
repodir
+
'/sims/external/gem5/configs/simbricks/simbricks.py'
self
.
gem5_py_path
=
self
.
repodir
+
'/sims/external/gem5/configs/simbricks/simbricks.py'
self
.
gem5_kernel_path
=
self
.
repodir
+
'/images/vmlinux'
self
.
gem5_kernel_path
=
self
.
repodir
+
'/images/vmlinux'
...
...
experiments/simbricks/nodeconfig.py
View file @
c208339b
...
@@ -326,18 +326,20 @@ class IperfTCPClient(AppConfig):
...
@@ -326,18 +326,20 @@ class IperfTCPClient(AppConfig):
class
IperfUDPClient
(
AppConfig
):
class
IperfUDPClient
(
AppConfig
):
server_ip
=
'10.0.0.1'
server_ip
=
'10.0.0.1'
rate
=
'150m'
rate
=
'150m'
def
run_cmds
(
self
,
node
):
is_last
=
False
return
[
'sleep 1'
,
'iperf -c '
+
self
.
server_ip
+
' -i 1 -u -b '
+
self
.
rate
,
'sleep 20'
]
class
IperfUDPClientLast
(
AppConfig
):
server_ip
=
'10.0.0.1'
rate
=
'150m'
def
run_cmds
(
self
,
node
):
def
run_cmds
(
self
,
node
):
return
[
'sleep 1'
,
cmds
=
[
'sleep 1'
,
'iperf -c '
+
self
.
server_ip
+
' -i 1 -u -b '
+
self
.
rate
,
'iperf -c '
+
self
.
server_ip
+
' -i 1 -u -b '
+
self
.
rate
]
'sleep 0.5'
]
if
self
.
is_last
:
cmds
.
append
(
'sleep 0.5'
)
else
:
cmds
.
append
(
'sleep infinity'
)
return
cmds
class
IperfUDPClientSleep
(
AppConfig
):
class
IperfUDPClientSleep
(
AppConfig
):
server_ip
=
'10.0.0.1'
server_ip
=
'10.0.0.1'
...
...
experiments/simbricks/simulators.py
View file @
c208339b
...
@@ -42,7 +42,7 @@ class HostSim(Simulator):
...
@@ -42,7 +42,7 @@ class HostSim(Simulator):
name
=
''
name
=
''
wait
=
False
wait
=
False
sleep
=
0
sleep
=
0
cpu_freq
=
'
3
GHz'
cpu_freq
=
'
8
GHz'
sync_mode
=
0
sync_mode
=
0
sync_period
=
500
sync_period
=
500
...
@@ -187,6 +187,7 @@ class Gem5Host(HostSim):
...
@@ -187,6 +187,7 @@ class Gem5Host(HostSim):
cmd
=
(
f
'
{
env
.
gem5_path
}
--outdir=
{
env
.
gem5_outdir
(
self
)
}
'
cmd
=
(
f
'
{
env
.
gem5_path
}
--outdir=
{
env
.
gem5_outdir
(
self
)
}
'
f
'
{
env
.
gem5_py_path
}
--caches --l2cache --l3cache '
f
'
{
env
.
gem5_py_path
}
--caches --l2cache --l3cache '
'--l1d_size=32kB --l1i_size=32kB --l2_size=2MB --l3_size=32MB '
'--l1d_size=32kB --l1i_size=32kB --l2_size=2MB --l3_size=32MB '
'--l1d_assoc=8 --l1i_assoc=8 --l2_assoc=4 --l3_assoc=16 '
f
'--cacheline_size=64 --cpu-clock=
{
self
.
cpu_freq
}
--sys-clock=
{
self
.
sys_clock
}
'
f
'--cacheline_size=64 --cpu-clock=
{
self
.
cpu_freq
}
--sys-clock=
{
self
.
sys_clock
}
'
f
'--checkpoint-dir=
{
env
.
gem5_cpdir
(
self
)
}
'
f
'--checkpoint-dir=
{
env
.
gem5_cpdir
(
self
)
}
'
f
'--kernel=
{
env
.
gem5_kernel_path
}
'
f
'--kernel=
{
env
.
gem5_kernel_path
}
'
...
...
images/packer-wrap.sh
View file @
c208339b
#!/bin/bash
#!/bin/bash
qemupath
=
`
pwd
`
/../qemu/
qemupath
=
`
pwd
`
/../
sims/external/
qemu/
# add our qemu to $PATH
# add our qemu to $PATH
export
PATH
=
"
$qemupath
:
$qemupath
/build/:
$PATH
"
export
PATH
=
"
$qemupath
:
$qemupath
/build/:
$PATH
"
...
...
gem5
@
2a38119e
Compare
4ca61089
...
2a38119e
Subproject commit
4ca6108945ec809e12fb7e2b5909c4656cedf78a
Subproject commit
2a38119e6a46e871bb540f51557c3c72edc5a253
sims/nic/i40e_bm/i40e_bm.h
View file @
c208339b
...
@@ -620,6 +620,9 @@ class i40e_bm : public nicbm::Runner::Device {
...
@@ -620,6 +620,9 @@ class i40e_bm : public nicbm::Runner::Device {
// places the tcp checksum in the packet (assuming ipv4)
// places the tcp checksum in the packet (assuming ipv4)
void
xsum_tcp
(
void
*
tcphdr
,
size_t
l4len
);
void
xsum_tcp
(
void
*
tcphdr
,
size_t
l4len
);
// places the udpp checksum in the packet (assuming ipv4)
void
xsum_udp
(
void
*
udpphdr
,
size_t
l4len
);
// calculates the full ipv4 & tcp checksum without assuming any pseudo header
// calculates the full ipv4 & tcp checksum without assuming any pseudo header
// xsums
// xsums
void
xsum_tcpip_tso
(
void
*
iphdr
,
uint8_t
iplen
,
uint8_t
l4len
,
uint16_t
paylen
);
void
xsum_tcpip_tso
(
void
*
iphdr
,
uint8_t
iplen
,
uint8_t
l4len
,
uint16_t
paylen
);
...
...
sims/nic/i40e_bm/i40e_hmc.cc
View file @
c208339b
...
@@ -135,7 +135,7 @@ void host_mem_cache::issue_mem_op(mem_op &op) {
...
@@ -135,7 +135,7 @@ void host_mem_cache::issue_mem_op(mem_op &op) {
#ifdef DEBUG_HMC
#ifdef DEBUG_HMC
std
::
cerr
<<
"hmc issue_mem_op: hmc_addr="
<<
addr
std
::
cerr
<<
"hmc issue_mem_op: hmc_addr="
<<
addr
<<
" dma_addr="
<<
op
.
dma_addr
<<
" len="
<<
op
.
len
<<
std
::
endl
;
<<
" dma_addr="
<<
op
.
dma_addr
_
<<
" len="
<<
op
.
len
_
<<
std
::
endl
;
#endif
#endif
runner
->
IssueDma
(
op
);
runner
->
IssueDma
(
op
);
}
}
...
...
sims/nic/i40e_bm/i40e_lan.cc
View file @
c208339b
...
@@ -430,7 +430,7 @@ void lan_queue_tx::do_writeback(uint32_t first_idx, uint32_t first_pos,
...
@@ -430,7 +430,7 @@ void lan_queue_tx::do_writeback(uint32_t first_idx, uint32_t first_pos,
dma
->
dma_addr_
=
hwb_addr
;
dma
->
dma_addr_
=
hwb_addr
;
#ifdef DEBUG_LAN
#ifdef DEBUG_LAN
log
<<
" hwb="
<<
*
((
uint32_t
*
)
dma
->
data
)
<<
logger
::
endl
;
log
<<
" hwb="
<<
*
((
uint32_t
*
)
dma
->
data
_
)
<<
logger
::
endl
;
#endif
#endif
runner
->
IssueDma
(
*
dma
);
runner
->
IssueDma
(
*
dma
);
}
}
...
@@ -591,6 +591,9 @@ bool lan_queue_tx::trigger_tx_packet() {
...
@@ -591,6 +591,9 @@ bool lan_queue_tx::trigger_tx_packet() {
if
(
l4t
==
I40E_TX_DESC_CMD_L4T_EOFT_TCP
)
{
if
(
l4t
==
I40E_TX_DESC_CMD_L4T_EOFT_TCP
)
{
uint16_t
tcp_off
=
maclen
+
iplen
;
uint16_t
tcp_off
=
maclen
+
iplen
;
xsum_tcp
(
pktbuf
+
tcp_off
,
tso_len
-
tcp_off
);
xsum_tcp
(
pktbuf
+
tcp_off
,
tso_len
-
tcp_off
);
}
else
if
(
l4t
==
I40E_TX_DESC_CMD_L4T_EOFT_UDP
)
{
uint16_t
udp_off
=
maclen
+
iplen
;
xsum_udp
(
pktbuf
+
udp_off
,
tso_len
-
udp_off
);
}
}
runner
->
EthSend
(
pktbuf
,
tso_len
);
runner
->
EthSend
(
pktbuf
,
tso_len
);
...
...
sims/nic/i40e_bm/xsums.cc
View file @
c208339b
...
@@ -30,6 +30,14 @@ struct rte_tcp_hdr {
...
@@ -30,6 +30,14 @@ struct rte_tcp_hdr {
uint16_t
tcp_urp
;
/**< TCP urgent pointer, if any. */
uint16_t
tcp_urp
;
/**< TCP urgent pointer, if any. */
}
__attribute__
((
packed
));
}
__attribute__
((
packed
));
/* from dpdk/lib/librte_net/rte_udp.h */
struct
rte_udp_hdr
{
uint16_t
src_port
;
uint16_t
dst_port
;
uint16_t
dgram_len
;
uint16_t
dgram_cksum
;
}
__attribute__
((
packed
));
/* from dpdk/lib/librte_net/rte_ip.h */
/* from dpdk/lib/librte_net/rte_ip.h */
struct
ipv4_hdr
{
struct
ipv4_hdr
{
uint8_t
version_ihl
;
/**< version and header length */
uint8_t
version_ihl
;
/**< version and header length */
...
@@ -106,6 +114,14 @@ static inline uint16_t rte_ipv4_phdr_cksum(const struct ipv4_hdr *ipv4_hdr) {
...
@@ -106,6 +114,14 @@ static inline uint16_t rte_ipv4_phdr_cksum(const struct ipv4_hdr *ipv4_hdr) {
return
rte_raw_cksum
(
&
psd_hdr
,
sizeof
(
psd_hdr
));
return
rte_raw_cksum
(
&
psd_hdr
,
sizeof
(
psd_hdr
));
}
}
void
xsum_udp
(
void
*
udphdr
,
size_t
l4_len
)
{
struct
rte_udp_hdr
*
udph
=
reinterpret_cast
<
struct
rte_udp_hdr
*>
(
udphdr
);
uint32_t
cksum
=
rte_raw_cksum
(
udphdr
,
l4_len
);
cksum
=
((
cksum
&
0xffff0000
)
>>
16
)
+
(
cksum
&
0xffff
);
cksum
=
(
~
cksum
)
&
0xffff
;
udph
->
dgram_cksum
=
cksum
;
}
void
xsum_tcp
(
void
*
tcphdr
,
size_t
l4_len
)
{
void
xsum_tcp
(
void
*
tcphdr
,
size_t
l4_len
)
{
struct
rte_tcp_hdr
*
tcph
=
reinterpret_cast
<
struct
rte_tcp_hdr
*>
(
tcphdr
);
struct
rte_tcp_hdr
*
tcph
=
reinterpret_cast
<
struct
rte_tcp_hdr
*>
(
tcphdr
);
uint32_t
cksum
=
rte_raw_cksum
(
tcphdr
,
l4_len
);
uint32_t
cksum
=
rte_raw_cksum
(
tcphdr
,
l4_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