summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-01-05 00:50:41 +0000
committerBen Hutchings <bhutchings@solarflare.com>2011-02-17 21:00:33 +0000
commit64d8ad6d745bbb596bfce3c5d0157267feba7e26 (patch)
tree1a3a93506dc8e851ea83bb95fe6b041bf9638110 /drivers/net/sfc/efx.h
parentd4726051043dd270f9a161414a8d5ced76e91dff (diff)
downloadop-kernel-dev-64d8ad6d745bbb596bfce3c5d0157267feba7e26.zip
op-kernel-dev-64d8ad6d745bbb596bfce3c5d0157267feba7e26.tar.gz
sfc: Implement hardware acceleration of RFS
Use the existing filter management functions to insert TCP/IPv4 and UDP/IPv4 4-tuple filters for Receive Flow Steering. For each channel, track how many RFS filters are being added during processing of received packets and scan the corresponding number of table entries for filters that may be reclaimed. Do this in batches to reduce lock overhead. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/efx.h')
-rw-r--r--drivers/net/sfc/efx.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/sfc/efx.h b/drivers/net/sfc/efx.h
index 0cb198a..cbce62b 100644
--- a/drivers/net/sfc/efx.h
+++ b/drivers/net/sfc/efx.h
@@ -76,6 +76,21 @@ extern int efx_filter_remove_filter(struct efx_nic *efx,
struct efx_filter_spec *spec);
extern void efx_filter_clear_rx(struct efx_nic *efx,
enum efx_filter_priority priority);
+#ifdef CONFIG_RFS_ACCEL
+extern int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
+ u16 rxq_index, u32 flow_id);
+extern bool __efx_filter_rfs_expire(struct efx_nic *efx, unsigned quota);
+static inline void efx_filter_rfs_expire(struct efx_channel *channel)
+{
+ if (channel->rfs_filters_added >= 60 &&
+ __efx_filter_rfs_expire(channel->efx, 100))
+ channel->rfs_filters_added -= 60;
+}
+#define efx_filter_rfs_enabled() 1
+#else
+static inline void efx_filter_rfs_expire(struct efx_channel *channel) {}
+#define efx_filter_rfs_enabled() 0
+#endif
/* Channels */
extern void efx_process_channel_now(struct efx_channel *channel);
OpenPOWER on IntegriCloud