mirror of https://github.com/F-Stack/f-stack.git
F-Stack lib and docs support DPDK-21.11.
This commit is contained in:
parent
4d39bb9283
commit
0b9105dad3
10
README.md
10
README.md
|
@ -38,6 +38,12 @@ Currently, besides authorized DNS server of DNSPod, there are various products i
|
|||
yum install numactl-devel # on Centos
|
||||
#sudo apt-get install libnuma-dev # on Ubuntu
|
||||
|
||||
pip3 install pyelftools --upgrade
|
||||
# Install python and modules for running DPDK python scripts
|
||||
pip3 install pyelftools --upgrade # RedHat/Centos
|
||||
sudo apt install python # On ubuntu
|
||||
#sudo pkg install python # On FreeBSD
|
||||
|
||||
# Install dependencies (FreeBSD only)
|
||||
#pkg install meson pkgconf py38-pyelftools
|
||||
|
||||
|
@ -63,10 +69,6 @@ Currently, besides authorized DNS server of DNSPod, there are various products i
|
|||
# Close ASLR; it is necessary in multiple process (Linux only)
|
||||
echo 0 > /proc/sys/kernel/randomize_va_space
|
||||
|
||||
# Install python for running DPDK python scripts
|
||||
sudo apt install python # On ubuntu
|
||||
#sudo pkg install python # On FreeBSD
|
||||
|
||||
# Offload NIC
|
||||
# For Linux:
|
||||
modprobe uio
|
||||
|
|
|
@ -6,6 +6,8 @@ The procedures to compile f-stack in different linux releases is almost the same
|
|||
$ sudo -i
|
||||
# in centos and redhat
|
||||
$ yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc numactl-devel python
|
||||
$ pip3 install pyelftools --upgrade
|
||||
|
||||
# in ubuntu
|
||||
$ apt-get install git gcc openssl libssl-dev linux-headers-$(uname -r) bc libnuma1 libnuma-dev libpcre3 libpcre3-dev zlib1g-dev python
|
||||
|
||||
|
|
|
@ -12,6 +12,11 @@ See Intel DPDK [linux_gsg](http://dpdk.org/doc/guides/linux_gsg/index.html)
|
|||
mkdir /data/f-stack
|
||||
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
|
||||
|
||||
## Install python and modules for running DPDK python scripts
|
||||
pip3 install pyelftools --upgrade # RedHat/Centos
|
||||
sudo apt install python # On ubuntu
|
||||
#sudo pkg install python # On FreeBSD
|
||||
|
||||
## Compile DPDK
|
||||
|
||||
Read DPDK Quick Started Guide or run the command below
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
mkdir /data/f-stack
|
||||
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
|
||||
|
||||
pip3 install pyelftools --upgrade
|
||||
|
||||
# Compile DPDK
|
||||
cd /data/f-stack/dpdk
|
||||
meson -Denable_kmods=true build
|
||||
|
|
|
@ -1122,7 +1122,7 @@ ff_veth_input(const struct ff_dpdk_if_context *ctx, struct rte_mbuf *pkt)
|
|||
{
|
||||
uint8_t rx_csum = ctx->hw_features.rx_csum;
|
||||
if (rx_csum) {
|
||||
if (pkt->ol_flags & (PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD)) {
|
||||
if (pkt->ol_flags & (RTE_MBUF_F_RX_IP_CKSUM_BAD | RTE_MBUF_F_RX_L4_CKSUM_BAD)) {
|
||||
rte_pktmbuf_free(pkt);
|
||||
return;
|
||||
}
|
||||
|
@ -1137,7 +1137,7 @@ ff_veth_input(const struct ff_dpdk_if_context *ctx, struct rte_mbuf *pkt)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pkt->ol_flags & PKT_RX_VLAN_STRIPPED) {
|
||||
if (pkt->ol_flags & RTE_MBUF_F_RX_VLAN_STRIPPED) {
|
||||
ff_mbuf_set_vlan_info(hdr, pkt->vlan_tci);
|
||||
}
|
||||
|
||||
|
@ -1765,7 +1765,7 @@ ff_dpdk_if_send(struct ff_dpdk_if_context *ctx, void *m,
|
|||
iph = (struct rte_ipv4_hdr *)(data + RTE_ETHER_HDR_LEN);
|
||||
iph_len = (iph->version_ihl & 0x0f) << 2;
|
||||
|
||||
head->ol_flags |= PKT_TX_IP_CKSUM | PKT_TX_IPV4;
|
||||
head->ol_flags |= RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_IPV4;
|
||||
head->l2_len = RTE_ETHER_HDR_LEN;
|
||||
head->l3_len = iph_len;
|
||||
}
|
||||
|
@ -1777,7 +1777,7 @@ ff_dpdk_if_send(struct ff_dpdk_if_context *ctx, void *m,
|
|||
iph_len = (iph->version_ihl & 0x0f) << 2;
|
||||
|
||||
if (offload.tcp_csum) {
|
||||
head->ol_flags |= PKT_TX_TCP_CKSUM;
|
||||
head->ol_flags |= RTE_MBUF_F_TX_TCP_CKSUM;
|
||||
head->l2_len = RTE_ETHER_HDR_LEN;
|
||||
head->l3_len = iph_len;
|
||||
}
|
||||
|
@ -1802,15 +1802,15 @@ ff_dpdk_if_send(struct ff_dpdk_if_context *ctx, void *m,
|
|||
int tcph_len;
|
||||
tcph = (struct rte_tcp_hdr *)((char *)iph + iph_len);
|
||||
tcph_len = (tcph->data_off & 0xf0) >> 2;
|
||||
tcph->cksum = rte_ipv4_phdr_cksum(iph, PKT_TX_TCP_SEG);
|
||||
tcph->cksum = rte_ipv4_phdr_cksum(iph, RTE_MBUF_F_TX_TCP_SEG);
|
||||
|
||||
head->ol_flags |= PKT_TX_TCP_SEG;
|
||||
head->ol_flags |= RTE_MBUF_F_TX_TCP_SEG;
|
||||
head->l4_len = tcph_len;
|
||||
head->tso_segsz = offload.tso_seg_size;
|
||||
}
|
||||
|
||||
if (offload.udp_csum) {
|
||||
head->ol_flags |= PKT_TX_UDP_CKSUM;
|
||||
head->ol_flags |= RTE_MBUF_F_TX_UDP_CKSUM;
|
||||
head->l2_len = RTE_ETHER_HDR_LEN;
|
||||
head->l3_len = iph_len;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue