Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions device/nexthop/x86_64-nexthop_5010-r0/platform_env.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
SYNCD_SHM_SIZE=1g
dmasize=192M
usemsi=1
use_napi=1
macsec_enabled=1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function load_kernel_modules()
modprobe linux-user-bde
modprobe psample

modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238 debug=0x5020 default_mtu=9100
modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238 debug=0x5020 default_mtu=9100 use_napi=$use_napi
modprobe linux-knet-cb
modprobe linux_ngbde
fi
Expand Down Expand Up @@ -92,6 +92,7 @@ function load_platform_env()
# Set the default configuration for dmasize and usemsi parameters
dmasize=32M
usemsi=0
use_napi=0
is_ltsw_chip=0
rx_buffer_size=9216

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ override_dh_auto_install:
debian/$${pkg_name}$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
fi; \
if [ -d $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR) ]; then \
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service \
debian/$${pkg_name}/lib/systemd/system; \
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.timer \
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/* \
debian/$${pkg_name}/lib/systemd/system; \
fi; \
if [ -d $(MOD_SRC_DIR)/$${mod}/$(SYSTEM_DIR) ]; then \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ systemctl enable system-ledd.service
systemctl start --no-block system-ledd.service
systemctl enable transceiver-init.service
systemctl start transceiver-init.service
systemctl enable bcm-intf-init.service
systemctl enable adm1266-rtc-sync.timer
systemctl start adm1266-rtc-sync.timer
systemctl enable watchdog.timer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Initialize BCM Interfaces
Wants=sys-subsystem-net-devices-bcm0.device sys-subsystem-net-devices-bcm1.device
After=sys-subsystem-net-devices-bcm0.device sys-subsystem-net-devices-bcm1.device
BindsTo=sys-subsystem-net-devices-bcm0.device sys-subsystem-net-devices-bcm1.device
Before=syncd.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/bcm_intf_init.sh

[Install]
RequiredBy=syncd.service
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

LOG_TAG="bcm_intf_init"
PLATFORM_ENV_FILE="/usr/share/sonic/platform/platform_env.conf"

# Source platform_env.conf
if [ -f "$PLATFORM_ENV_FILE" ]; then
source "$PLATFORM_ENV_FILE"
else
logger -t $LOG_TAG -p error "Error: $PLATFORM_ENV_FILE not found"
exit 1
fi

if [ "$use_napi" = "1" ]; then
logger -t $LOG_TAG "NAPI is enabled, proceeding with bcm intf init"
for dev in bcm0 bcm1; do
if [ -d "/sys/class/net/$dev" ]; then
/sbin/ip link set "$dev" up
logger -t $LOG_TAG "Interface $dev set to UP"
else
logger -p user.warning -t $LOG_TAG "Interface $dev not present, skipping..."
fi
done
else
logger -t $LOG_TAG "NAPI is disabled, skipping bcm intf init"
fi

exit 0
Loading