Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202205] Update BRCM KNET modules to support new psample definitions from sflow #11890

Merged
merged 2 commits into from
Aug 31, 2022
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
2 changes: 1 addition & 1 deletion platform/broadcom/saibcm-modules-dnx
11 changes: 4 additions & 7 deletions platform/broadcom/saibcm-modules/debian/opennsl-modules.init
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,14 @@ function create_devices()
function load_kernel_modules()
{
if [[ $is_ltsw_chip -eq 1 ]]; then
insmod /lib/modules/$(uname -r)/extra/psample.ko
modprobe psample
modprobe linux_ngbde
modprobe linux_ngknet
modprobe linux_ngknetcb
else
modprobe linux-kernel-bde dmasize=$dmasize maxpayload=128 debug=4 dma_debug=1 usemsi=$usemsi
modprobe linux-user-bde

# Using insmod with absolute path for psample to make sure bcm psample is loaded.
# There is a different psample.ko module getting created at net/psample/psample.ko
insmod /lib/modules/$(uname -r)/extra/psample.ko
modprobe psample

modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238 debug=0x5020 default_mtu=9100
modprobe linux-knet-cb
Expand All @@ -69,9 +66,9 @@ function remove_kernel_modules()
rmmod linux_ngknetcb
rmmod linux_ngknet
rmmod linux_ngbde
rmmod psample.ko
rmmod psample
else
rmmod psample.ko
rmmod psample
rmmod linux-knet-cb
rmmod linux-bcm-knet
rmmod linux-user-bde
Expand Down
17 changes: 2 additions & 15 deletions platform/broadcom/saibcm-modules/sdklt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ export CROSS_COMPILE

override SDK := $(CURDIR)

ifeq ($(BUILD_PSAMPLE),1)
PSAMPLE=psample
PSAMPLE_SYMVERS=$(SDK)/linux/psample/Module.symvers
endif

kmod: bde knet knetcb $(PSAMPLE)
kmod: bde knet knetcb

bde:
$(MAKE) -C $(SDK)/linux/bde SDK=$(SDK) \
Expand All @@ -62,20 +57,12 @@ knet: bde
$(TARGET)
ln -sf $(SDK)/linux/knet/*.ko

knetcb: knet $(PSAMPLE)
knetcb: knet
$(MAKE) -C $(SDK)/linux/knetcb SDK=$(SDK) \
KBUILD_EXTRA_SYMBOLS=$(SDK)/linux/knet/Module.symvers \
KBUILD_EXTRA_SYMBOLS+=$(PSAMPLE_SYMVERS) \
$(TARGET)
ln -sf $(SDK)/linux/knetcb/*.ko

ifeq ($(BUILD_PSAMPLE),1)
$(PSAMPLE):
$(MAKE) -C $(SDK)/linux/psample SDK=$(SDK) \
$(TARGET)
ln -sf $(SDK)/linux/psample/*.ko
endif

clean:
$(MAKE) kmod TARGET=clean
rm -f *.ko
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ psample_task(struct work_struct *work)
unsigned long flags;
struct list_head *list_ptr, *list_next;
psample_pkt_t *pkt;
struct psample_metadata md = {0};

spin_lock_irqsave(&psample_work->lock, flags);
list_for_each_safe(list_ptr, list_next, &psample_work->pkt_list) {
Expand All @@ -267,12 +268,13 @@ psample_task(struct work_struct *work)
pkt->meta.trunc_size, pkt->meta.src_ifindex,
pkt->meta.dst_ifindex, pkt->meta.sample_rate);

md.trunc_size = pkt->meta.trunc_size;
md.in_ifindex = pkt->meta.src_ifindex;
md.out_ifindex = pkt->meta.dst_ifindex;
psample_sample_packet(pkt->group,
pkt->skb,
pkt->meta.trunc_size,
pkt->meta.src_ifindex,
pkt->meta.dst_ifindex,
pkt->meta.sample_rate);
pkt->meta.sample_rate,
&md);
g_psample_stats.pkts_f_psample_mod++;

dev_kfree_skb_any(pkt->skb);
Expand Down
18 changes: 0 additions & 18 deletions platform/broadcom/saibcm-modules/sdklt/linux/psample/Kbuild

This file was deleted.

21 changes: 0 additions & 21 deletions platform/broadcom/saibcm-modules/sdklt/linux/psample/Makefile

This file was deleted.

Loading