Skip to content

Commit

Permalink
kernel-boot/mlnx-sf: Change PF_BAR2_SIZE and remove limits
Browse files Browse the repository at this point in the history
Starting FW 18/24.28.1100 PF_BAR2_SIZE value should be increased by 1.
max_mdevs limits are set by FW

Signed-off-by: Vladimir Sokolovsky <vlad@nvidia.com>
  • Loading branch information
vladsokolovsky committed Oct 2, 2020
1 parent 4a4561c commit 5ea92b8
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions kernel-boot/mlnx-sf
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export uuid_path=""
export mac=""
export permanent=0
export conf="/etc/mellanox/mlnx-sf.conf"
export PF_BAR2_SIZE=1
export LIMIT_MAX_MDEVS=2
export PF_BAR2_SIZE=3

usage() {
cat << EOF
Expand Down Expand Up @@ -107,28 +106,6 @@ set_max_mdevs() {
exit 1
fi

PF_BAR2_SIZE=`get_config_value PF_BAR2_SIZE`
case "X${PF_BAR2_SIZE}" in
X1)
LIMIT_MAX_MDEVS=2
;;
X2)
LIMIT_MAX_MDEVS=16
;;
X3)
LIMIT_MAX_MDEVS=32
;;
*)
error "Enable SFs first, using: $prog -a enable -d ${device}"
exit 1
;;
esac

if [ $max_mdevs -gt $LIMIT_MAX_MDEVS ]; then
max_mdevs=$LIMIT_MAX_MDEVS
warn "Maximum number of supported MDEV devices is limited to $LIMIT_MAX_MDEVS"
fi

x=$(cat ${devpath}/mdev_supported_types/mlx5_core-local/max_mdevs)
if [ "$x" -ne $max_mdevs ] ;then
ex "echo $max_mdevs > ${devpath}/mdev_supported_types/mlx5_core-local/max_mdevs"
Expand Down Expand Up @@ -200,9 +177,6 @@ done
enable() {
# Action: enable
info "Enabling SF for device: ${device}"
if (lspci -n -s ${device} | grep -q 'a2d6'); then
PF_BAR2_SIZE=2
fi
current_pf_bar2_size=`get_config_value PF_BAR2_SIZE`
current_pf_bar2_enable=`get_config_value PF_BAR2_ENABLE`
if [[ "${current_pf_bar2_size}" == "$PF_BAR2_SIZE" && "$current_pf_bar2_enable" == "True" ]]; then
Expand Down

0 comments on commit 5ea92b8

Please sign in to comment.