@@ -307,6 +307,7 @@ void txgbe_atr(struct wx_ring *ring, struct wx_tx_buffer *first, u8 ptype)
307
307
int txgbe_fdir_set_input_mask (struct wx * wx , union txgbe_atr_input * input_mask )
308
308
{
309
309
u32 fdirm = 0 , fdirtcpm = 0 , flex = 0 ;
310
+ int index , offset ;
310
311
311
312
/* Program the relevant mask registers. If src/dst_port or src/dst_addr
312
313
* are zero, then assume a full mask for that field. Also assume that
@@ -352,23 +353,25 @@ int txgbe_fdir_set_input_mask(struct wx *wx, union txgbe_atr_input *input_mask)
352
353
/* Now mask VM pool and destination IPv6 - bits 5 and 2 */
353
354
wr32 (wx , TXGBE_RDB_FDIR_OTHER_MSK , fdirm );
354
355
355
- flex = rd32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (0 ));
356
- flex &= ~TXGBE_RDB_FDIR_FLEX_CFG_FIELD0 ;
356
+ index = VMDQ_P (0 ) / 4 ;
357
+ offset = VMDQ_P (0 ) % 4 ;
358
+ flex = rd32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (index ));
359
+ flex &= ~(TXGBE_RDB_FDIR_FLEX_CFG_FIELD0 << (offset * 8 ));
357
360
flex |= (TXGBE_RDB_FDIR_FLEX_CFG_BASE_MAC |
358
- TXGBE_RDB_FDIR_FLEX_CFG_OFST (0x6 ));
361
+ TXGBE_RDB_FDIR_FLEX_CFG_OFST (0x6 )) << ( offset * 8 ) ;
359
362
360
363
switch ((__force u16 )input_mask -> formatted .flex_bytes & 0xFFFF ) {
361
364
case 0x0000 :
362
365
/* Mask Flex Bytes */
363
- flex |= TXGBE_RDB_FDIR_FLEX_CFG_MSK ;
366
+ flex |= TXGBE_RDB_FDIR_FLEX_CFG_MSK << ( offset * 8 ) ;
364
367
break ;
365
368
case 0xFFFF :
366
369
break ;
367
370
default :
368
371
wx_err (wx , "Error on flexible byte mask\n" );
369
372
return - EINVAL ;
370
373
}
371
- wr32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (0 ), flex );
374
+ wr32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (index ), flex );
372
375
373
376
/* store the TCP/UDP port masks, bit reversed from port layout */
374
377
fdirtcpm = ntohs (input_mask -> formatted .dst_port );
@@ -516,14 +519,16 @@ static void txgbe_fdir_enable(struct wx *wx, u32 fdirctrl)
516
519
static void txgbe_init_fdir_signature (struct wx * wx )
517
520
{
518
521
u32 fdirctrl = TXGBE_FDIR_PBALLOC_64K ;
522
+ int index = VMDQ_P (0 ) / 4 ;
523
+ int offset = VMDQ_P (0 ) % 4 ;
519
524
u32 flex = 0 ;
520
525
521
- flex = rd32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (0 ));
522
- flex &= ~TXGBE_RDB_FDIR_FLEX_CFG_FIELD0 ;
526
+ flex = rd32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (index ));
527
+ flex &= ~( TXGBE_RDB_FDIR_FLEX_CFG_FIELD0 << ( offset * 8 )) ;
523
528
524
529
flex |= (TXGBE_RDB_FDIR_FLEX_CFG_BASE_MAC |
525
- TXGBE_RDB_FDIR_FLEX_CFG_OFST (0x6 ));
526
- wr32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (0 ), flex );
530
+ TXGBE_RDB_FDIR_FLEX_CFG_OFST (0x6 )) << ( offset * 8 ) ;
531
+ wr32 (wx , TXGBE_RDB_FDIR_FLEX_CFG (index ), flex );
527
532
528
533
/* Continue setup of fdirctrl register bits:
529
534
* Move the flexible bytes to use the ethertype - shift 6 words
0 commit comments