|
|
e49aad |
#!/bin/bash
|
|
|
e49aad |
|
|
|
e49aad |
source configlib.sh
|
|
|
e49aad |
|
|
|
e49aad |
# Generates arch configurations in the current directory based on
|
|
|
e49aad |
# 1. an dpdk.spec file
|
|
|
e49aad |
# 2. an expanded dpdk tree
|
|
|
e49aad |
|
|
|
e49aad |
if (( $# != 2 )); then
|
|
|
e49aad |
echo "$0: dpdk.spec dpdk_tree" >&2
|
|
|
e49aad |
exit 1
|
|
|
e49aad |
fi
|
|
|
e49aad |
|
|
|
e49aad |
DPDKSPEC="$1"
|
|
|
e49aad |
DPDKDIR="$2"
|
|
|
e49aad |
|
|
|
e49aad |
# accumulate all arch + name triples
|
|
|
e49aad |
DPDK_CONF_MACH_ARCH=()
|
|
|
e49aad |
for arch in $(grep %define\ machine_arch "$DPDKSPEC" | sed 's@%define machine_arch @@')
|
|
|
e49aad |
do
|
|
|
e49aad |
DPDK_CONF_MACH_ARCH+=($arch)
|
|
|
e49aad |
done
|
|
|
e49aad |
|
|
|
e49aad |
DPDK_CONF_MACH_TMPL=()
|
|
|
e49aad |
for tmpl in $(grep %define\ machine_tmpl "$DPDKSPEC" | sed 's@%define machine_tmpl @@')
|
|
|
e49aad |
do
|
|
|
e49aad |
DPDK_CONF_MACH_TMPL+=($tmpl)
|
|
|
e49aad |
done
|
|
|
e49aad |
|
|
|
e49aad |
DPDK_CONF_MACH=()
|
|
|
e49aad |
for mach in $(grep %define\ machine\ "$DPDKSPEC" | sed 's@%define machine @@')
|
|
|
e49aad |
do
|
|
|
e49aad |
DPDK_CONF_MACH+=($mach)
|
|
|
e49aad |
done
|
|
|
e49aad |
|
|
|
e49aad |
DPDK_TARGETS=()
|
|
|
e49aad |
for ((i=0; i < ${#DPDK_CONF_MACH[@]}; i++));
|
|
|
e49aad |
do
|
|
|
e49aad |
DPDK_TARGETS+=("${DPDK_CONF_MACH_ARCH[$i]}-${DPDK_CONF_MACH_TMPL[$i]}-linuxapp-gcc")
|
|
|
e49aad |
echo "DPDK-target: ${DPDK_TARGETS[$i]}"
|
|
|
e49aad |
done
|
|
|
e49aad |
|
|
|
e49aad |
OUTPUT_DIR=$(pwd)
|
|
|
e49aad |
pushd "$DPDKDIR"
|
|
|
e49aad |
for ((i=0; i < ${#DPDK_TARGETS[@]}; i++));
|
|
|
e49aad |
do
|
|
|
e49aad |
echo "For ${DPDK_TARGETS[$i]}:"
|
|
|
e49aad |
|
|
|
e49aad |
echo " a. Generating initial config"
|
|
|
e49aad |
echo " make V=1 T=${DPDK_TARGETS[$i]} O=${DPDK_TARGETS[$i]}"
|
|
|
e49aad |
make V=1 T=${DPDK_TARGETS[$i]} O=${DPDK_TARGETS[$i]} -j8 config
|
|
|
e49aad |
ORIG_SHA=""
|
|
|
e49aad |
OUTDIR="${DPDK_TARGETS[$i]}"
|
|
|
e49aad |
|
|
|
e49aad |
echo " b. calculating and applying sha"
|
|
|
e49aad |
calc_sha ORIG_SHA "${OUTDIR}/.config"
|
|
|
e49aad |
if [ "$ORIG_SHA" == "" ]; then
|
|
|
e49aad |
echo "ERROR: Unable to get sha for arch ${DPDK_TARGETS[$i]}"
|
|
|
e49aad |
exit 1
|
|
|
e49aad |
fi
|
|
|
e49aad |
echo "# -*- cfg-sha: ${ORIG_SHA}" > ${OUTDIR}/.config.new
|
|
|
e49aad |
cat "${OUTDIR}/.config" >> "${OUTDIR}/.config.new"
|
|
|
e49aad |
cp "${OUTDIR}/.config" "${OUTDIR}/.config.orig"
|
|
|
e49aad |
mv -f "${OUTDIR}/.config.new" "${OUTDIR}/.config"
|
|
|
e49aad |
|
|
|
e49aad |
echo " c. setting initial configurations"
|
|
|
e49aad |
# these are the original setconf values from dpdk.spec
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_MACHINE "\\\"${DPDK_CONF_MACH[$i]}\\\""
|
|
|
e49aad |
|
|
|
e49aad |
# Enable automatic driver loading from this path
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_EAL_PMD_PATH '"/usr/lib64/dpdk-pmds"'
|
|
|
e49aad |
|
|
|
e49aad |
# start by disabling ALL PMDs
|
|
|
e49aad |
for pmd in $(grep _PMD= "${OUTDIR}/.config" | sed 's@=\(y\|n\)@@g')
|
|
|
e49aad |
do
|
|
|
e49aad |
set_conf "${OUTDIR}" $pmd n
|
|
|
e49aad |
done
|
|
|
e49aad |
|
|
|
e49aad |
# PMDs which have their own naming scheme
|
|
|
e49aad |
# the default for this was 'n' at one point. Make sure we keep it
|
|
|
e49aad |
# as such
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_QAT n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_VHOST n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_KNI n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_XENVIRT n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_NULL n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_TAP n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_PCAP n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_BOND n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_AF_PACKET n
|
|
|
e49aad |
|
|
|
e49aad |
# whitelist of enabled PMDs
|
|
|
e49aad |
# Soft PMDs to enable
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_RING y
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_PMD_VHOST y
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_VIRTIO_PMD y
|
|
|
e49aad |
|
|
|
e49aad |
# HW PMDs
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_I40E_PMD y
|
|
|
e49aad |
case "${DPDK_CONF_MACH_ARCH[i]}" in
|
|
|
e49aad |
x86_64)
|
|
|
a6040a |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_BNXT_PMD y
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_ENIC_PMD y
|
|
|
a6040a |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_MLX4_PMD y
|
|
|
a6040a |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS y
|
|
|
a6040a |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_MLX5_PMD y
|
|
|
a6040a |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS y
|
|
|
a6040a |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_NFP_PMD y
|
|
|
a6040a |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_QEDE_PMD y
|
|
|
e49aad |
;&
|
|
|
e49aad |
arm64)
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_IXGBE_PMD y
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_IGB_PMD y
|
|
|
e49aad |
;;
|
|
|
e49aad |
esac
|
|
|
e49aad |
|
|
|
e49aad |
# Compile the PMD test application
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_TEST_PMD y
|
|
|
e49aad |
|
|
|
e49aad |
# Enable vhost-numa build, the added deps are ok for us
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_VHOST_NUMA y
|
|
|
e49aad |
|
|
|
e49aad |
# Disable kernel modules
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_EAL_IGB_UIO n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_LIBRTE_KNI n
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_KNI_KMOD n
|
|
|
e49aad |
|
|
|
e49aad |
# Disable experimental stuff
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_NEXT_ABI n
|
|
|
e49aad |
|
|
|
e49aad |
# Build DPDK as shared library
|
|
|
e49aad |
set_conf "${OUTDIR}" CONFIG_RTE_BUILD_SHARED_LIB y
|
|
|
e49aad |
|
|
|
e49aad |
cp "${OUTDIR}/.config" "${OUTPUT_DIR}/${DPDK_TARGETS[$i]}-config"
|
|
|
e49aad |
done
|
|
|
e49aad |
popd >/dev/null
|
|
|
e49aad |
|
|
|
e49aad |
echo -n "For each arch ( "
|
|
|
e49aad |
for ((i=0; i < ${#DPDK_CONF_MACH_ARCH[@]}; i++));
|
|
|
e49aad |
do
|
|
|
e49aad |
echo -n "${DPDK_CONF_MACH_ARCH[i]} "
|
|
|
e49aad |
done
|
|
|
e49aad |
echo "):"
|
|
|
e49aad |
echo "1. ensure you enable the requisite hw"
|