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
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
# A copy of the GNU General Public License version 2 (GPLv2) can
# be found in the LICENSES folder.$
#
ifeq ($(BUILD_PSAMPLE),1)
PSAMPLE_CFLAGS=-DPSAMPLE_SUPPORT
ifneq ($(CONFIG_PSAMPLE),)
PSAMPLE_CB_OBJS=psample-cb.o
endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ static struct sk_buff *
ngknet_rx_cb(struct sk_buff *skb)
{
skb = strip_tag_rx_cb(skb);
#ifdef PSAMPLE_SUPPORT
skb = psample_rx_cb(skb);
#if IS_ENABLED(CONFIG_PSAMPLE)
skb = psample_rx_cb(skb);
#endif
return skb;
}
Expand All @@ -324,7 +324,7 @@ static int
ngknet_netif_create_cb(struct net_device *dev)
{
int retv = 0;
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
retv = psample_netif_create_cb(dev);
#endif
return retv;
Expand All @@ -334,7 +334,7 @@ static int
ngknet_netif_destroy_cb(struct net_device *dev)
{
int retv = 0;
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
retv = psample_netif_destroy_cb(dev);
#endif
return retv;
Expand Down Expand Up @@ -431,7 +431,7 @@ ngknetcb_init_module(void)
ngknet_rx_cb_register(ngknet_rx_cb);
ngknet_tx_cb_register(ngknet_tx_cb);

#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
psample_init();
#endif

Expand All @@ -446,7 +446,7 @@ ngknetcb_exit_module(void)
ngknet_netif_create_cb_unregister(ngknet_netif_create_cb);
ngknet_netif_destroy_cb_unregister(ngknet_netif_destroy_cb);

#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
psample_cleanup();
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <lkm/lkm.h>
#include <linux/netdevice.h>

//#define PSAMPLE_SUPPORT 1 // TODO: MLI@BRCM - Add this as part of conditional in Makefile
#define PSAMPLE_CB_NAME "psample"

extern int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <linux/if_vlan.h>

/* Enable sflow sampling using psample */
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
#include "psample-cb.h"
#endif

Expand Down Expand Up @@ -334,7 +334,7 @@ knet_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta,
int chan, kcom_filter_t *kf)
{
/* check for filter callback handler */
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
if (strncmp(kf->desc, PSAMPLE_CB_NAME, strlen(PSAMPLE_CB_NAME)) == 0) {
return psample_filter_cb (pkt, size, dev_no, meta, chan, kf);
}
Expand All @@ -346,7 +346,7 @@ static int
knet_netif_create_cb(int unit, kcom_netif_t *netif, uint16 spa, struct net_device *dev)
{
int retv = 0;
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
retv = psample_netif_create_cb(unit, netif, spa, dev);
#endif
return retv;
Expand All @@ -356,7 +356,7 @@ static int
knet_netif_destroy_cb(int unit, kcom_netif_t *netif, uint16 spa, struct net_device *dev)
{
int retv = 0;
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
retv = psample_netif_destroy_cb(unit, netif, spa, dev);
#endif
return retv;
Expand All @@ -367,7 +367,7 @@ knet_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta,
int chan, kcom_filter_t *kf)
{
/* check for filter callback handler */
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
if (strncmp(kf->desc, PSAMPLE_CB_NAME, KCOM_FILTER_DESC_MAX) == 0) {
return psample_filter_cb (pkt, size, dev_no, meta, chan, kf);
}
Expand All @@ -379,7 +379,7 @@ static int
knet_netif_create_cb(int unit, kcom_netif_t *netif, struct net_device *dev)
{
int retv = 0;
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
retv = psample_netif_create_cb(unit, netif, dev);
#endif
return retv;
Expand All @@ -389,7 +389,7 @@ static int
knet_netif_destroy_cb(int unit, kcom_netif_t *netif, struct net_device *dev)
{
int retv = 0;
#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
retv = psample_netif_destroy_cb(unit, netif, dev);
#endif
return retv;
Expand Down Expand Up @@ -427,7 +427,7 @@ _cleanup(void)
bkn_netif_create_cb_unregister(knet_netif_create_cb);
bkn_netif_destroy_cb_unregister(knet_netif_destroy_cb);

#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
psample_cleanup();
#endif
return 0;
Expand All @@ -445,7 +445,7 @@ _init(void)
bkn_tx_skb_cb_register(strip_tag_tx_cb);
}

#ifdef PSAMPLE_SUPPORT
#if IS_ENABLED(CONFIG_PSAMPLE)
psample_init();
#endif
bkn_filter_cb_register(knet_filter_cb);
Expand Down