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

[sflow]: Unblocked psample_*() function calls related to BRCM specific procfs for sflow feature's working in ESW platforms #12918

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

hari-selvam
Copy link
Contributor

@hari-selvam hari-selvam commented Dec 2, 2022

Fixed sflow feature code breakage in BRCM ESW platform.

*Replaced BRCM SDK's psample support flag(PSAMPLE_SUPPORT) with linux kernel psample module support config flag(CONFIG_PSAMPLE) in saibcm-modules.
*Replaced BUILD_PSAMPLE conditioanl check with CONFIG_PSAMPLE to build psample callback library(psample-cb.o), only if psample config is enabled in linux kernel.
*Cleaned up PSAMPLE_SUPPORT related commented code.

Signed-off-by: haris@celestica.com

Why I did it

SFLOW configuration(config sflow enable) causes swss docker to exit in Broadcom Td3-X2 family chipset platform. Reason is as part of the sflow configuration, Broadcom tries to open the file /proc/bcm/knet_cb/psample/rate and it got failed since the file doesn't exists. psample-cb.o object file is responsible for loading '/proc/bcm/knet-cb/psample/rate' file. And this object file is not included due to BUILD_PSAMPLE=1 flag is removed in the recent commit.

How I did it

Unblocked psample_*() function calls in BRCM ESW platforms for proper functionality of sflow feature.
*Replaced BRCM SDK's psample support flag(PSAMPLE_SUPPORT) with linux kernel psample module support config flag(CONFIG_PSAMPLE) in saibcm-modules.
*Replaced BUILD_PSAMPLE conditioanl check with CONFIG_PSAMPLE to build psample callback library(psample-cb.o), only if psample config is enabled in linux kernel.
*Cleaned up PSAMPLE_SUPPORT related commented code.

How to verify it

  1. Check psample module is insmoded by default by using 'lsmod | grep psample' command. pass
  2. Check required procfs such as (debug, map, rate, size, stats) are created under /proc/bcm/knet-cb/psample/ folder. pass
  3. Enable sflow feature by using 'config feature state sflow enabled' command. pass
  4. Check sflow docker is instantiated by using 'docker ps' command. pass
  5. Check sflow config(config sflow enable) doesnt stop swss docker. pass
  6. Check COUNTER and FLOW samples are being received at the configured collector interface. pass
  7. Change sflow attributes(global and interface specific) and verify the config changes are affecting samples count or not. pass
  8. Check sflow functionality after cold reboot. pass

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Replaced BRCM SDK psample support flag with kernel psample config flag to unblock the creation of BRCM specific procfs for sflow feature's working in ESW platforms. It fixes Issue#12810

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

[saibcm-modules][sflow]

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

…or proper functionality of sflow feature

*Replaced BRCM SDK's psample support flag(PSAMPLE_SUPPORT) with linux kernel psample module support config flag(CONFIG_PSAMPLE) in saibcm-modules.
*Replaced BUILD_PSAMPLE conditioanl check with CONFIG_PSAMPLE to build psample callback library(psample-cb.o), only if psample config is enabled in linux kernel.
*Cleaned up PSAMPLE_SUPPORT related commented code.

Signed-off-by: haris@celestica.com
@hari-selvam hari-selvam requested a review from lguohan as a code owner December 2, 2022 08:06
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 2, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@hari-selvam hari-selvam changed the title [sflow]: Unblocked psample_*() function calls in BRCM ESW platforms f… [sflow]: Unblocked psample_*() function calls related to BRCM specific procfs for sflow feature's working in ESW platforms Dec 2, 2022
@lguohan
Copy link
Collaborator

lguohan commented Dec 4, 2022

@adyeung , can you find someone review this pr?

@adyeung
Copy link
Collaborator

adyeung commented Dec 4, 2022

@michaelli10 already engaged with hari-selvam in the other thread

@michaelli10 pls help review the PR

Copy link
Contributor

@michaelli10 michaelli10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed changes previously with Hari and tested with and and without CONFIG_PSAMPLE

@saiarcot895 saiarcot895 merged commit d993444 into sonic-net:master Dec 8, 2022
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Dec 8, 2022
…or proper functionality of sflow feature (sonic-net#12918)

*Replaced BRCM SDK's psample support flag(PSAMPLE_SUPPORT) with linux kernel psample module support config flag(CONFIG_PSAMPLE) in saibcm-modules.
*Replaced BUILD_PSAMPLE conditioanl check with CONFIG_PSAMPLE to build psample callback library(psample-cb.o), only if psample config is enabled in linux kernel.
*Cleaned up PSAMPLE_SUPPORT related commented code.

Signed-off-by: haris@celestica.com

Signed-off-by: haris@celestica.com
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #13001

mssonicbld added a commit that referenced this pull request Dec 8, 2022
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Feb 6, 2023
…or proper functionality of sflow feature (sonic-net#12918)

*Replaced BRCM SDK's psample support flag(PSAMPLE_SUPPORT) with linux kernel psample module support config flag(CONFIG_PSAMPLE) in saibcm-modules.
*Replaced BUILD_PSAMPLE conditioanl check with CONFIG_PSAMPLE to build psample callback library(psample-cb.o), only if psample config is enabled in linux kernel.
*Cleaned up PSAMPLE_SUPPORT related commented code.

Signed-off-by: haris@celestica.com

Signed-off-by: haris@celestica.com
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202211: #13691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SFLOW configuration causes swss docker to exit in Broadcom TD3-X2 platform in 202205 release.
8 participants