Skip to content

Commit

Permalink
RPS: Ensure that an expired hardware filter can be re-added later
Browse files Browse the repository at this point in the history
Amir Vadai wrote:
> When a stream is paused, and its rule is expired while it is paused,
> no new rule will be configured to the HW when traffic resume.
[...]
> - When stream was resumed, traffic was steered again by RSS, and
> because current-cpu was equal to desired-cpu,  ndo_rx_flow_steer
> wasn't called and no rule was configured to the HW.

Fix this by setting the flow's current CPU only in the table for the
newly selected RX queue.

Reported-and-tested-by: Amir Vadai <amirv@dev.mellanox.co.il>
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 Oct 3, 2011
1 parent 76231e0 commit 09994d1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2670,10 +2670,7 @@ static struct rps_dev_flow *
set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
struct rps_dev_flow *rflow, u16 next_cpu)
{
u16 tcpu;

tcpu = rflow->cpu = next_cpu;
if (tcpu != RPS_NO_CPU) {
if (next_cpu != RPS_NO_CPU) {
#ifdef CONFIG_RFS_ACCEL
struct netdev_rx_queue *rxqueue;
struct rps_dev_flow_table *flow_table;
Expand Down Expand Up @@ -2701,16 +2698,16 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
goto out;
old_rflow = rflow;
rflow = &flow_table->flows[flow_id];
rflow->cpu = next_cpu;
rflow->filter = rc;
if (old_rflow->filter == rflow->filter)
old_rflow->filter = RPS_NO_FILTER;
out:
#endif
rflow->last_qtail =
per_cpu(softnet_data, tcpu).input_queue_head;
per_cpu(softnet_data, next_cpu).input_queue_head;
}

rflow->cpu = next_cpu;
return rflow;
}

Expand Down

0 comments on commit 09994d1

Please sign in to comment.