Skip to content

Commit

Permalink
[202205] Update BRCM KNET modules to support new psample definitions …
Browse files Browse the repository at this point in the history
…from sflow (#11890)

* [202205][linux-kernel] advance submodule head

linux-kernel:
* 3fe00d4 2022-06-24 | [sflow + dropmon] added missing patch for the sFlow + dropmon feature. (#281) (HEAD -> 202205) [Vadym Hlushko]
* ca727d6 2022-04-21 | [sflow + dropmon] added patches for the sFlow + dropmon feature. (#276) [Vadym Hlushko]

Signed-off-by: Ying Xie <[email protected]>

* Update BRCM KNET modules to support new psample definitions from sflow… (#11709)

* Update BRCM KNET module to support new psample definitions from sflow dropmon feature

* Update BRCM KNET module to support new psample definitions from sflow dropmon feature

* Advance saibcm-modules-dnx

Signed-off-by: Ying Xie <[email protected]>
Co-authored-by: Michael Li <[email protected]>
  • Loading branch information
yxieca and michaelli10 authored Aug 31, 2022
1 parent ba020df commit 875328b
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 881 deletions.
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
24 changes: 0 additions & 24 deletions platform/broadcom/saibcm-modules/sdklt/linux/include/net/psample.h

This file was deleted.

This file was deleted.

10 changes: 6 additions & 4 deletions platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c
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

0 comments on commit 875328b

Please sign in to comment.