@@ -1147,8 +1147,15 @@ static void wx_enable_rx(struct wx *wx)
11471147static void wx_set_rxpba (struct wx * wx )
11481148{
11491149 u32 rxpktsize , txpktsize , txpbthresh ;
1150+ u32 pbsize = wx -> mac .rx_pb_size ;
11501151
1151- rxpktsize = wx -> mac .rx_pb_size << WX_RDB_PB_SZ_SHIFT ;
1152+ if (test_bit (WX_FLAG_FDIR_CAPABLE , wx -> flags )) {
1153+ if (test_bit (WX_FLAG_FDIR_HASH , wx -> flags ) ||
1154+ test_bit (WX_FLAG_FDIR_PERFECT , wx -> flags ))
1155+ pbsize -= 64 ; /* Default 64KB */
1156+ }
1157+
1158+ rxpktsize = pbsize << WX_RDB_PB_SZ_SHIFT ;
11521159 wr32 (wx , WX_RDB_PB_SZ (0 ), rxpktsize );
11531160
11541161 /* Only support an equally distributed Tx packet buffer strategy. */
@@ -1261,7 +1268,7 @@ static void wx_configure_port(struct wx *wx)
12611268 * Stops the receive data path and waits for the HW to internally empty
12621269 * the Rx security block
12631270 **/
1264- static int wx_disable_sec_rx_path (struct wx * wx )
1271+ int wx_disable_sec_rx_path (struct wx * wx )
12651272{
12661273 u32 secrx ;
12671274
@@ -1271,18 +1278,20 @@ static int wx_disable_sec_rx_path(struct wx *wx)
12711278 return read_poll_timeout (rd32 , secrx , secrx & WX_RSC_ST_RSEC_RDY ,
12721279 1000 , 40000 , false, wx , WX_RSC_ST );
12731280}
1281+ EXPORT_SYMBOL (wx_disable_sec_rx_path );
12741282
12751283/**
12761284 * wx_enable_sec_rx_path - Enables the receive data path
12771285 * @wx: pointer to private structure
12781286 *
12791287 * Enables the receive data path.
12801288 **/
1281- static void wx_enable_sec_rx_path (struct wx * wx )
1289+ void wx_enable_sec_rx_path (struct wx * wx )
12821290{
12831291 wr32m (wx , WX_RSC_CTL , WX_RSC_CTL_RX_DIS , 0 );
12841292 WX_WRITE_FLUSH (wx );
12851293}
1294+ EXPORT_SYMBOL (wx_enable_sec_rx_path );
12861295
12871296static void wx_vlan_strip_control (struct wx * wx , bool enable )
12881297{
@@ -1499,6 +1508,13 @@ static void wx_configure_tx_ring(struct wx *wx,
14991508 txdctl |= ring -> count / 128 << WX_PX_TR_CFG_TR_SIZE_SHIFT ;
15001509 txdctl |= 0x20 << WX_PX_TR_CFG_WTHRESH_SHIFT ;
15011510
1511+ ring -> atr_count = 0 ;
1512+ if (test_bit (WX_FLAG_FDIR_CAPABLE , wx -> flags ) &&
1513+ test_bit (WX_FLAG_FDIR_HASH , wx -> flags ))
1514+ ring -> atr_sample_rate = wx -> atr_sample_rate ;
1515+ else
1516+ ring -> atr_sample_rate = 0 ;
1517+
15021518 /* reinitialize tx_buffer_info */
15031519 memset (ring -> tx_buffer_info , 0 ,
15041520 sizeof (struct wx_tx_buffer ) * ring -> count );
@@ -1732,7 +1748,9 @@ void wx_configure(struct wx *wx)
17321748
17331749 wx_set_rx_mode (wx -> netdev );
17341750 wx_restore_vlan (wx );
1735- wx_enable_sec_rx_path (wx );
1751+
1752+ if (test_bit (WX_FLAG_FDIR_CAPABLE , wx -> flags ))
1753+ wx -> configure_fdir (wx );
17361754
17371755 wx_configure_tx (wx );
17381756 wx_configure_rx (wx );
@@ -1959,6 +1977,7 @@ int wx_sw_init(struct wx *wx)
19591977 }
19601978
19611979 bitmap_zero (wx -> state , WX_STATE_NBITS );
1980+ bitmap_zero (wx -> flags , WX_PF_FLAGS_NBITS );
19621981
19631982 return 0 ;
19641983}
0 commit comments