Przeglądaj źródła

Merge pull request #163 in PROCESSOR-SDK/processor-sdk-linux from PLSDK-2825 to processor-sdk-linux-4.19.y

* commit '1440fd5f25c8104d91b2c539030a0c022248ac34':
  net: hsr/prp: Add SV frame counts in the rx direction
Muralidharan Karicheri 6 lat temu
rodzic
commit
caf3f498b3

+ 2 - 0
net/hsr-prp/hsr_prp_debugfs.c

@@ -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;

+ 7 - 0
net/hsr-prp/hsr_prp_forward.c

@@ -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.
 	 */

+ 4 - 0
net/hsr-prp/hsr_prp_main.h

@@ -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 {
@@ -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);