X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fdpdk.sh;h=3c16372294d8d63902b6b8bd9a2093f8b553004c;hb=6da5a6920171682bd5bf6a77517bedfef91cbd0e;hp=0b148aa83d907c5fcda742beb89a762bd9bed235;hpb=3b2dcb0348e890950dfbc3fe4aec7008d4e1f63a;p=csit.git diff --git a/resources/libraries/bash/function/dpdk.sh b/resources/libraries/bash/function/dpdk.sh index 0b148aa83d..3c16372294 100644 --- a/resources/libraries/bash/function/dpdk.sh +++ b/resources/libraries/bash/function/dpdk.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -87,13 +87,18 @@ function dpdk_compile () { pushd "${DPDK_DIR}" || die "Pushd failed" # Patch ARM. - sed_cmd="s/'RTE_MAX_LCORE', [0-9]*/'RTE_MAX_LCORE', $(nproc --all)/" sed_file="config/arm/meson.build" - sed -i "${sed_cmd}" "${sed_file}" || die "Patch failed" + sed_cmd="s/'RTE_MAX_LCORE', [0-9]*/'RTE_MAX_LCORE', $(nproc --all)/" + sed -i "${sed_cmd}" "${sed_file}" || die "RTE_MAX_LCORE Patch failed" + sed_cmd="s/'RTE_MAX_NUMA_NODES', [0-9]*/'RTE_MAX_NUMA_NODES', " + sed_cmd+="$(echo /sys/devices/system/node/node* | wc -w)/" + sed -i "${sed_cmd}" "${sed_file}" || die "RTE_MAX_NUMA_NODES Patch failed" # Patch L3FWD. - sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128/#define RTE_TEST_RX_DESC_DEFAULT 1024/g" - sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512/#define RTE_TEST_TX_DESC_DEFAULT 1024/g" + sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128" + sed_rxd+="/#define RTE_TEST_RX_DESC_DEFAULT 1024/g" + sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512" + sed_txd+="/#define RTE_TEST_TX_DESC_DEFAULT 1024/g" sed_file="./main.c" pushd examples/l3fwd || die "Pushd failed" sed -i "${sed_rxd}" "${sed_file}" || die "Patch failed" @@ -204,8 +209,10 @@ function dpdk_l3fwd_compile () { pushd "${DPDK_DIR}" || die "Pushd failed" # Patch L3FWD. - sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128/#define RTE_TEST_RX_DESC_DEFAULT 2048/g" - sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512/#define RTE_TEST_TX_DESC_DEFAULT 2048/g" + sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128" + sed_rxd+="/#define RTE_TEST_RX_DESC_DEFAULT 2048/g" + sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512" + sed_txd+="/#define RTE_TEST_TX_DESC_DEFAULT 2048/g" sed_file="./main.c" pushd examples/l3fwd || die "Pushd failed" sed -i "${sed_rxd}" "${sed_file}" || die "Patch failed"