Adding offset to control storm control behavior
authorVineet Roy <a0131726@ti.com>
Mon, 14 Dec 2020 13:09:26 +0000 (18:39 +0530)
committerSivaraj R <sivaraj@ti.com>
Wed, 16 Dec 2020 07:42:15 +0000 (01:42 -0600)
Host can control whether storm prevention bypass for cut-through should be enabled or not. This is for backward compatibility

packages/ti/drv/icss_emac/firmware/icss_dualemac/src/emac_MII_Rcv.asm
packages/ti/drv/icss_emac/firmware/icss_dualemac/src/icss_emacSwitch.h
packages/ti/drv/icss_emac/firmware/icss_switch/src/icss_switch.h

index 6b8651257d50d6359e93cf59c6297b245ec04199..253fb54e044d85c3358177258b2e6c6fee11a4e1 100755 (executable)
@@ -514,7 +514,12 @@ FB_SKIP_VLAN_FLTR:
 
     ;PINDSW-4577: Fix to avoid cut-through packets from going via Storm Prevention
     ;Storm prevention is done only if host receive flag is set
+    LDI     RCV_TEMP_REG_3.w2, DISABLE_STORM_PREV_FOR_HOST
+    LBCO    &RCV_TEMP_REG_3.b0, PRU_DMEM_ADDR, RCV_TEMP_REG_3.w2, 1   ; load the control value
+    ;This check is for maintaining backward compatibility, driver needs to write non-zero value for enabling
+    QBEQ    FB_SKIP_HOST_CHECK_STORM_PREV, RCV_TEMP_REG_3.b0, 0       
     QBBC    FB_CONT_CT_CHECK, MII_RCV.rx_flags , host_rcv_flag_shift
+FB_SKIP_HOST_CHECK_STORM_PREV:
     
     ; Storm Prevention
     QBBC    FB_STORM_NOT_MC, R22, RX_MC_FRAME
index 5c5ffea8e97bf7dc9f8bee9e556bda0b19e35fc2..322d1286d60c05b515d23a0aa6a8be00a3ea2baf 100644 (file)
@@ -488,6 +488,7 @@ STORM_PREVENTION_OFFSET_UC          .set    STATISTICS_OFFSET + STAT_SIZE + 41
 SP_UPDATE_TIMESTAMP_OFFSET          .set    STATISTICS_OFFSET + STAT_SIZE + 45  ;4 bytes
 SP_INCREMENT_COUNT_OFFSET           .set    STATISTICS_OFFSET + STAT_SIZE + 49  ;4 bytes
 SP_COUNTER_UPDATE_INTERVAL_OFFSET   .set    STATISTICS_OFFSET + STAT_SIZE + 53  ;4 bytes
+DISABLE_STORM_PREV_FOR_HOST         .set    STATISTICS_OFFSET + STAT_SIZE + 57  ;1 byte
        
 ;***********************************************************************************************************
 ;                                                                                                         *
index 5acf2861d419cd74dab7cb95ca41adf41eb8fd4c..f7960e69481c8fbc7b091102ea2468b2d1079b5c 100644 (file)
@@ -467,6 +467,7 @@ STORM_PREVENTION_OFFSET_UC          .set    STATISTICS_OFFSET + STAT_SIZE + 41
 SP_UPDATE_TIMESTAMP_OFFSET          .set    STATISTICS_OFFSET + STAT_SIZE + 45  ;4 bytes
 SP_INCREMENT_COUNT_OFFSET           .set    STATISTICS_OFFSET + STAT_SIZE + 49  ;4 bytes
 SP_COUNTER_UPDATE_INTERVAL_OFFSET   .set    STATISTICS_OFFSET + STAT_SIZE + 53  ;4 bytes
+DISABLE_STORM_PREV_FOR_HOST         .set    STATISTICS_OFFSET + STAT_SIZE + 57  ;1 byte
 
 SP_COUNTER_UPDATE_INTERVAL_DEFAULT  .set    100000000
 
@@ -475,7 +476,7 @@ SP_COUNTER_UPDATE_INTERVAL_DEFAULT  .set    100000000
 ;                          Protocol-specific Stats                          *
 ;****************************************************************************
 ; Placing these AFTER cfg offsets so as to not interfere with icss_emac
-STP_INVALID_STATE_OFFSET    .set              STORM_PREVENTION_OFFSET_UC + 4 ; number of invalid STP state errors
+STP_INVALID_STATE_OFFSET    .set           STATISTICS_OFFSET + STAT_SIZE + 58 ; number of invalid STP state errors
 
 ;***********************************************************************************************************
 ;                                                                                                          *