Lines Matching refs:table
2212 efx_ef10_filter_entry_spec(const struct efx_ef10_filter_table *table, in efx_ef10_filter_entry_spec() argument
2215 return (struct efx_filter_spec *)(table->entry[filter_idx].spec & in efx_ef10_filter_entry_spec()
2220 efx_ef10_filter_entry_flags(const struct efx_ef10_filter_table *table, in efx_ef10_filter_entry_flags() argument
2223 return table->entry[filter_idx].spec & EFX_EF10_FILTER_FLAGS; in efx_ef10_filter_entry_flags()
2227 efx_ef10_filter_set_entry(struct efx_ef10_filter_table *table, in efx_ef10_filter_set_entry() argument
2232 table->entry[filter_idx].spec = (unsigned long)spec | flags; in efx_ef10_filter_set_entry()
2330 static int efx_ef10_filter_rx_match_pri(struct efx_ef10_filter_table *table, in efx_ef10_filter_rx_match_pri() argument
2336 match_pri < table->rx_match_count; in efx_ef10_filter_rx_match_pri()
2338 if (table->rx_match_flags[match_pri] == match_flags) in efx_ef10_filter_rx_match_pri()
2348 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_insert() local
2364 rc = efx_ef10_filter_rx_match_pri(table, spec->match_flags); in efx_ef10_filter_insert()
2386 saved_spec = efx_ef10_filter_entry_spec(table, i); in efx_ef10_filter_insert()
2392 if (table->entry[i].spec & in efx_ef10_filter_insert()
2437 prepare_to_wait(&table->waitq, &wait, TASK_UNINTERRUPTIBLE); in efx_ef10_filter_insert()
2448 saved_spec = efx_ef10_filter_entry_spec(table, ins_index); in efx_ef10_filter_insert()
2455 table->entry[ins_index].spec &= in efx_ef10_filter_insert()
2461 priv_flags = efx_ef10_filter_entry_flags(table, ins_index); in efx_ef10_filter_insert()
2471 efx_ef10_filter_set_entry(table, ins_index, saved_spec, in efx_ef10_filter_insert()
2481 table->entry[i].spec |= in efx_ef10_filter_insert()
2488 rc = efx_ef10_filter_push(efx, spec, &table->entry[ins_index].handle, in efx_ef10_filter_insert()
2509 efx_ef10_filter_set_entry(table, ins_index, saved_spec, priv_flags); in efx_ef10_filter_insert()
2525 saved_spec = efx_ef10_filter_entry_spec(table, i); in efx_ef10_filter_insert()
2526 priv_flags = efx_ef10_filter_entry_flags(table, i); in efx_ef10_filter_insert()
2533 table->entry[i].handle); in efx_ef10_filter_insert()
2547 efx_ef10_filter_set_entry(table, i, saved_spec, in efx_ef10_filter_insert()
2556 wake_up_all(&table->waitq); in efx_ef10_filter_insert()
2559 finish_wait(&table->waitq, &wait); in efx_ef10_filter_insert()
2578 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_remove_internal() local
2592 if (!(table->entry[filter_idx].spec & in efx_ef10_filter_remove_internal()
2595 prepare_to_wait(&table->waitq, &wait, TASK_UNINTERRUPTIBLE); in efx_ef10_filter_remove_internal()
2600 spec = efx_ef10_filter_entry_spec(table, filter_idx); in efx_ef10_filter_remove_internal()
2603 efx_ef10_filter_rx_match_pri(table, spec->match_flags) != in efx_ef10_filter_remove_internal()
2613 table->entry[filter_idx].spec &= ~EFX_EF10_FILTER_FLAG_AUTO_OLD; in efx_ef10_filter_remove_internal()
2623 table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_BUSY; in efx_ef10_filter_remove_internal()
2637 &table->entry[filter_idx].handle, in efx_ef10_filter_remove_internal()
2651 table->entry[filter_idx].handle); in efx_ef10_filter_remove_internal()
2658 efx_ef10_filter_set_entry(table, filter_idx, NULL, 0); in efx_ef10_filter_remove_internal()
2662 table->entry[filter_idx].spec &= ~EFX_EF10_FILTER_FLAG_BUSY; in efx_ef10_filter_remove_internal()
2663 wake_up_all(&table->waitq); in efx_ef10_filter_remove_internal()
2666 finish_wait(&table->waitq, &wait); in efx_ef10_filter_remove_internal()
2683 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_get_safe() local
2688 saved_spec = efx_ef10_filter_entry_spec(table, filter_idx); in efx_ef10_filter_get_safe()
2690 efx_ef10_filter_rx_match_pri(table, saved_spec->match_flags) == in efx_ef10_filter_get_safe()
2724 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_count_rx_used() local
2730 if (table->entry[filter_idx].spec && in efx_ef10_filter_count_rx_used()
2731 efx_ef10_filter_entry_spec(table, filter_idx)->priority == in efx_ef10_filter_count_rx_used()
2741 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_get_rx_id_limit() local
2743 return table->rx_match_count * HUNT_FILTER_TBL_ROWS; in efx_ef10_filter_get_rx_id_limit()
2750 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_get_rx_ids() local
2757 spec = efx_ef10_filter_entry_spec(table, filter_idx); in efx_ef10_filter_get_rx_ids()
2764 table, spec->match_flags) * in efx_ef10_filter_get_rx_ids()
2780 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_rfs_insert() local
2809 saved_spec = efx_ef10_filter_entry_spec(table, i); in efx_ef10_filter_rfs_insert()
2815 if (table->entry[i].spec & EFX_EF10_FILTER_FLAG_BUSY) { in efx_ef10_filter_rfs_insert()
2847 saved_spec = efx_ef10_filter_entry_spec(table, ins_index); in efx_ef10_filter_rfs_insert()
2858 efx_ef10_filter_set_entry(table, ins_index, saved_spec, in efx_ef10_filter_rfs_insert()
2867 table->entry[ins_index].handle, replacing); in efx_ef10_filter_rfs_insert()
2884 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_rfs_insert_complete() local
2895 spec = efx_ef10_filter_entry_spec(table, ins_index); in efx_ef10_filter_rfs_insert_complete()
2897 table->entry[ins_index].handle = in efx_ef10_filter_rfs_insert_complete()
2905 efx_ef10_filter_set_entry(table, ins_index, spec, 0); in efx_ef10_filter_rfs_insert_complete()
2908 wake_up_all(&table->waitq); in efx_ef10_filter_rfs_insert_complete()
2920 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_rfs_expire_one() local
2922 efx_ef10_filter_entry_spec(table, filter_idx); in efx_ef10_filter_rfs_expire_one()
2928 (table->entry[filter_idx].spec & EFX_EF10_FILTER_FLAG_BUSY) || in efx_ef10_filter_rfs_expire_one()
2937 table->entry[filter_idx].handle); in efx_ef10_filter_rfs_expire_one()
2942 table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_BUSY; in efx_ef10_filter_rfs_expire_one()
2952 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_rfs_expire_complete() local
2954 efx_ef10_filter_entry_spec(table, filter_idx); in efx_ef10_filter_rfs_expire_complete()
2959 efx_ef10_filter_set_entry(table, filter_idx, NULL, 0); in efx_ef10_filter_rfs_expire_complete()
2961 table->entry[filter_idx].spec &= ~EFX_EF10_FILTER_FLAG_BUSY; in efx_ef10_filter_rfs_expire_complete()
2962 wake_up_all(&table->waitq); in efx_ef10_filter_rfs_expire_complete()
3005 struct efx_ef10_filter_table *table; in efx_ef10_filter_table_probe() local
3009 table = kzalloc(sizeof(*table), GFP_KERNEL); in efx_ef10_filter_table_probe()
3010 if (!table) in efx_ef10_filter_table_probe()
3023 table->rx_match_count = 0; in efx_ef10_filter_table_probe()
3040 rc, table->rx_match_count); in efx_ef10_filter_table_probe()
3041 table->rx_match_flags[table->rx_match_count++] = rc; in efx_ef10_filter_table_probe()
3045 table->entry = vzalloc(HUNT_FILTER_TBL_ROWS * sizeof(*table->entry)); in efx_ef10_filter_table_probe()
3046 if (!table->entry) { in efx_ef10_filter_table_probe()
3051 efx->filter_state = table; in efx_ef10_filter_table_probe()
3052 init_waitqueue_head(&table->waitq); in efx_ef10_filter_table_probe()
3056 kfree(table); in efx_ef10_filter_table_probe()
3062 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_table_restore() local
3075 spec = efx_ef10_filter_entry_spec(table, filter_idx); in efx_ef10_filter_table_restore()
3079 table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_BUSY; in efx_ef10_filter_table_restore()
3083 &table->entry[filter_idx].handle, in efx_ef10_filter_table_restore()
3091 efx_ef10_filter_set_entry(table, filter_idx, NULL, 0); in efx_ef10_filter_table_restore()
3093 table->entry[filter_idx].spec &= in efx_ef10_filter_table_restore()
3109 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_table_remove() local
3116 spec = efx_ef10_filter_entry_spec(table, filter_idx); in efx_ef10_filter_table_remove()
3125 table->entry[filter_idx].handle); in efx_ef10_filter_table_remove()
3132 table->entry[filter_idx].handle); in efx_ef10_filter_table_remove()
3136 vfree(table->entry); in efx_ef10_filter_table_remove()
3137 kfree(table); in efx_ef10_filter_table_remove()
3142 struct efx_ef10_filter_table *table = efx->filter_state; in efx_ef10_filter_sync_rx_mode() local
3156 n = table->dev_uc_count < 0 ? 1 : table->dev_uc_count; in efx_ef10_filter_sync_rx_mode()
3158 filter_idx = table->dev_uc_list[i].id % HUNT_FILTER_TBL_ROWS; in efx_ef10_filter_sync_rx_mode()
3159 table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_AUTO_OLD; in efx_ef10_filter_sync_rx_mode()
3161 n = table->dev_mc_count < 0 ? 1 : table->dev_mc_count; in efx_ef10_filter_sync_rx_mode()
3163 filter_idx = table->dev_mc_list[i].id % HUNT_FILTER_TBL_ROWS; in efx_ef10_filter_sync_rx_mode()
3164 table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_AUTO_OLD; in efx_ef10_filter_sync_rx_mode()
3174 table->dev_uc_count = -1; in efx_ef10_filter_sync_rx_mode()
3176 table->dev_uc_count = 1 + netdev_uc_count(net_dev); in efx_ef10_filter_sync_rx_mode()
3177 ether_addr_copy(table->dev_uc_list[0].addr, net_dev->dev_addr); in efx_ef10_filter_sync_rx_mode()
3180 ether_addr_copy(table->dev_uc_list[i].addr, uc->addr); in efx_ef10_filter_sync_rx_mode()
3186 table->dev_mc_count = -1; in efx_ef10_filter_sync_rx_mode()
3188 table->dev_mc_count = 1 + netdev_mc_count(net_dev); in efx_ef10_filter_sync_rx_mode()
3189 eth_broadcast_addr(table->dev_mc_list[0].addr); in efx_ef10_filter_sync_rx_mode()
3192 ether_addr_copy(table->dev_mc_list[i].addr, mc->addr); in efx_ef10_filter_sync_rx_mode()
3199 if (table->dev_uc_count >= 0) { in efx_ef10_filter_sync_rx_mode()
3200 for (i = 0; i < table->dev_uc_count; i++) { in efx_ef10_filter_sync_rx_mode()
3205 table->dev_uc_list[i].addr); in efx_ef10_filter_sync_rx_mode()
3212 table->dev_uc_list[i].id); in efx_ef10_filter_sync_rx_mode()
3213 table->dev_uc_count = -1; in efx_ef10_filter_sync_rx_mode()
3216 table->dev_uc_list[i].id = rc; in efx_ef10_filter_sync_rx_mode()
3219 if (table->dev_uc_count < 0) { in efx_ef10_filter_sync_rx_mode()
3227 table->dev_uc_count = 0; in efx_ef10_filter_sync_rx_mode()
3229 table->dev_uc_list[0].id = rc; in efx_ef10_filter_sync_rx_mode()
3234 if (table->dev_mc_count >= 0) { in efx_ef10_filter_sync_rx_mode()
3235 for (i = 0; i < table->dev_mc_count; i++) { in efx_ef10_filter_sync_rx_mode()
3240 table->dev_mc_list[i].addr); in efx_ef10_filter_sync_rx_mode()
3247 table->dev_mc_list[i].id); in efx_ef10_filter_sync_rx_mode()
3248 table->dev_mc_count = -1; in efx_ef10_filter_sync_rx_mode()
3251 table->dev_mc_list[i].id = rc; in efx_ef10_filter_sync_rx_mode()
3254 if (table->dev_mc_count < 0) { in efx_ef10_filter_sync_rx_mode()
3262 table->dev_mc_count = 0; in efx_ef10_filter_sync_rx_mode()
3264 table->dev_mc_list[0].id = rc; in efx_ef10_filter_sync_rx_mode()
3274 if (ACCESS_ONCE(table->entry[i].spec) & in efx_ef10_filter_sync_rx_mode()