Skip to content

Commit

Permalink
Merge pull request torvalds#163 in PROCESSOR-SDK/processor-sdk-linux …
Browse files Browse the repository at this point in the history
…from PLSDK-2825 to processor-sdk-linux-4.19.y

* commit '1440fd5f25c8104d91b2c539030a0c022248ac34':
  net: hsr/prp: Add SV frame counts in the rx direction
  • Loading branch information
Muralidharan Karicheri committed Jun 12, 2019
2 parents e11f61e + 1440fd5 commit caf3f49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/hsr-prp/hsr_prp_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ hsr_prp_lre_info_show(struct seq_file *sfp, void *data)
priv->sv_frame_dei);
}
seq_printf(sfp, "cnt_tx_sup = %d\n", priv->dbg_stats.cnt_tx_sup);
seq_printf(sfp, "cnt_rx_sup_A = %d\n", priv->dbg_stats.cnt_rx_sup_a);
seq_printf(sfp, "cnt_rx_sup_B = %d\n", priv->dbg_stats.cnt_rx_sup_b);
seq_printf(sfp, "disable SV Frame = %d\n", priv->disable_sv_frame);
seq_puts(sfp, "\n");
return 0;
Expand Down
7 changes: 7 additions & 0 deletions net/hsr-prp/hsr_prp_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,13 @@ static int fill_frame_info(struct hsr_prp_frame_info *frame,
port->type != HSR_PRP_PT_MASTER)
return -1;

if (frame->is_supervision) {
if (port->type == HSR_PRP_PT_SLAVE_A)
INC_CNT_RX_SUP_A(priv);
else if (port->type == HSR_PRP_PT_SLAVE_B)
INC_CNT_RX_SUP_B(priv);
}

/* For Offloaded case, there is no need for node list since
* firmware/hardware implements LRE function.
*/
Expand Down
4 changes: 4 additions & 0 deletions net/hsr-prp/hsr_prp_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ static inline void set_prp_LSDU_size(struct prp_rct *rct, u16 LSDU_size)

struct hsr_prp_debug_stats {
u32 cnt_tx_sup;
u32 cnt_rx_sup_a;
u32 cnt_rx_sup_b;
};

struct hsr_prp_port {
Expand Down Expand Up @@ -349,6 +351,8 @@ void hsr_prp_unregister_notifier(u8 proto);
(priv)->lre_stats.cnt_own_rx_a++ : \
(priv)->lre_stats.cnt_own_rx_b++)
#define INC_CNT_TX_SUP(priv) ((priv)->dbg_stats.cnt_tx_sup++)
#define INC_CNT_RX_SUP_A(priv) ((priv)->dbg_stats.cnt_rx_sup_a++)
#define INC_CNT_RX_SUP_B(priv) ((priv)->dbg_stats.cnt_rx_sup_b++)

#if IS_ENABLED(CONFIG_DEBUG_FS)
int hsr_prp_debugfs_init(struct hsr_prp_priv *priv, struct net_device *ndev);
Expand Down

0 comments on commit caf3f49

Please sign in to comment.