Commit c208339b authored by Jialin Li's avatar Jialin Li
Browse files

Merge branch 'master' of github.com:simbricks/simbricks

parents 1bf41fae e6fbe164
......@@ -25,7 +25,7 @@ import simbricks.simulators as sim
import simbricks.nodeconfig as node
# iperf TCP_single test
# iperf UDP test
# naming convention following host-nic-net-app
# host: gem5-timing
# nic: cv/cb/ib
......
......@@ -25,8 +25,8 @@ import simbricks.simulators as sim
import simbricks.nodeconfig as node
# iperf TCP_single test
# naming convention following host-nic-net-app
# iperf UDP Load Scalability test
# naming convention following host-nic-net
# host: gem5-timing
# nic: cv/cb/ib
# net: wire/switch/dumbbell/bridge
......@@ -34,13 +34,13 @@ import simbricks.nodeconfig as node
host_types = ['gt', 'qt', 'qemu']
nic_types = ['cv','cb','ib']
net_types = ['wire', 'switch', 'bridge']
net_types = ['wire', 'sw', 'br']
app = ['UDPs']
rate_types = []
rate_start = 0
rate_end = 140
rate_step = 20
rate_end = 1000
rate_step = 100
for r in range(rate_start, rate_end + 1, rate_step):
rate = f'{r}m'
rate_types.append(rate)
......@@ -53,11 +53,11 @@ for rate in rate_types:
for nic_type in nic_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
if net_type == 'switch':
if net_type == 'sw':
net = sim.SwitchNet()
elif net_type == 'bridge':
elif net_type == 'br':
net = sim.NS3BridgeNet()
elif net_type == 'wire':
net = sim.WireNet()
......@@ -76,7 +76,7 @@ for rate in rate_types:
host_class = qemu_timing
elif host_type == 'gt':
host_class = sim.Gem5Host
e.checkpoint = False
e.checkpoint = True
else:
raise NameError(host_type)
......@@ -106,6 +106,7 @@ for rate in rate_types:
clients[0].wait = True
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
print(e.name)
......
......@@ -190,7 +190,7 @@ class ExpEnv(object):
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_kernel_path = self.repodir + '/images/bzImage'
self.gem5_path = self.repodir + '/sims/external/gem5/build/X86/gem5.opt'
self.gem5_path = self.repodir + '/sims/external/gem5/build/X86/gem5.fast'
self.gem5_py_path = self.repodir + '/sims/external/gem5/configs/simbricks/simbricks.py'
self.gem5_kernel_path = self.repodir + '/images/vmlinux'
......
......@@ -326,18 +326,20 @@ class IperfTCPClient(AppConfig):
class IperfUDPClient(AppConfig):
server_ip = '10.0.0.1'
rate = '150m'
def run_cmds(self, node):
return ['sleep 1',
'iperf -c ' + self.server_ip + ' -i 1 -u -b ' + self.rate,
'sleep 20']
is_last = False
class IperfUDPClientLast(AppConfig):
server_ip = '10.0.0.1'
rate = '150m'
def run_cmds(self, node):
return ['sleep 1',
'iperf -c ' + self.server_ip + ' -i 1 -u -b ' + self.rate,
'sleep 0.5']
cmds = ['sleep 1',
'iperf -c ' + self.server_ip + ' -i 1 -u -b ' + self.rate]
if self.is_last:
cmds.append('sleep 0.5')
else:
cmds.append('sleep infinity')
return cmds
class IperfUDPClientSleep(AppConfig):
server_ip = '10.0.0.1'
......
......@@ -42,7 +42,7 @@ class HostSim(Simulator):
name = ''
wait = False
sleep = 0
cpu_freq = '3GHz'
cpu_freq = '8GHz'
sync_mode = 0
sync_period = 500
......@@ -187,6 +187,7 @@ class Gem5Host(HostSim):
cmd = (f'{env.gem5_path} --outdir={env.gem5_outdir(self)} '
f'{env.gem5_py_path} --caches --l2cache --l3cache '
'--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'--checkpoint-dir={env.gem5_cpdir(self)} '
f'--kernel={env.gem5_kernel_path} '
......
#!/bin/bash
qemupath=`pwd`/../qemu/
qemupath=`pwd`/../sims/external/qemu/
# add our qemu to $PATH
export PATH="$qemupath:$qemupath/build/:$PATH"
......
Subproject commit 4ca6108945ec809e12fb7e2b5909c4656cedf78a
Subproject commit 2a38119e6a46e871bb540f51557c3c72edc5a253
......@@ -620,6 +620,9 @@ class i40e_bm : public nicbm::Runner::Device {
// places the tcp checksum in the packet (assuming ipv4)
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
// xsums
void xsum_tcpip_tso(void *iphdr, uint8_t iplen, uint8_t l4len, uint16_t paylen);
......
......@@ -135,7 +135,7 @@ void host_mem_cache::issue_mem_op(mem_op &op) {
#ifdef DEBUG_HMC
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
runner->IssueDma(op);
}
......
......@@ -430,7 +430,7 @@ void lan_queue_tx::do_writeback(uint32_t first_idx, uint32_t first_pos,
dma->dma_addr_ = hwb_addr;
#ifdef DEBUG_LAN
log << " hwb=" << *((uint32_t *)dma->data) << logger::endl;
log << " hwb=" << *((uint32_t *)dma->data_) << logger::endl;
#endif
runner->IssueDma(*dma);
}
......@@ -591,6 +591,9 @@ bool lan_queue_tx::trigger_tx_packet() {
if (l4t == I40E_TX_DESC_CMD_L4T_EOFT_TCP) {
uint16_t tcp_off = maclen + iplen;
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);
......
......@@ -30,6 +30,14 @@ struct rte_tcp_hdr {
uint16_t tcp_urp; /**< TCP urgent pointer, if any. */
} __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 */
struct ipv4_hdr {
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) {
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) {
struct rte_tcp_hdr *tcph = reinterpret_cast<struct rte_tcp_hdr *>(tcphdr);
uint32_t cksum = rte_raw_cksum(tcphdr, l4_len);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment