Skip to content

Commit

Permalink
[PINS] Add genl_packet kernel module for PINS packet ins
Browse files Browse the repository at this point in the history
- Add genl_packet kernel module
- Extend bcm-knet-cb to support genl_packet packets
- Include kernel module in barefoot and broadcom images
- Update copp_cfg file with packet in queue configuration

Submission containing materials of a third party:
    Copyright Google LLC; Licensed under Apache 2.0 and GPL v2

Co-authored-by: Vivek Ramamoorthy <[email protected]>
Co-authored-by: Srikishen Pondicherry Shanmugam <[email protected]>
Co-authored-by: Yilan Ji <[email protected]>
Co-authored-by: Brian O'Connor <[email protected]>

Signed-off-by: Brian O'Connor <[email protected]>
  • Loading branch information
PINS Working Group authored and bocon13 committed Oct 30, 2021
1 parent dfc1697 commit d094581
Show file tree
Hide file tree
Showing 29 changed files with 1,408 additions and 4 deletions.
45 changes: 42 additions & 3 deletions files/image_config/copp/copp_cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"trap_priority":"4",
"queue": "4"
},
"queue4_group2": {
"queue4_group2": {
"trap_action":"copy",
"trap_priority":"4",
"queue": "4",
Expand Down Expand Up @@ -59,8 +59,47 @@
"red_action": "drop",
"trap_action": "trap",
"trap_priority": "1"

}
}{%- if include_p4rt == "y" %},
"trap.group.cpu.queue.1": {
"queue": "1",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
},
"trap.group.cpu.queue.2": {
"queue": "2",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
},
"trap.group.cpu.queue.3": {
"queue": "3",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
},
"trap.group.cpu.queue.4": {
"queue": "4",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
},
"trap.group.cpu.queue.5": {
"queue": "5",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
},
"trap.group.cpu.queue.6": {
"queue": "6",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
},
"trap.group.cpu.queue.7": {
"queue": "7",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
},
"trap.group.cpu.queue.8": {
"queue": "8",
"genetlink_name" : "genl_packet",
"genetlink_mcgrp_name" : "packets"
}{% endif %}
},
"COPP_TRAP": {
"bgp": {
Expand Down
3 changes: 2 additions & 1 deletion platform/barefoot/bfn-modules/configs/bfn-modules.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

psample
psample
genl_packet
3 changes: 3 additions & 0 deletions platform/barefoot/one-aboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ SONIC_ONE_ABOOT_IMAGE = sonic-aboot-barefoot.swi
$(SONIC_ONE_ABOOT_IMAGE)_MACHINE = barefoot
$(SONIC_ONE_ABOOT_IMAGE)_IMAGE_TYPE = aboot
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(BFN_MODULE)
ifeq ($(INCLUDE_P4RT), y)
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(GENL_PACKET)
endif
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_ABOOT_IMAGE)_LAZY_INSTALLS += $(BFN_PLATFORM_MODULE)
$(SONIC_ONE_ABOOT_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_PLATFORM_MODULE)
Expand Down
3 changes: 3 additions & 0 deletions platform/barefoot/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ SONIC_ONE_IMAGE = sonic-barefoot.bin
$(SONIC_ONE_IMAGE)_MACHINE = barefoot
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(BFN_MODULE)
ifeq ($(INCLUDE_P4RT), y)
$(SONIC_ONE_IMAGE)_INSTALLS += $(GENL_PACKET)
endif
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_PLATFORM_MODULE)
Expand Down
3 changes: 3 additions & 0 deletions platform/broadcom/one-aboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ $(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(PHY_CREDO)
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(FLASHROM)
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_ABOOT_IMAGE)_LAZY_BUILD_INSTALLS = $(BRCM_OPENNSL_KERNEL) $(BRCM_DNX_OPENNSL_KERNEL)
ifeq ($(INCLUDE_P4RT), y)
$(SONIC_ONE_ABOOT_IMAGE)_LAZY_BUILD_INSTALLS += $(GENL_PACKET)
endif
ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_ONE_ABOOT_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_ABOOT_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
Expand Down
3 changes: 3 additions & 0 deletions platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(RAGILE_RA_B6910_64C_PLATFORM_MODULE) \
$(NOKIA_IXR7250_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_BUILD_INSTALLS = $(BRCM_OPENNSL_KERNEL) $(BRCM_DNX_OPENNSL_KERNEL)
ifeq ($(INCLUDE_P4RT), y)
$(SONIC_ONE_IMAGE)_LAZY_BUILD_INSTALLS += $(GENL_PACKET)
endif
ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
Expand Down
3 changes: 3 additions & 0 deletions platform/broadcom/raw-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ SONIC_RAW_IMAGE = sonic-broadcom.raw
$(SONIC_RAW_IMAGE)_MACHINE = broadcom
$(SONIC_RAW_IMAGE)_IMAGE_TYPE = raw
$(SONIC_RAW_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL)
ifeq ($(INCLUDE_P4RT), y)
$(SONIC_RAW_IMAGE)_INSTALLS += $(GENL_PACKET)
endif
$(SONIC_RAW_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_RAW_IMAGE)_INSTALLS += $(FLASHROM)
$(SONIC_RAW_IMAGE)_LAZY_INSTALLS += $($(SONIC_ONE_IMAGE)_LAZY_INSTALLS)
Expand Down
5 changes: 5 additions & 0 deletions platform/broadcom/sai-modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ BRCM_OPENNSL_KERNEL_VERSION = 6.0.0.10
BRCM_OPENNSL_KERNEL = opennsl-modules_$(BRCM_OPENNSL_KERNEL_VERSION)_amd64.deb
$(BRCM_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules
$(BRCM_OPENNSL_KERNEL)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
ifeq ($(INCLUDE_P4RT), y)
$(BRCM_OPENNSL_KERNEL)_DEPENDS += $(GENL_PACKET_DEV)
$(BRCM_OPENNSL_KERNEL)_RDEPENDS += $(GENL_PACKET)
$(BRCM_OPENNSL_KERNEL)_BUILD_ENV += BUILD_GENL_PACKET=$(INCLUDE_P4RT)
endif
$(BRCM_OPENNSL_KERNEL)_BUILD_ENV += PKG_NAME=$(BRCM_OPENNSL_KERNEL)
$(BRCM_OPENNSL_KERNEL)_MACHINE = broadcom
SONIC_DPKG_DEBS += $(BRCM_OPENNSL_KERNEL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ KBUILD_EXTRA_SYMBOLS := ${BLDDIR}/../bcm-knet/kernel_module/Module.symvers
ifeq ($(BUILD_PSAMPLE),1)
KBUILD_EXTRA_SYMBOLS += ${BLDDIR}/../psample/kernel_module/Module.symvers
endif
ifdef BUILD_GENL_PACKET
KBUILD_EXTRA_SYMBOLS += /opt/genl_packet/Module.symvers
endif

# BCM Network Device

Expand Down
Loading

0 comments on commit d094581

Please sign in to comment.