File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
drivers/net/ethernet/broadcom/bnxt Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -4246,9 +4246,23 @@ static void bnxt_init_vnics(struct bnxt *bp)
4246
4246
u8 * key = (void * )vnic -> rss_hash_key ;
4247
4247
int k ;
4248
4248
4249
+ if (!bp -> rss_hash_key_valid &&
4250
+ !bp -> rss_hash_key_updated ) {
4251
+ get_random_bytes (bp -> rss_hash_key ,
4252
+ HW_HASH_KEY_SIZE );
4253
+ bp -> rss_hash_key_updated = true;
4254
+ }
4255
+
4256
+ memcpy (vnic -> rss_hash_key , bp -> rss_hash_key ,
4257
+ HW_HASH_KEY_SIZE );
4258
+
4259
+ if (!bp -> rss_hash_key_updated )
4260
+ continue ;
4261
+
4262
+ bp -> rss_hash_key_updated = false;
4263
+ bp -> rss_hash_key_valid = true;
4264
+
4249
4265
bp -> toeplitz_prefix = 0 ;
4250
- get_random_bytes (vnic -> rss_hash_key ,
4251
- HW_HASH_KEY_SIZE );
4252
4266
for (k = 0 ; k < 8 ; k ++ ) {
4253
4267
bp -> toeplitz_prefix <<= 8 ;
4254
4268
bp -> toeplitz_prefix |= key [k ];
Original file line number Diff line number Diff line change @@ -2222,6 +2222,10 @@ struct bnxt {
2222
2222
#define BNXT_RSS_CAP_NEW_RSS_CAP BIT(2)
2223
2223
#define BNXT_RSS_CAP_RSS_TCAM BIT(3)
2224
2224
2225
+ u8 rss_hash_key [HW_HASH_KEY_SIZE ];
2226
+ u8 rss_hash_key_valid :1 ;
2227
+ u8 rss_hash_key_updated :1 ;
2228
+
2225
2229
u16 max_mtu ;
2226
2230
u8 max_tc ;
2227
2231
u8 max_lltc ; /* lossless TCs */
Original file line number Diff line number Diff line change @@ -1755,8 +1755,10 @@ static int bnxt_set_rxfh(struct net_device *dev,
1755
1755
if (rxfh -> hfunc && rxfh -> hfunc != ETH_RSS_HASH_TOP )
1756
1756
return - EOPNOTSUPP ;
1757
1757
1758
- if (rxfh -> key )
1759
- return - EOPNOTSUPP ;
1758
+ if (rxfh -> key ) {
1759
+ memcpy (bp -> rss_hash_key , rxfh -> key , HW_HASH_KEY_SIZE );
1760
+ bp -> rss_hash_key_updated = true;
1761
+ }
1760
1762
1761
1763
if (rxfh -> indir ) {
1762
1764
u32 i , pad , tbl_size = bnxt_get_rxfh_indir_size (dev );
You can’t perform that action at this time.
0 commit comments