Skip to content

Commit

Permalink
sfc: Add filter table management
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Sep 21, 2010
1 parent a77f5db commit 64eebcf
Show file tree
Hide file tree
Showing 7 changed files with 678 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/sfc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sfc-y += efx.o nic.o falcon.o siena.o tx.o rx.o \
sfc-y += efx.o nic.o falcon.o siena.o tx.o rx.o filter.o \
falcon_gmac.o falcon_xmac.o mcdi_mac.o \
selftest.o ethtool.o qt202x_phy.o mdio_10g.o \
tenxpress.o falcon_boards.o mcdi.o mcdi_phy.o
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,8 +1357,17 @@ static int efx_probe_all(struct efx_nic *efx)
if (rc)
goto fail3;

rc = efx_probe_filters(efx);
if (rc) {
netif_err(efx, probe, efx->net_dev,
"failed to create filter tables\n");
goto fail4;
}

return 0;

fail4:
efx_remove_channels(efx);
fail3:
efx_remove_port(efx);
fail2:
Expand Down Expand Up @@ -1489,6 +1498,7 @@ static void efx_stop_all(struct efx_nic *efx)

static void efx_remove_all(struct efx_nic *efx)
{
efx_remove_filters(efx);
efx_remove_channels(efx);
efx_remove_port(efx);
efx_remove_nic(efx);
Expand Down Expand Up @@ -2002,6 +2012,7 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
efx->mac_op->reconfigure(efx);

efx_init_channels(efx);
efx_restore_filters(efx);

mutex_unlock(&efx->spi_lock);
mutex_unlock(&efx->mac_lock);
Expand Down
14 changes: 14 additions & 0 deletions drivers/net/sfc/efx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define EFX_EFX_H

#include "net_driver.h"
#include "filter.h"

/* PCI IDs */
#define EFX_VENDID_SFC 0x1924
Expand Down Expand Up @@ -64,6 +65,19 @@ extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue);
* skb. Falcon/A1 may require up to three descriptors per skb_frag. */
#define EFX_MIN_RING_SIZE (roundup_pow_of_two(2 * 3 * MAX_SKB_FRAGS))

/* Filters */
extern int efx_probe_filters(struct efx_nic *efx);
extern void efx_restore_filters(struct efx_nic *efx);
extern void efx_remove_filters(struct efx_nic *efx);
extern int efx_filter_insert_filter(struct efx_nic *efx,
struct efx_filter_spec *spec,
bool replace);
extern int efx_filter_remove_filter(struct efx_nic *efx,
struct efx_filter_spec *spec);
extern void efx_filter_table_clear(struct efx_nic *efx,
enum efx_filter_table_id table_id,
enum efx_filter_priority priority);

/* Channels */
extern void efx_process_channel_now(struct efx_channel *channel);
extern int
Expand Down
Loading

0 comments on commit 64eebcf

Please sign in to comment.