-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[PINS] Add genl_packet kernel module for PINS packet ins #9086
base: master
Are you sure you want to change the base?
Conversation
psample | ||
genl_packet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this would be conditional on INCLUDE_P4RT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravi861, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is an example how we can do insmod from service installed with a deb. We can add same service into GENL_PACKET deb instead of modifying bfn-modules.conf.
https://github.com/pins/sonic-buildimage-public/blob/master/platform/barefoot/sonic-platform-modules-bfn-newport/configs/systemd/system/bfn-newport.service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vboykox Can we move both psample and genl_packet there in the future? It should be fine for now just to get things going.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
echo "Rewriting linux-image dependency in debian/control to $(KVERSION_SHORT)"; \ | ||
sed -Ei "s/linux-image-.+-$(ARCH)/linux-image-$(KVERSION_SHORT)-$(ARCH)/" debian/control; \ | ||
fi | ||
if echo "$(KVERSION_SHORT)" | grep -q "^4\.19\."; then \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there two separate if-blocks for this? Wouldn't the previous one handle all cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a trick that Arista uses:
https://github.com/aristanetworks/sonic/blob/89018d0623191ecd477c869339ca795f91f6c68c/debian/rules#L20-L30
The first if block updates the version string to the kernel version that we are using. The second block covers unsigned kernels if the linux version is 4.19. If the kernel is unsigned, the sed regex in the first block won't match.
You are right that there is some duplication in the second block and this can probably be simplified. Is there simpler common SONiC pattern that we can apply?
The goal here is to avoid updating the debian/control
file every time the kernel version is revised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this, but I think just the first block would be fine. The sed
in the first block would still match the linux-image-4.19.0-12-2-amd64
part of linux-image-4.19.0-12-2-amd64-unsigned
. I suspect that the second block was added because the name of the package changed to add in -unsigned
starting with the 4.19 kernel image.
|
||
enum genl_packet_command { | ||
GENL_PACKET_CMD_PACKET, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bocon13 Per our last conversation, this file was going to go into the user space genetlink lib (p4rt_app/sonic/) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to commit from BFN.
d3e4027
to
c37aeaf
Compare
- 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]>
c37aeaf
to
d094581
Compare
|
||
} | ||
}{%- if include_p4rt == "y" %}, | ||
"trap.group.cpu.queue.1": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we please rename this to the existing format? cpu_queue1_group1
, cpu_queue2_group1
. We don't need trap.group
prefix in the names here
@bocon13 Hi, I have tried build PINS WITH SONIC, and I want to test pakcetIO with PINS. But I found the genl_pakcet kernel modules still not merged in SONIC. Can I use codes here to build genl_packet.ko for SONIC-202205 version?Thanks a lot for respond. |
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]
Why I did it
Adds support for receiving packet ins with additonal metadata for PINS.
See this HLD for more details:
https://github.com/pins/SONiC/blob/master/doc/pins/Packet_io.md
How I did it
This code largely follows the same pattern as psample for sflow.
How to verify it
Build a broadcom or barefoot image with INCLUDE_P4RT=y
Install P4RT flow rules for LLDP.
Send LLDP packet from peer using bcmsh:
Verify counters and debug logs(dmesg) for knet-cb:
Which release branch to backport (provide reason below if selected)
None
Description for the changelog
Add genl_packet kernel module for PINS packet ins