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

Update BRCM DNX KNET module to support new psample definitions from s… #10

Merged
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
7 changes: 2 additions & 5 deletions debian/opennsl-modules.init
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ function load_kernel_modules()

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 @@ -66,7 +63,7 @@ function load_kernel_modules()

function remove_kernel_modules()
{
rmmod psample.ko
rmmod psample
rmmod linux-knet-cb
rmmod linux-bcm-knet
rmmod linux-user-bde
Expand Down
19 changes: 3 additions & 16 deletions 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,22 +57,14 @@ 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

.PHONY: help kmod bde knet knetcb $(PSAMPLE) clean
.PHONY: help kmod bde knet knetcb clean
24 changes: 0 additions & 24 deletions sdklt/linux/include/net/psample.h

This file was deleted.

35 changes: 0 additions & 35 deletions sdklt/linux/include/uapi/linux/psample.h

This file was deleted.

10 changes: 6 additions & 4 deletions 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 sdklt/linux/psample/Kbuild

This file was deleted.

21 changes: 0 additions & 21 deletions sdklt/linux/psample/Makefile

This file was deleted.

Loading