<commit_before>#!/bin/bash

set -e -x

if [[ $EUID -ne 0 ]]; then
    echo "$0 must be run as root"
    exit 1
fi

script_directory="$(dirname $(readlink -f $BASH_SOURCE))"
source "${script_directory}/../sdn_sensor_rc"

export RTE_SDK="${build_directory}/external/dpdk"
export RTE_TOOLS="${RTE_SDK}/tools"
export RTE_NIC_BIND="${RTE_TOOLS}/dpdk_nic_bind.py"

export CORE_MASK=$("${script_directory}/find-dpdk-settings.pl" -c)
export PCI_ID=$("${script_directory}/find-dpdk-settings.pl" -p | awk '/^eth1 / { print $2; }')

echo "CORE_MASK ${CORE_MASK}"
echo "PCI_ID ${PCI_ID}"

conf_input="${script_directory}/../conf/sdn_sensor_vagrant.example"
conf_output="${script_directory}/../conf/sdn_sensor_vagrant.json"

if [[ ! -e $conf_output ]]; then
    cat "${conf_input}" | envsubst > "${conf_output}"
fi

depmod -a
modprobe uio
modprobe igb_uio

"${RTE_NIC_BIND}" --status | fgrep "${PCI_ID}"
"${RTE_NIC_BIND}" -b none          "${PCI_ID}"
"${RTE_NIC_BIND}" -b igb_uio       "${PCI_ID}"
"${RTE_NIC_BIND}" --status | fgrep "${PCI_ID}"

echo "dpdk vagrant configuration completed successfully"

exit 0
<commit_msg>configure-vagrant.bash: change dpdk port to eth2<commit_after>#!/bin/bash

set -e -x

if [[ $EUID -ne 0 ]]; then
    echo "$0 must be run as root"
    exit 1
fi

script_directory="$(dirname $(readlink -f $BASH_SOURCE))"
source "${script_directory}/../sdn_sensor_rc"

export RTE_SDK="${build_directory}/external/dpdk"
export RTE_TOOLS="${RTE_SDK}/tools"
export RTE_NIC_BIND="${RTE_TOOLS}/dpdk_nic_bind.py"

export CORE_MASK=$("${script_directory}/find-dpdk-settings.pl" -c)
export PCI_ID=$("${script_directory}/find-dpdk-settings.pl" -p | awk '/^eth2 / { print $2; }')

echo "CORE_MASK ${CORE_MASK}"
echo "PCI_ID ${PCI_ID}"

conf_input="${script_directory}/../conf/sdn_sensor_vagrant.example"
conf_output="${script_directory}/../conf/sdn_sensor_vagrant.json"

if [[ ! -e $conf_output ]]; then
    cat "${conf_input}" | envsubst > "${conf_output}"
fi

depmod -a
modprobe uio
modprobe igb_uio

"${RTE_NIC_BIND}" --status | fgrep "${PCI_ID}"
"${RTE_NIC_BIND}" -b none          "${PCI_ID}"
"${RTE_NIC_BIND}" -b igb_uio       "${PCI_ID}"
"${RTE_NIC_BIND}" --status | fgrep "${PCI_ID}"

echo "dpdk vagrant configuration completed successfully"

exit 0

{'fraction_non_alphanumeric': 0.18314855875831484, 'fraction_numerical': 0.005764966740576497, 'mean_word_length': 4.9057591623036645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '752942', 'n_tokens_mistral': 913, 'n_tokens_neox': 894, 'n_words': 181}