Skip to content

Commit

Permalink
Merge pull request baidu#210 from pengjianzhang/main
Browse files Browse the repository at this point in the history
support dpdk-22.11
  • Loading branch information
pengjianzhang committed Dec 6, 2022
2 parents c92a638 + 995e85b commit d8bfa0b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
CFLAGS += -O3 -g -I./src
CFLAGS += -DHTTP_PARSE
CFLAGS += $(WERROR_FLAGS)
CFLAGS += $(WERROR_FLAGS) -Wno-address-of-packed-member

ifdef DPERF_DEBUG
CFLAGS += -DDPERF_DEBUG
Expand All @@ -33,6 +33,7 @@ endif

CFLAGS += -O3 -g -I./src
CFLAGS += -DHTTP_PARSE
CFLAGS += -Wno-address-of-packed-member
CFLAGS += $(shell $(PKGCONF) --cflags libdpdk)
LDFLAGS += $(shell $(PKGCONF) --libs libdpdk) -lpthread -lrte_net_bond -lrte_bus_pci -lrte_bus_vdev

Expand Down
17 changes: 17 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@
export LD_LIBRARY_PATH=/root/dpdk/dpdk-stable-20.11.2/mydpdk/lib64/
./build/dperf -h

## Build dperf With DPDK-22.11
### Build DPDK
#Suppose we use dpdk-22.11.1.

cd /root/dpdk/dpdk-stable-22.11.1
meson build --prefix=/root/dpdk/dpdk-stable-22.11.1/mydpdk -Denable_kmods=true -Ddisable_libs=""
ninja -C build install

### Build dperf
export PKG_CONFIG_PATH=/root/dpdk/dpdk-stable-22.11.1/mydpdk/lib64/pkgconfig/
cd dperf
make

### Run dperf
export LD_LIBRARY_PATH=/root/dpdk/dpdk-stable-22.11.1/mydpdk/lib64/
./build/dperf -h

## Mellanox Interface Driver
- CentOS/RHEL 7.5, DPDK-17.11: MLNX_OFED_LINUX-4.3-3.0.2.1-rhel7.5-x86_64.iso
- CentOS/RHEL 7.9 or Kernel >= 4.14: rdma-core-stable-v22
1 change: 1 addition & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <getopt.h>
#include <dirent.h>
#include <string.h>
#include <ctype.h>

#include "client.h"
#include "config_keyword.h"
Expand Down
5 changes: 5 additions & 0 deletions src/dpdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
#define RTE_IPV6_UDPTCP_CKSUM(iph, th) rte_ipv6_udptcp_cksum((const struct rte_ipv6_hdr *)iph, (const void *)th)
#endif

#if RTE_VERSION >= RTE_VERSION_NUM(22, 11, 0, 0)
#define PKT_TX_VLAN RTE_MBUF_F_TX_VLAN
#define DEV_RX_OFFLOAD_VLAN_STRIP RTE_ETH_RX_OFFLOAD_VLAN_STRIP
#endif

struct config;
int dpdk_init(struct config *cfg, char *argv0);
void dpdk_run(int (*lcore_main)(void*), void* data);
Expand Down
4 changes: 0 additions & 4 deletions src/mbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ struct rte_mempool *mbuf_pool_create(const char *str, uint16_t port_id, uint16_t
int mbuf_size = 0;

socket_id = rte_eth_dev_socket_id(port_id);
if (socket_id < 0) {
printf("bad socket_id %d of port %u\n", socket_id, port_id);
return NULL;
}
snprintf(name, RTE_RING_NAMESIZE, "%s_%d_%d", str, port_id, queue_id);

if (g_config.jumbo) {
Expand Down
2 changes: 2 additions & 0 deletions src/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ static struct rte_eth_conf g_port_conf = {
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
.max_rx_pkt_len = ETHER_MAX_LEN,
#endif
#if RTE_VERSION < RTE_VERSION_NUM(22, 11, 0, 0)
.split_hdr_size = 0,
#endif
#if RTE_VERSION < RTE_VERSION_NUM(18, 11, 0, 0)
.hw_ip_checksum = 1,
.hw_vlan_strip = 1,
Expand Down

0 comments on commit d8bfa0b

Please sign in to comment.