1 /****************************************************************************
2 * Driver for Solarflare Solarstorm network controllers and boards
3 * Copyright 2005-2010 Solarflare Communications Inc.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference.
18 /* "Fudge factors" - difference between programmed value and actual depth.
19 * Due to pipelined implementation we need to program H/W with a value that
20 * is larger than the hop limit we want.
22 #define FILTER_CTL_SRCH_FUDGE_WILD 3
23 #define FILTER_CTL_SRCH_FUDGE_FULL 1
25 /* Hard maximum hop limit. Hardware will time-out beyond 200-something.
26 * We also need to avoid infinite loops in efx_filter_search() when the
29 #define FILTER_CTL_SRCH_MAX 200
31 /* Don't try very hard to find space for performance hints, as this is
32 * counter-productive. */
33 #define FILTER_CTL_SRCH_HINT_MAX 5
35 enum efx_filter_table_id
{
36 EFX_FILTER_TABLE_RX_IP
= 0,
37 EFX_FILTER_TABLE_RX_MAC
,
38 EFX_FILTER_TABLE_COUNT
,
41 struct efx_filter_table
{
42 enum efx_filter_table_id id
;
43 u32 offset
; /* address of table relative to BAR */
44 unsigned size
; /* number of entries */
45 unsigned step
; /* step between entries */
46 unsigned used
; /* number currently used */
47 unsigned long *used_bitmap
;
48 struct efx_filter_spec
*spec
;
49 unsigned search_depth
[EFX_FILTER_TYPE_COUNT
];
52 struct efx_filter_state
{
54 struct efx_filter_table table
[EFX_FILTER_TABLE_COUNT
];
55 #ifdef CONFIG_RFS_ACCEL
57 unsigned rps_expire_index
;
61 /* The filter hash function is LFSR polynomial x^16 + x^3 + 1 of a 32-bit
62 * key derived from the n-tuple. The initial LFSR state is 0xffff. */
63 static u16
efx_filter_hash(u32 key
)
68 tmp
= 0x1fff ^ key
>> 16;
69 tmp
= tmp
^ tmp
>> 3 ^ tmp
>> 6;
72 tmp
= tmp
^ tmp
<< 13 ^ key
;
73 tmp
= tmp
^ tmp
>> 3 ^ tmp
>> 6;
74 return tmp
^ tmp
>> 9;
77 /* To allow for hash collisions, filter search continues at these
78 * increments from the first possible entry selected by the hash. */
79 static u16
efx_filter_increment(u32 key
)
84 static enum efx_filter_table_id
85 efx_filter_spec_table_id(const struct efx_filter_spec
*spec
)
87 BUILD_BUG_ON(EFX_FILTER_TABLE_RX_IP
!= (EFX_FILTER_TCP_FULL
>> 2));
88 BUILD_BUG_ON(EFX_FILTER_TABLE_RX_IP
!= (EFX_FILTER_TCP_WILD
>> 2));
89 BUILD_BUG_ON(EFX_FILTER_TABLE_RX_IP
!= (EFX_FILTER_UDP_FULL
>> 2));
90 BUILD_BUG_ON(EFX_FILTER_TABLE_RX_IP
!= (EFX_FILTER_UDP_WILD
>> 2));
91 BUILD_BUG_ON(EFX_FILTER_TABLE_RX_MAC
!= (EFX_FILTER_MAC_FULL
>> 2));
92 BUILD_BUG_ON(EFX_FILTER_TABLE_RX_MAC
!= (EFX_FILTER_MAC_WILD
>> 2));
93 EFX_BUG_ON_PARANOID(spec
->type
== EFX_FILTER_UNSPEC
);
94 return spec
->type
>> 2;
97 static struct efx_filter_table
*
98 efx_filter_spec_table(struct efx_filter_state
*state
,
99 const struct efx_filter_spec
*spec
)
101 if (spec
->type
== EFX_FILTER_UNSPEC
)
104 return &state
->table
[efx_filter_spec_table_id(spec
)];
107 static void efx_filter_table_reset_search_depth(struct efx_filter_table
*table
)
109 memset(table
->search_depth
, 0, sizeof(table
->search_depth
));
112 static void efx_filter_push_rx_limits(struct efx_nic
*efx
)
114 struct efx_filter_state
*state
= efx
->filter_state
;
115 struct efx_filter_table
*table
;
116 efx_oword_t filter_ctl
;
118 efx_reado(efx
, &filter_ctl
, FR_BZ_RX_FILTER_CTL
);
120 table
= &state
->table
[EFX_FILTER_TABLE_RX_IP
];
121 EFX_SET_OWORD_FIELD(filter_ctl
, FRF_BZ_TCP_FULL_SRCH_LIMIT
,
122 table
->search_depth
[EFX_FILTER_TCP_FULL
] +
123 FILTER_CTL_SRCH_FUDGE_FULL
);
124 EFX_SET_OWORD_FIELD(filter_ctl
, FRF_BZ_TCP_WILD_SRCH_LIMIT
,
125 table
->search_depth
[EFX_FILTER_TCP_WILD
] +
126 FILTER_CTL_SRCH_FUDGE_WILD
);
127 EFX_SET_OWORD_FIELD(filter_ctl
, FRF_BZ_UDP_FULL_SRCH_LIMIT
,
128 table
->search_depth
[EFX_FILTER_UDP_FULL
] +
129 FILTER_CTL_SRCH_FUDGE_FULL
);
130 EFX_SET_OWORD_FIELD(filter_ctl
, FRF_BZ_UDP_WILD_SRCH_LIMIT
,
131 table
->search_depth
[EFX_FILTER_UDP_WILD
] +
132 FILTER_CTL_SRCH_FUDGE_WILD
);
134 table
= &state
->table
[EFX_FILTER_TABLE_RX_MAC
];
137 filter_ctl
, FRF_CZ_ETHERNET_FULL_SEARCH_LIMIT
,
138 table
->search_depth
[EFX_FILTER_MAC_FULL
] +
139 FILTER_CTL_SRCH_FUDGE_FULL
);
141 filter_ctl
, FRF_CZ_ETHERNET_WILDCARD_SEARCH_LIMIT
,
142 table
->search_depth
[EFX_FILTER_MAC_WILD
] +
143 FILTER_CTL_SRCH_FUDGE_WILD
);
146 efx_writeo(efx
, &filter_ctl
, FR_BZ_RX_FILTER_CTL
);
149 static inline void __efx_filter_set_ipv4(struct efx_filter_spec
*spec
,
150 __be32 host1
, __be16 port1
,
151 __be32 host2
, __be16 port2
)
153 spec
->data
[0] = ntohl(host1
) << 16 | ntohs(port1
);
154 spec
->data
[1] = ntohs(port2
) << 16 | ntohl(host1
) >> 16;
155 spec
->data
[2] = ntohl(host2
);
159 * efx_filter_set_ipv4_local - specify IPv4 host, transport protocol and port
160 * @spec: Specification to initialise
161 * @proto: Transport layer protocol number
162 * @host: Local host address (network byte order)
163 * @port: Local port (network byte order)
165 int efx_filter_set_ipv4_local(struct efx_filter_spec
*spec
, u8 proto
,
166 __be32 host
, __be16 port
)
171 EFX_BUG_ON_PARANOID(!(spec
->flags
& EFX_FILTER_FLAG_RX
));
173 /* This cannot currently be combined with other filtering */
174 if (spec
->type
!= EFX_FILTER_UNSPEC
)
175 return -EPROTONOSUPPORT
;
182 spec
->type
= EFX_FILTER_TCP_WILD
;
185 spec
->type
= EFX_FILTER_UDP_WILD
;
188 return -EPROTONOSUPPORT
;
191 /* Filter is constructed in terms of source and destination,
192 * with the odd wrinkle that the ports are swapped in a UDP
193 * wildcard filter. We need to convert from local and remote
194 * (= zero for wildcard) addresses.
197 if (proto
!= IPPROTO_UDP
) {
204 __efx_filter_set_ipv4(spec
, host1
, port1
, host
, port
);
209 * efx_filter_set_ipv4_full - specify IPv4 hosts, transport protocol and ports
210 * @spec: Specification to initialise
211 * @proto: Transport layer protocol number
212 * @host: Local host address (network byte order)
213 * @port: Local port (network byte order)
214 * @rhost: Remote host address (network byte order)
215 * @rport: Remote port (network byte order)
217 int efx_filter_set_ipv4_full(struct efx_filter_spec
*spec
, u8 proto
,
218 __be32 host
, __be16 port
,
219 __be32 rhost
, __be16 rport
)
221 EFX_BUG_ON_PARANOID(!(spec
->flags
& EFX_FILTER_FLAG_RX
));
223 /* This cannot currently be combined with other filtering */
224 if (spec
->type
!= EFX_FILTER_UNSPEC
)
225 return -EPROTONOSUPPORT
;
227 if (port
== 0 || rport
== 0)
232 spec
->type
= EFX_FILTER_TCP_FULL
;
235 spec
->type
= EFX_FILTER_UDP_FULL
;
238 return -EPROTONOSUPPORT
;
241 __efx_filter_set_ipv4(spec
, rhost
, rport
, host
, port
);
246 * efx_filter_set_eth_local - specify local Ethernet address and optional VID
247 * @spec: Specification to initialise
248 * @vid: VLAN ID to match, or %EFX_FILTER_VID_UNSPEC
249 * @addr: Local Ethernet MAC address
251 int efx_filter_set_eth_local(struct efx_filter_spec
*spec
,
252 u16 vid
, const u8
*addr
)
254 EFX_BUG_ON_PARANOID(!(spec
->flags
& EFX_FILTER_FLAG_RX
));
256 /* This cannot currently be combined with other filtering */
257 if (spec
->type
!= EFX_FILTER_UNSPEC
)
258 return -EPROTONOSUPPORT
;
260 if (vid
== EFX_FILTER_VID_UNSPEC
) {
261 spec
->type
= EFX_FILTER_MAC_WILD
;
264 spec
->type
= EFX_FILTER_MAC_FULL
;
268 spec
->data
[1] = addr
[2] << 24 | addr
[3] << 16 | addr
[4] << 8 | addr
[5];
269 spec
->data
[2] = addr
[0] << 8 | addr
[1];
273 /* Build a filter entry and return its n-tuple key. */
274 static u32
efx_filter_build(efx_oword_t
*filter
, struct efx_filter_spec
*spec
)
278 switch (efx_filter_spec_table_id(spec
)) {
279 case EFX_FILTER_TABLE_RX_IP
: {
280 bool is_udp
= (spec
->type
== EFX_FILTER_UDP_FULL
||
281 spec
->type
== EFX_FILTER_UDP_WILD
);
282 EFX_POPULATE_OWORD_7(
285 !!(spec
->flags
& EFX_FILTER_FLAG_RX_RSS
),
287 !!(spec
->flags
& EFX_FILTER_FLAG_RX_SCATTER
),
288 FRF_BZ_TCP_UDP
, is_udp
,
289 FRF_BZ_RXQ_ID
, spec
->dmaq_id
,
290 EFX_DWORD_2
, spec
->data
[2],
291 EFX_DWORD_1
, spec
->data
[1],
292 EFX_DWORD_0
, spec
->data
[0]);
297 case EFX_FILTER_TABLE_RX_MAC
: {
298 bool is_wild
= spec
->type
== EFX_FILTER_MAC_WILD
;
299 EFX_POPULATE_OWORD_8(
302 !!(spec
->flags
& EFX_FILTER_FLAG_RX_RSS
),
303 FRF_CZ_RMFT_SCATTER_EN
,
304 !!(spec
->flags
& EFX_FILTER_FLAG_RX_SCATTER
),
305 FRF_CZ_RMFT_IP_OVERRIDE
,
306 !!(spec
->flags
& EFX_FILTER_FLAG_RX_OVERRIDE_IP
),
307 FRF_CZ_RMFT_RXQ_ID
, spec
->dmaq_id
,
308 FRF_CZ_RMFT_WILDCARD_MATCH
, is_wild
,
309 FRF_CZ_RMFT_DEST_MAC_HI
, spec
->data
[2],
310 FRF_CZ_RMFT_DEST_MAC_LO
, spec
->data
[1],
311 FRF_CZ_RMFT_VLAN_ID
, spec
->data
[0]);
320 return spec
->data
[0] ^ spec
->data
[1] ^ spec
->data
[2] ^ data3
;
323 static bool efx_filter_equal(const struct efx_filter_spec
*left
,
324 const struct efx_filter_spec
*right
)
326 if (left
->type
!= right
->type
||
327 memcmp(left
->data
, right
->data
, sizeof(left
->data
)))
333 static int efx_filter_search(struct efx_filter_table
*table
,
334 struct efx_filter_spec
*spec
, u32 key
,
335 bool for_insert
, int *depth_required
)
337 unsigned hash
, incr
, filter_idx
, depth
, depth_max
;
338 struct efx_filter_spec
*cmp
;
340 hash
= efx_filter_hash(key
);
341 incr
= efx_filter_increment(key
);
342 depth_max
= (spec
->priority
<= EFX_FILTER_PRI_HINT
?
343 FILTER_CTL_SRCH_HINT_MAX
: FILTER_CTL_SRCH_MAX
);
345 for (depth
= 1, filter_idx
= hash
& (table
->size
- 1);
346 depth
<= depth_max
&& test_bit(filter_idx
, table
->used_bitmap
);
348 cmp
= &table
->spec
[filter_idx
];
349 if (efx_filter_equal(spec
, cmp
))
351 filter_idx
= (filter_idx
+ incr
) & (table
->size
- 1);
355 if (depth
> depth_max
)
358 *depth_required
= depth
;
362 /* Construct/deconstruct external filter IDs */
365 efx_filter_make_id(enum efx_filter_table_id table_id
, unsigned index
)
367 return table_id
<< 16 | index
;
371 * efx_filter_insert_filter - add or replace a filter
372 * @efx: NIC in which to insert the filter
373 * @spec: Specification for the filter
374 * @replace: Flag for whether the specified filter may replace a filter
375 * with an identical match expression and equal or lower priority
377 * On success, return the filter ID.
378 * On failure, return a negative error code.
380 int efx_filter_insert_filter(struct efx_nic
*efx
, struct efx_filter_spec
*spec
,
383 struct efx_filter_state
*state
= efx
->filter_state
;
384 struct efx_filter_table
*table
= efx_filter_spec_table(state
, spec
);
385 struct efx_filter_spec
*saved_spec
;
387 int filter_idx
, depth
;
391 if (!table
|| table
->size
== 0)
394 key
= efx_filter_build(&filter
, spec
);
396 netif_vdbg(efx
, hw
, efx
->net_dev
,
397 "%s: type %d search_depth=%d", __func__
, spec
->type
,
398 table
->search_depth
[spec
->type
]);
400 spin_lock_bh(&state
->lock
);
402 rc
= efx_filter_search(table
, spec
, key
, true, &depth
);
406 BUG_ON(filter_idx
>= table
->size
);
407 saved_spec
= &table
->spec
[filter_idx
];
409 if (test_bit(filter_idx
, table
->used_bitmap
)) {
410 /* Should we replace the existing filter? */
415 if (spec
->priority
< saved_spec
->priority
) {
420 __set_bit(filter_idx
, table
->used_bitmap
);
425 if (table
->search_depth
[spec
->type
] < depth
) {
426 table
->search_depth
[spec
->type
] = depth
;
427 efx_filter_push_rx_limits(efx
);
430 efx_writeo(efx
, &filter
, table
->offset
+ table
->step
* filter_idx
);
432 netif_vdbg(efx
, hw
, efx
->net_dev
,
433 "%s: filter type %d index %d rxq %u set",
434 __func__
, spec
->type
, filter_idx
, spec
->dmaq_id
);
435 rc
= efx_filter_make_id(table
->id
, filter_idx
);
438 spin_unlock_bh(&state
->lock
);
442 static void efx_filter_table_clear_entry(struct efx_nic
*efx
,
443 struct efx_filter_table
*table
,
446 static efx_oword_t filter
;
448 if (test_bit(filter_idx
, table
->used_bitmap
)) {
449 __clear_bit(filter_idx
, table
->used_bitmap
);
451 memset(&table
->spec
[filter_idx
], 0, sizeof(table
->spec
[0]));
453 efx_writeo(efx
, &filter
,
454 table
->offset
+ table
->step
* filter_idx
);
459 * efx_filter_remove_filter - remove a filter by specification
460 * @efx: NIC from which to remove the filter
461 * @spec: Specification for the filter
463 * On success, return zero.
464 * On failure, return a negative error code.
466 int efx_filter_remove_filter(struct efx_nic
*efx
, struct efx_filter_spec
*spec
)
468 struct efx_filter_state
*state
= efx
->filter_state
;
469 struct efx_filter_table
*table
= efx_filter_spec_table(state
, spec
);
470 struct efx_filter_spec
*saved_spec
;
472 int filter_idx
, depth
;
479 key
= efx_filter_build(&filter
, spec
);
481 spin_lock_bh(&state
->lock
);
483 rc
= efx_filter_search(table
, spec
, key
, false, &depth
);
487 saved_spec
= &table
->spec
[filter_idx
];
489 if (spec
->priority
< saved_spec
->priority
) {
494 efx_filter_table_clear_entry(efx
, table
, filter_idx
);
495 if (table
->used
== 0)
496 efx_filter_table_reset_search_depth(table
);
500 spin_unlock_bh(&state
->lock
);
504 static void efx_filter_table_clear(struct efx_nic
*efx
,
505 enum efx_filter_table_id table_id
,
506 enum efx_filter_priority priority
)
508 struct efx_filter_state
*state
= efx
->filter_state
;
509 struct efx_filter_table
*table
= &state
->table
[table_id
];
512 spin_lock_bh(&state
->lock
);
514 for (filter_idx
= 0; filter_idx
< table
->size
; ++filter_idx
)
515 if (table
->spec
[filter_idx
].priority
<= priority
)
516 efx_filter_table_clear_entry(efx
, table
, filter_idx
);
517 if (table
->used
== 0)
518 efx_filter_table_reset_search_depth(table
);
520 spin_unlock_bh(&state
->lock
);
524 * efx_filter_clear_rx - remove RX filters by priority
525 * @efx: NIC from which to remove the filters
526 * @priority: Maximum priority to remove
528 void efx_filter_clear_rx(struct efx_nic
*efx
, enum efx_filter_priority priority
)
530 efx_filter_table_clear(efx
, EFX_FILTER_TABLE_RX_IP
, priority
);
531 efx_filter_table_clear(efx
, EFX_FILTER_TABLE_RX_MAC
, priority
);
534 /* Restore filter stater after reset */
535 void efx_restore_filters(struct efx_nic
*efx
)
537 struct efx_filter_state
*state
= efx
->filter_state
;
538 enum efx_filter_table_id table_id
;
539 struct efx_filter_table
*table
;
543 spin_lock_bh(&state
->lock
);
545 for (table_id
= 0; table_id
< EFX_FILTER_TABLE_COUNT
; table_id
++) {
546 table
= &state
->table
[table_id
];
547 for (filter_idx
= 0; filter_idx
< table
->size
; filter_idx
++) {
548 if (!test_bit(filter_idx
, table
->used_bitmap
))
550 efx_filter_build(&filter
, &table
->spec
[filter_idx
]);
551 efx_writeo(efx
, &filter
,
552 table
->offset
+ table
->step
* filter_idx
);
556 efx_filter_push_rx_limits(efx
);
558 spin_unlock_bh(&state
->lock
);
561 int efx_probe_filters(struct efx_nic
*efx
)
563 struct efx_filter_state
*state
;
564 struct efx_filter_table
*table
;
567 state
= kzalloc(sizeof(*efx
->filter_state
), GFP_KERNEL
);
570 efx
->filter_state
= state
;
572 spin_lock_init(&state
->lock
);
574 if (efx_nic_rev(efx
) >= EFX_REV_FALCON_B0
) {
575 #ifdef CONFIG_RFS_ACCEL
576 state
->rps_flow_id
= kcalloc(FR_BZ_RX_FILTER_TBL0_ROWS
,
577 sizeof(*state
->rps_flow_id
),
579 if (!state
->rps_flow_id
)
582 table
= &state
->table
[EFX_FILTER_TABLE_RX_IP
];
583 table
->id
= EFX_FILTER_TABLE_RX_IP
;
584 table
->offset
= FR_BZ_RX_FILTER_TBL0
;
585 table
->size
= FR_BZ_RX_FILTER_TBL0_ROWS
;
586 table
->step
= FR_BZ_RX_FILTER_TBL0_STEP
;
589 if (efx_nic_rev(efx
) >= EFX_REV_SIENA_A0
) {
590 table
= &state
->table
[EFX_FILTER_TABLE_RX_MAC
];
591 table
->id
= EFX_FILTER_TABLE_RX_MAC
;
592 table
->offset
= FR_CZ_RX_MAC_FILTER_TBL0
;
593 table
->size
= FR_CZ_RX_MAC_FILTER_TBL0_ROWS
;
594 table
->step
= FR_CZ_RX_MAC_FILTER_TBL0_STEP
;
597 for (table_id
= 0; table_id
< EFX_FILTER_TABLE_COUNT
; table_id
++) {
598 table
= &state
->table
[table_id
];
599 if (table
->size
== 0)
601 table
->used_bitmap
= kcalloc(BITS_TO_LONGS(table
->size
),
602 sizeof(unsigned long),
604 if (!table
->used_bitmap
)
606 table
->spec
= vzalloc(table
->size
* sizeof(*table
->spec
));
614 efx_remove_filters(efx
);
618 void efx_remove_filters(struct efx_nic
*efx
)
620 struct efx_filter_state
*state
= efx
->filter_state
;
621 enum efx_filter_table_id table_id
;
623 for (table_id
= 0; table_id
< EFX_FILTER_TABLE_COUNT
; table_id
++) {
624 kfree(state
->table
[table_id
].used_bitmap
);
625 vfree(state
->table
[table_id
].spec
);
627 #ifdef CONFIG_RFS_ACCEL
628 kfree(state
->rps_flow_id
);
633 #ifdef CONFIG_RFS_ACCEL
635 int efx_filter_rfs(struct net_device
*net_dev
, const struct sk_buff
*skb
,
636 u16 rxq_index
, u32 flow_id
)
638 struct efx_nic
*efx
= netdev_priv(net_dev
);
639 struct efx_channel
*channel
;
640 struct efx_filter_state
*state
= efx
->filter_state
;
641 struct efx_filter_spec spec
;
642 const struct iphdr
*ip
;
647 nhoff
= skb_network_offset(skb
);
649 if (skb
->protocol
!= htons(ETH_P_IP
))
650 return -EPROTONOSUPPORT
;
652 /* RFS must validate the IP header length before calling us */
653 EFX_BUG_ON_PARANOID(!pskb_may_pull(skb
, nhoff
+ sizeof(*ip
)));
654 ip
= (const struct iphdr
*)(skb
->data
+ nhoff
);
655 if (ip
->frag_off
& htons(IP_MF
| IP_OFFSET
))
656 return -EPROTONOSUPPORT
;
657 EFX_BUG_ON_PARANOID(!pskb_may_pull(skb
, nhoff
+ 4 * ip
->ihl
+ 4));
658 ports
= (const __be16
*)(skb
->data
+ nhoff
+ 4 * ip
->ihl
);
660 efx_filter_init_rx(&spec
, EFX_FILTER_PRI_HINT
, 0, rxq_index
);
661 rc
= efx_filter_set_ipv4_full(&spec
, ip
->protocol
,
662 ip
->daddr
, ports
[1], ip
->saddr
, ports
[0]);
666 rc
= efx_filter_insert_filter(efx
, &spec
, true);
670 /* Remember this so we can check whether to expire the filter later */
671 state
->rps_flow_id
[rc
] = flow_id
;
672 channel
= efx_get_channel(efx
, skb_get_rx_queue(skb
));
673 ++channel
->rfs_filters_added
;
675 netif_info(efx
, rx_status
, efx
->net_dev
,
676 "steering %s %pI4:%u:%pI4:%u to queue %u [flow %u filter %d]\n",
677 (ip
->protocol
== IPPROTO_TCP
) ? "TCP" : "UDP",
678 &ip
->saddr
, ntohs(ports
[0]), &ip
->daddr
, ntohs(ports
[1]),
679 rxq_index
, flow_id
, rc
);
684 bool __efx_filter_rfs_expire(struct efx_nic
*efx
, unsigned quota
)
686 struct efx_filter_state
*state
= efx
->filter_state
;
687 struct efx_filter_table
*table
= &state
->table
[EFX_FILTER_TABLE_RX_IP
];
688 unsigned mask
= table
->size
- 1;
692 if (!spin_trylock_bh(&state
->lock
))
695 index
= state
->rps_expire_index
;
696 stop
= (index
+ quota
) & mask
;
698 while (index
!= stop
) {
699 if (test_bit(index
, table
->used_bitmap
) &&
700 table
->spec
[index
].priority
== EFX_FILTER_PRI_HINT
&&
701 rps_may_expire_flow(efx
->net_dev
,
702 table
->spec
[index
].dmaq_id
,
703 state
->rps_flow_id
[index
], index
)) {
704 netif_info(efx
, rx_status
, efx
->net_dev
,
705 "expiring filter %d [flow %u]\n",
706 index
, state
->rps_flow_id
[index
]);
707 efx_filter_table_clear_entry(efx
, table
, index
);
709 index
= (index
+ 1) & mask
;
712 state
->rps_expire_index
= stop
;
713 if (table
->used
== 0)
714 efx_filter_table_reset_search_depth(table
);
716 spin_unlock_bh(&state
->lock
);
720 #endif /* CONFIG_RFS_ACCEL */