diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2013-11-21 14:02:18 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2013-12-12 17:07:22 -0500 |
commit | 7665d1abea22cb44d4f0bac99e77275eba39bbf1 (patch) | |
tree | b50444ccc9597cff1871e7c0e04f890f8a85b247 | |
parent | d43050c0c7d930cdeb10fb9201d9e2d005cef02a (diff) |
sfc: Change priority and flags for automatic MAC filters
MAC filters inserted automatically by the driver, based on the device
address list (EF10) or no-match filters (Siena), should be overridable
at MANUAL or REQUIRED priority. Currently they themselves have
REQUIRED priority and this requires some odd special-casing.
We also can't reliably tell whether such a MAC filter has or has
not been overridden. We just remember that it is wanted by the
stack (RX_STACK flag).
Add another priority level, AUTO, between HINT and MANUAL, and
use this for the automatic filters while they have not been
overridden. Remove the RX_STACK flag. Add an RX_OVER_AUTO
flag which is set only when an AUTO filter has been overridden
(or was requested to be inserted while a higher-priority filter
existed).
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 73 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/efx.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/farch.c | 28 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/filter.h | 17 |
4 files changed, 67 insertions, 54 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 137c46b4b405..e5eeac9063d2 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -2341,10 +2341,7 @@ static s32 efx_ef10_filter_insert(struct efx_nic *efx, | |||
2341 | EFX_EF10_FILTER_FLAG_BUSY) | 2341 | EFX_EF10_FILTER_FLAG_BUSY) |
2342 | break; | 2342 | break; |
2343 | if (spec->priority < saved_spec->priority && | 2343 | if (spec->priority < saved_spec->priority && |
2344 | !(saved_spec->priority == | 2344 | spec->priority != EFX_FILTER_PRI_AUTO) { |
2345 | EFX_FILTER_PRI_REQUIRED && | ||
2346 | saved_spec->flags & | ||
2347 | EFX_FILTER_FLAG_RX_STACK)) { | ||
2348 | rc = -EPERM; | 2345 | rc = -EPERM; |
2349 | goto out_unlock; | 2346 | goto out_unlock; |
2350 | } | 2347 | } |
@@ -2398,9 +2395,11 @@ found: | |||
2398 | */ | 2395 | */ |
2399 | saved_spec = efx_ef10_filter_entry_spec(table, ins_index); | 2396 | saved_spec = efx_ef10_filter_entry_spec(table, ins_index); |
2400 | if (saved_spec) { | 2397 | if (saved_spec) { |
2401 | if (spec->flags & EFX_FILTER_FLAG_RX_STACK) { | 2398 | if (spec->priority == EFX_FILTER_PRI_AUTO && |
2399 | saved_spec->priority >= EFX_FILTER_PRI_AUTO) { | ||
2402 | /* Just make sure it won't be removed */ | 2400 | /* Just make sure it won't be removed */ |
2403 | saved_spec->flags |= EFX_FILTER_FLAG_RX_STACK; | 2401 | if (saved_spec->priority > EFX_FILTER_PRI_AUTO) |
2402 | saved_spec->flags |= EFX_FILTER_FLAG_RX_OVER_AUTO; | ||
2404 | table->entry[ins_index].spec &= | 2403 | table->entry[ins_index].spec &= |
2405 | ~EFX_EF10_FILTER_FLAG_STACK_OLD; | 2404 | ~EFX_EF10_FILTER_FLAG_STACK_OLD; |
2406 | rc = ins_index; | 2405 | rc = ins_index; |
@@ -2442,8 +2441,11 @@ found: | |||
2442 | if (rc == 0) { | 2441 | if (rc == 0) { |
2443 | if (replacing) { | 2442 | if (replacing) { |
2444 | /* Update the fields that may differ */ | 2443 | /* Update the fields that may differ */ |
2444 | if (saved_spec->priority == EFX_FILTER_PRI_AUTO) | ||
2445 | saved_spec->flags |= | ||
2446 | EFX_FILTER_FLAG_RX_OVER_AUTO; | ||
2445 | saved_spec->priority = spec->priority; | 2447 | saved_spec->priority = spec->priority; |
2446 | saved_spec->flags &= EFX_FILTER_FLAG_RX_STACK; | 2448 | saved_spec->flags &= EFX_FILTER_FLAG_RX_OVER_AUTO; |
2447 | saved_spec->flags |= spec->flags; | 2449 | saved_spec->flags |= spec->flags; |
2448 | saved_spec->rss_context = spec->rss_context; | 2450 | saved_spec->rss_context = spec->rss_context; |
2449 | saved_spec->dmaq_id = spec->dmaq_id; | 2451 | saved_spec->dmaq_id = spec->dmaq_id; |
@@ -2542,26 +2544,41 @@ static int efx_ef10_filter_remove_internal(struct efx_nic *efx, | |||
2542 | spin_unlock_bh(&efx->filter_lock); | 2544 | spin_unlock_bh(&efx->filter_lock); |
2543 | schedule(); | 2545 | schedule(); |
2544 | } | 2546 | } |
2547 | |||
2545 | spec = efx_ef10_filter_entry_spec(table, filter_idx); | 2548 | spec = efx_ef10_filter_entry_spec(table, filter_idx); |
2546 | if (!spec || spec->priority > priority || | 2549 | if (!spec || |
2547 | (!stack_requested && | 2550 | (!stack_requested && |
2548 | efx_ef10_filter_rx_match_pri(table, spec->match_flags) != | 2551 | efx_ef10_filter_rx_match_pri(table, spec->match_flags) != |
2549 | filter_id / HUNT_FILTER_TBL_ROWS)) { | 2552 | filter_id / HUNT_FILTER_TBL_ROWS)) { |
2550 | rc = -ENOENT; | 2553 | rc = -ENOENT; |
2551 | goto out_unlock; | 2554 | goto out_unlock; |
2552 | } | 2555 | } |
2556 | |||
2557 | if (spec->flags & EFX_FILTER_FLAG_RX_OVER_AUTO && | ||
2558 | priority == EFX_FILTER_PRI_AUTO) { | ||
2559 | /* Just remove flags */ | ||
2560 | spec->flags &= ~EFX_FILTER_FLAG_RX_OVER_AUTO; | ||
2561 | table->entry[filter_idx].spec &= ~EFX_EF10_FILTER_FLAG_STACK_OLD; | ||
2562 | rc = 0; | ||
2563 | goto out_unlock; | ||
2564 | } | ||
2565 | |||
2566 | if (spec->priority > priority) { | ||
2567 | rc = -ENOENT; | ||
2568 | goto out_unlock; | ||
2569 | } | ||
2570 | |||
2553 | table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_BUSY; | 2571 | table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_BUSY; |
2554 | spin_unlock_bh(&efx->filter_lock); | 2572 | spin_unlock_bh(&efx->filter_lock); |
2555 | 2573 | ||
2556 | if (spec->flags & EFX_FILTER_FLAG_RX_STACK && !stack_requested) { | 2574 | if (spec->flags & EFX_FILTER_FLAG_RX_OVER_AUTO) { |
2557 | /* Reset steering of a stack-owned filter */ | 2575 | /* Reset steering of a stack-owned filter */ |
2558 | 2576 | ||
2559 | struct efx_filter_spec new_spec = *spec; | 2577 | struct efx_filter_spec new_spec = *spec; |
2560 | 2578 | ||
2561 | new_spec.priority = EFX_FILTER_PRI_REQUIRED; | 2579 | new_spec.priority = EFX_FILTER_PRI_AUTO; |
2562 | new_spec.flags = (EFX_FILTER_FLAG_RX | | 2580 | new_spec.flags = (EFX_FILTER_FLAG_RX | |
2563 | EFX_FILTER_FLAG_RX_RSS | | 2581 | EFX_FILTER_FLAG_RX_RSS); |
2564 | EFX_FILTER_FLAG_RX_STACK); | ||
2565 | new_spec.dmaq_id = 0; | 2582 | new_spec.dmaq_id = 0; |
2566 | new_spec.rss_context = EFX_FILTER_RSS_CONTEXT_DEFAULT; | 2583 | new_spec.rss_context = EFX_FILTER_RSS_CONTEXT_DEFAULT; |
2567 | rc = efx_ef10_filter_push(efx, &new_spec, | 2584 | rc = efx_ef10_filter_push(efx, &new_spec, |
@@ -2589,6 +2606,7 @@ static int efx_ef10_filter_remove_internal(struct efx_nic *efx, | |||
2589 | efx_ef10_filter_set_entry(table, filter_idx, NULL, 0); | 2606 | efx_ef10_filter_set_entry(table, filter_idx, NULL, 0); |
2590 | } | 2607 | } |
2591 | } | 2608 | } |
2609 | |||
2592 | table->entry[filter_idx].spec &= ~EFX_EF10_FILTER_FLAG_BUSY; | 2610 | table->entry[filter_idx].spec &= ~EFX_EF10_FILTER_FLAG_BUSY; |
2593 | wake_up_all(&table->waitq); | 2611 | wake_up_all(&table->waitq); |
2594 | out_unlock: | 2612 | out_unlock: |
@@ -2731,8 +2749,6 @@ static s32 efx_ef10_filter_rfs_insert(struct efx_nic *efx, | |||
2731 | rc = -EBUSY; | 2749 | rc = -EBUSY; |
2732 | goto fail_unlock; | 2750 | goto fail_unlock; |
2733 | } | 2751 | } |
2734 | EFX_WARN_ON_PARANOID(saved_spec->flags & | ||
2735 | EFX_FILTER_FLAG_RX_STACK); | ||
2736 | if (spec->priority < saved_spec->priority) { | 2752 | if (spec->priority < saved_spec->priority) { |
2737 | rc = -EPERM; | 2753 | rc = -EPERM; |
2738 | goto fail_unlock; | 2754 | goto fail_unlock; |
@@ -3118,9 +3134,8 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) | |||
3118 | /* Insert/renew unicast filters */ | 3134 | /* Insert/renew unicast filters */ |
3119 | if (table->stack_uc_count >= 0) { | 3135 | if (table->stack_uc_count >= 0) { |
3120 | for (i = 0; i < table->stack_uc_count; i++) { | 3136 | for (i = 0; i < table->stack_uc_count; i++) { |
3121 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_REQUIRED, | 3137 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, |
3122 | EFX_FILTER_FLAG_RX_RSS | | 3138 | EFX_FILTER_FLAG_RX_RSS, |
3123 | EFX_FILTER_FLAG_RX_STACK, | ||
3124 | 0); | 3139 | 0); |
3125 | efx_filter_set_eth_local(&spec, EFX_FILTER_VID_UNSPEC, | 3140 | efx_filter_set_eth_local(&spec, EFX_FILTER_VID_UNSPEC, |
3126 | table->stack_uc_list[i].addr); | 3141 | table->stack_uc_list[i].addr); |
@@ -3129,7 +3144,7 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) | |||
3129 | /* Fall back to unicast-promisc */ | 3144 | /* Fall back to unicast-promisc */ |
3130 | while (i--) | 3145 | while (i--) |
3131 | efx_ef10_filter_remove_safe( | 3146 | efx_ef10_filter_remove_safe( |
3132 | efx, EFX_FILTER_PRI_REQUIRED, | 3147 | efx, EFX_FILTER_PRI_AUTO, |
3133 | table->stack_uc_list[i].id); | 3148 | table->stack_uc_list[i].id); |
3134 | table->stack_uc_count = -1; | 3149 | table->stack_uc_count = -1; |
3135 | break; | 3150 | break; |
@@ -3138,9 +3153,8 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) | |||
3138 | } | 3153 | } |
3139 | } | 3154 | } |
3140 | if (table->stack_uc_count < 0) { | 3155 | if (table->stack_uc_count < 0) { |
3141 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_REQUIRED, | 3156 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, |
3142 | EFX_FILTER_FLAG_RX_RSS | | 3157 | EFX_FILTER_FLAG_RX_RSS, |
3143 | EFX_FILTER_FLAG_RX_STACK, | ||
3144 | 0); | 3158 | 0); |
3145 | efx_filter_set_uc_def(&spec); | 3159 | efx_filter_set_uc_def(&spec); |
3146 | rc = efx_ef10_filter_insert(efx, &spec, true); | 3160 | rc = efx_ef10_filter_insert(efx, &spec, true); |
@@ -3155,9 +3169,8 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) | |||
3155 | /* Insert/renew multicast filters */ | 3169 | /* Insert/renew multicast filters */ |
3156 | if (table->stack_mc_count >= 0) { | 3170 | if (table->stack_mc_count >= 0) { |
3157 | for (i = 0; i < table->stack_mc_count; i++) { | 3171 | for (i = 0; i < table->stack_mc_count; i++) { |
3158 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_REQUIRED, | 3172 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, |
3159 | EFX_FILTER_FLAG_RX_RSS | | 3173 | EFX_FILTER_FLAG_RX_RSS, |
3160 | EFX_FILTER_FLAG_RX_STACK, | ||
3161 | 0); | 3174 | 0); |
3162 | efx_filter_set_eth_local(&spec, EFX_FILTER_VID_UNSPEC, | 3175 | efx_filter_set_eth_local(&spec, EFX_FILTER_VID_UNSPEC, |
3163 | table->stack_mc_list[i].addr); | 3176 | table->stack_mc_list[i].addr); |
@@ -3166,7 +3179,7 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) | |||
3166 | /* Fall back to multicast-promisc */ | 3179 | /* Fall back to multicast-promisc */ |
3167 | while (i--) | 3180 | while (i--) |
3168 | efx_ef10_filter_remove_safe( | 3181 | efx_ef10_filter_remove_safe( |
3169 | efx, EFX_FILTER_PRI_REQUIRED, | 3182 | efx, EFX_FILTER_PRI_AUTO, |
3170 | table->stack_mc_list[i].id); | 3183 | table->stack_mc_list[i].id); |
3171 | table->stack_mc_count = -1; | 3184 | table->stack_mc_count = -1; |
3172 | break; | 3185 | break; |
@@ -3175,9 +3188,8 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) | |||
3175 | } | 3188 | } |
3176 | } | 3189 | } |
3177 | if (table->stack_mc_count < 0) { | 3190 | if (table->stack_mc_count < 0) { |
3178 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_REQUIRED, | 3191 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, |
3179 | EFX_FILTER_FLAG_RX_RSS | | 3192 | EFX_FILTER_FLAG_RX_RSS, |
3180 | EFX_FILTER_FLAG_RX_STACK, | ||
3181 | 0); | 3193 | 0); |
3182 | efx_filter_set_mc_def(&spec); | 3194 | efx_filter_set_mc_def(&spec); |
3183 | rc = efx_ef10_filter_insert(efx, &spec, true); | 3195 | rc = efx_ef10_filter_insert(efx, &spec, true); |
@@ -3197,9 +3209,8 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) | |||
3197 | for (i = 0; i < HUNT_FILTER_TBL_ROWS; i++) { | 3209 | for (i = 0; i < HUNT_FILTER_TBL_ROWS; i++) { |
3198 | if (ACCESS_ONCE(table->entry[i].spec) & | 3210 | if (ACCESS_ONCE(table->entry[i].spec) & |
3199 | EFX_EF10_FILTER_FLAG_STACK_OLD) { | 3211 | EFX_EF10_FILTER_FLAG_STACK_OLD) { |
3200 | if (efx_ef10_filter_remove_internal(efx, | 3212 | if (efx_ef10_filter_remove_internal( |
3201 | EFX_FILTER_PRI_REQUIRED, | 3213 | efx, EFX_FILTER_PRI_AUTO, i, true) < 0) |
3202 | i, true) < 0) | ||
3203 | remove_failed = true; | 3214 | remove_failed = true; |
3204 | } | 3215 | } |
3205 | } | 3216 | } |
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h index a653786fbbe7..3a67030c73ea 100644 --- a/drivers/net/ethernet/sfc/efx.h +++ b/drivers/net/ethernet/sfc/efx.h | |||
@@ -138,6 +138,9 @@ efx_filter_get_filter_safe(struct efx_nic *efx, | |||
138 | * efx_farch_filter_clear_rx - remove RX filters by priority | 138 | * efx_farch_filter_clear_rx - remove RX filters by priority |
139 | * @efx: NIC from which to remove the filters | 139 | * @efx: NIC from which to remove the filters |
140 | * @priority: Maximum priority to remove | 140 | * @priority: Maximum priority to remove |
141 | * | ||
142 | * Remove all RX filters whose priority is less than or equal to the | ||
143 | * given @priority and is not %EFX_FILTER_PRI_AUTO. | ||
141 | */ | 144 | */ |
142 | static inline void efx_filter_clear_rx(struct efx_nic *efx, | 145 | static inline void efx_filter_clear_rx(struct efx_nic *efx, |
143 | enum efx_filter_priority priority) | 146 | enum efx_filter_priority priority) |
diff --git a/drivers/net/ethernet/sfc/farch.c b/drivers/net/ethernet/sfc/farch.c index 4c64ad7c9200..fbd923ddf546 100644 --- a/drivers/net/ethernet/sfc/farch.c +++ b/drivers/net/ethernet/sfc/farch.c | |||
@@ -2190,8 +2190,8 @@ efx_farch_filter_init_rx_for_stack(struct efx_nic *efx, | |||
2190 | /* If there's only one channel then disable RSS for non VF | 2190 | /* If there's only one channel then disable RSS for non VF |
2191 | * traffic, thereby allowing VFs to use RSS when the PF can't. | 2191 | * traffic, thereby allowing VFs to use RSS when the PF can't. |
2192 | */ | 2192 | */ |
2193 | spec->priority = EFX_FILTER_PRI_REQUIRED; | 2193 | spec->priority = EFX_FILTER_PRI_AUTO; |
2194 | spec->flags = (EFX_FILTER_FLAG_RX | EFX_FILTER_FLAG_RX_STACK | | 2194 | spec->flags = (EFX_FILTER_FLAG_RX | |
2195 | (efx->n_rx_channels > 1 ? EFX_FILTER_FLAG_RX_RSS : 0) | | 2195 | (efx->n_rx_channels > 1 ? EFX_FILTER_FLAG_RX_RSS : 0) | |
2196 | (efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0)); | 2196 | (efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0)); |
2197 | spec->dmaq_id = 0; | 2197 | spec->dmaq_id = 0; |
@@ -2456,20 +2456,13 @@ s32 efx_farch_filter_insert(struct efx_nic *efx, | |||
2456 | rc = -EEXIST; | 2456 | rc = -EEXIST; |
2457 | goto out; | 2457 | goto out; |
2458 | } | 2458 | } |
2459 | if (spec.priority < saved_spec->priority && | 2459 | if (spec.priority < saved_spec->priority) { |
2460 | !(saved_spec->priority == EFX_FILTER_PRI_REQUIRED && | ||
2461 | saved_spec->flags & EFX_FILTER_FLAG_RX_STACK)) { | ||
2462 | rc = -EPERM; | 2460 | rc = -EPERM; |
2463 | goto out; | 2461 | goto out; |
2464 | } | 2462 | } |
2465 | if (spec.flags & EFX_FILTER_FLAG_RX_STACK) { | 2463 | if (saved_spec->priority == EFX_FILTER_PRI_AUTO || |
2466 | /* Just make sure it won't be removed */ | 2464 | saved_spec->flags & EFX_FILTER_FLAG_RX_OVER_AUTO) |
2467 | saved_spec->flags |= EFX_FILTER_FLAG_RX_STACK; | 2465 | spec.flags |= EFX_FILTER_FLAG_RX_OVER_AUTO; |
2468 | rc = 0; | ||
2469 | goto out; | ||
2470 | } | ||
2471 | /* Retain the RX_STACK flag */ | ||
2472 | spec.flags |= saved_spec->flags & EFX_FILTER_FLAG_RX_STACK; | ||
2473 | } | 2466 | } |
2474 | 2467 | ||
2475 | /* Insert the filter */ | 2468 | /* Insert the filter */ |
@@ -2553,7 +2546,7 @@ static int efx_farch_filter_remove(struct efx_nic *efx, | |||
2553 | spec->priority > priority) | 2546 | spec->priority > priority) |
2554 | return -ENOENT; | 2547 | return -ENOENT; |
2555 | 2548 | ||
2556 | if (spec->flags & EFX_FILTER_FLAG_RX_STACK) { | 2549 | if (spec->flags & EFX_FILTER_FLAG_RX_OVER_AUTO) { |
2557 | efx_farch_filter_init_rx_for_stack(efx, spec); | 2550 | efx_farch_filter_init_rx_for_stack(efx, spec); |
2558 | efx_farch_filter_push_rx_config(efx); | 2551 | efx_farch_filter_push_rx_config(efx); |
2559 | } else { | 2552 | } else { |
@@ -2637,8 +2630,11 @@ efx_farch_filter_table_clear(struct efx_nic *efx, | |||
2637 | unsigned int filter_idx; | 2630 | unsigned int filter_idx; |
2638 | 2631 | ||
2639 | spin_lock_bh(&efx->filter_lock); | 2632 | spin_lock_bh(&efx->filter_lock); |
2640 | for (filter_idx = 0; filter_idx < table->size; ++filter_idx) | 2633 | for (filter_idx = 0; filter_idx < table->size; ++filter_idx) { |
2641 | efx_farch_filter_remove(efx, table, filter_idx, priority); | 2634 | if (table->spec[filter_idx].priority != EFX_FILTER_PRI_AUTO) |
2635 | efx_farch_filter_remove(efx, table, | ||
2636 | filter_idx, priority); | ||
2637 | } | ||
2642 | spin_unlock_bh(&efx->filter_lock); | 2638 | spin_unlock_bh(&efx->filter_lock); |
2643 | } | 2639 | } |
2644 | 2640 | ||
diff --git a/drivers/net/ethernet/sfc/filter.h b/drivers/net/ethernet/sfc/filter.h index 63c77a557178..3ef298d3c47e 100644 --- a/drivers/net/ethernet/sfc/filter.h +++ b/drivers/net/ethernet/sfc/filter.h | |||
@@ -59,12 +59,16 @@ enum efx_filter_match_flags { | |||
59 | /** | 59 | /** |
60 | * enum efx_filter_priority - priority of a hardware filter specification | 60 | * enum efx_filter_priority - priority of a hardware filter specification |
61 | * @EFX_FILTER_PRI_HINT: Performance hint | 61 | * @EFX_FILTER_PRI_HINT: Performance hint |
62 | * @EFX_FILTER_PRI_AUTO: Automatic filter based on device address list | ||
63 | * or hardware requirements. This may only be used by the filter | ||
64 | * implementation for each NIC type. | ||
62 | * @EFX_FILTER_PRI_MANUAL: Manually configured filter | 65 | * @EFX_FILTER_PRI_MANUAL: Manually configured filter |
63 | * @EFX_FILTER_PRI_REQUIRED: Required for correct behaviour (user-level | 66 | * @EFX_FILTER_PRI_REQUIRED: Required for correct behaviour (user-level |
64 | * networking and SR-IOV) | 67 | * networking and SR-IOV) |
65 | */ | 68 | */ |
66 | enum efx_filter_priority { | 69 | enum efx_filter_priority { |
67 | EFX_FILTER_PRI_HINT = 0, | 70 | EFX_FILTER_PRI_HINT = 0, |
71 | EFX_FILTER_PRI_AUTO, | ||
68 | EFX_FILTER_PRI_MANUAL, | 72 | EFX_FILTER_PRI_MANUAL, |
69 | EFX_FILTER_PRI_REQUIRED, | 73 | EFX_FILTER_PRI_REQUIRED, |
70 | }; | 74 | }; |
@@ -78,19 +82,18 @@ enum efx_filter_priority { | |||
78 | * according to the indirection table. | 82 | * according to the indirection table. |
79 | * @EFX_FILTER_FLAG_RX_SCATTER: Enable DMA scatter on the receiving | 83 | * @EFX_FILTER_FLAG_RX_SCATTER: Enable DMA scatter on the receiving |
80 | * queue. | 84 | * queue. |
81 | * @EFX_FILTER_FLAG_RX_STACK: Indicates a filter inserted for the | 85 | * @EFX_FILTER_FLAG_RX_OVER_AUTO: Indicates a filter that is |
82 | * network stack. The filter must have a priority of | 86 | * overriding an automatic filter (priority |
83 | * %EFX_FILTER_PRI_REQUIRED. It can be steered by a replacement | 87 | * %EFX_FILTER_PRI_AUTO). This may only be set by the filter |
84 | * request with priority %EFX_FILTER_PRI_MANUAL, and a removal | 88 | * implementation for each type. A removal request will restore |
85 | * request with priority %EFX_FILTER_PRI_MANUAL will reset the | 89 | * the automatic filter in its place. |
86 | * steering (but not remove the filter). | ||
87 | * @EFX_FILTER_FLAG_RX: Filter is for RX | 90 | * @EFX_FILTER_FLAG_RX: Filter is for RX |
88 | * @EFX_FILTER_FLAG_TX: Filter is for TX | 91 | * @EFX_FILTER_FLAG_TX: Filter is for TX |
89 | */ | 92 | */ |
90 | enum efx_filter_flags { | 93 | enum efx_filter_flags { |
91 | EFX_FILTER_FLAG_RX_RSS = 0x01, | 94 | EFX_FILTER_FLAG_RX_RSS = 0x01, |
92 | EFX_FILTER_FLAG_RX_SCATTER = 0x02, | 95 | EFX_FILTER_FLAG_RX_SCATTER = 0x02, |
93 | EFX_FILTER_FLAG_RX_STACK = 0x04, | 96 | EFX_FILTER_FLAG_RX_OVER_AUTO = 0x04, |
94 | EFX_FILTER_FLAG_RX = 0x08, | 97 | EFX_FILTER_FLAG_RX = 0x08, |
95 | EFX_FILTER_FLAG_TX = 0x10, | 98 | EFX_FILTER_FLAG_TX = 0x10, |
96 | }; | 99 | }; |