Skip to content

Commit bbfd98d

Browse files
committed
onload_mktest_net_driver: Replacing net driver with fb8cb83f136caf82a47e32a57a5d1d8d437c641d
1 parent 5fa6593 commit bbfd98d

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

src/driver/linux_net/drivers/net/ethernet/sfc/ef10.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3909,11 +3909,13 @@ static int efx_ef10_ev_process(struct efx_channel *channel, int quota)
39093909
efx_qword_t event, *p_event, *cl_base, *old_cl_base = NULL;
39103910
bool fresh = false;
39113911
unsigned int read_ptr, cr_ptr;
3912+
unsigned int wrap_ptr;
39123913
int ev_code;
39133914
int spent = 0;
39143915
int rc;
39153916

39163917
read_ptr = channel->eventq_read_ptr;
3918+
wrap_ptr = read_ptr & channel->eventq_mask;
39173919

39183920
EFX_WARN_ON_ONCE_PARANOID(!IS_ALIGNED((uintptr_t)channel->eventq.addr,
39193921
L1_CACHE_BYTES));
@@ -4013,6 +4015,17 @@ static int efx_ef10_ev_process(struct efx_channel *channel, int quota)
40134015
channel->channel, ev_code,
40144016
EFX_QWORD_VAL(event));
40154017
}
4018+
if ((read_ptr & channel->eventq_mask) == wrap_ptr) {
4019+
/* We have consumed an entire ring's worth of events,
4020+
* probably scrambling to keep up with TX completions,
4021+
* without seeing enough RX to spend our budget.
4022+
* Finish this NAPI poll here, reporting the budget as
4023+
* fully spent, so that the core can reschedule before
4024+
* calling us again.
4025+
*/
4026+
spent = quota;
4027+
goto out;
4028+
}
40164029
}
40174030

40184031
out:

src/driver/linux_net/drivers/net/ethernet/sfc/net_driver.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
**************************************************************************/
9393

9494
#ifdef EFX_NOT_UPSTREAM
95-
#define EFX_DRIVER_VERSION "6.1.0.1007"
95+
#define EFX_DRIVER_VERSION "6.1.0.1008"
9696
#endif
9797

9898
#ifdef DEBUG
@@ -1309,13 +1309,15 @@ struct efx_arfs_rule {
13091309
/**
13101310
* struct efx_async_filter_insertion - Request to asynchronously insert a filter
13111311
* @net_dev: Reference to the netdevice
1312+
* @net_dev_tracker: reference tracker entry for @net_dev
13121313
* @spec: The filter to insert
13131314
* @work: Workitem for this request
13141315
* @rxq_index: Identifies the channel for which this request was made
13151316
* @flow_id: Identifies the kernel-side flow for which this request was made
13161317
*/
13171318
struct efx_async_filter_insertion {
13181319
struct net_device *net_dev;
1320+
netdevice_tracker net_dev_tracker;
13191321
struct efx_filter_spec spec;
13201322
struct work_struct work;
13211323
u16 rxq_index;

src/driver/linux_net/drivers/net/ethernet/sfc/rx_common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ static void efx_filter_rfs_work(struct work_struct *data)
18451845

18461846
/* Release references */
18471847
clear_bit(slot_idx, &efx->rps_slot_map);
1848-
dev_put(req->net_dev);
1848+
netdev_put(req->net_dev, &req->net_dev_tracker);
18491849

18501850
return;
18511851
}
@@ -1908,7 +1908,8 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
19081908
}
19091909

19101910
/* Queue the request */
1911-
dev_hold(req->net_dev = net_dev);
1911+
req->net_dev = net_dev;
1912+
netdev_hold(req->net_dev, &req->net_dev_tracker, GFP_ATOMIC);
19121913
INIT_WORK(&req->work, efx_filter_rfs_work);
19131914
req->rxq_index = rxq_index;
19141915
req->flow_id = flow_id;
@@ -1965,4 +1966,3 @@ bool __efx_filter_rfs_expire(struct efx_channel *channel, unsigned int quota)
19651966
}
19661967

19671968
#endif /* CONFIG_RFS_ACCEL */
1968-

src/driver/linux_net/drivers/net/ethernet/sfc/tc_encap_actions.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ static int efx_bind_neigh(struct efx_nic *efx,
209209
EFX_TC_ERR_MSG(efx, extack, "Failed to lookup route for encap");
210210
goto out_free;
211211
}
212-
dev_hold(neigh->egdev = dst->dev);
212+
netdev_hold(neigh->egdev = dst->dev, &neigh->dev_tracker,
213+
GFP_KERNEL_ACCOUNT);
213214
neigh->ttl = ip6_dst_hoplimit(dst);
214215
n = dst_neigh_lookup(dst, &flow6.daddr);
215216
dst_release(dst);
@@ -223,7 +224,8 @@ static int efx_bind_neigh(struct efx_nic *efx,
223224
EFX_TC_ERR_MSG(efx, extack, "Failed to lookup route for encap");
224225
goto out_free;
225226
}
226-
dev_hold(neigh->egdev = rt->dst.dev);
227+
netdev_hold(neigh->egdev = rt->dst.dev, &neigh->dev_tracker,
228+
GFP_KERNEL_ACCOUNT);
227229
neigh->ttl = ip4_dst_hoplimit(&rt->dst);
228230
n = dst_neigh_lookup(&rt->dst, &flow4.daddr);
229231
ip_rt_put(rt);
@@ -233,7 +235,7 @@ static int efx_bind_neigh(struct efx_nic *efx,
233235
if (!n) {
234236
rc = -ENETUNREACH;
235237
EFX_TC_ERR_MSG(efx, extack, "Failed to lookup neighbour for encap");
236-
dev_put(neigh->egdev);
238+
netdev_put(neigh->egdev, &neigh->dev_tracker);
237239
goto out_free;
238240
}
239241
refcount_set(&neigh->ref, 1);
@@ -273,7 +275,7 @@ static void efx_free_neigh(struct efx_neigh_binder *neigh)
273275
rhashtable_remove_fast(&efx->tc->neigh_ht, &neigh->linkage,
274276
efx_neigh_ht_params);
275277
synchronize_rcu();
276-
dev_put(neigh->egdev);
278+
netdev_put(neigh->egdev, &neigh->dev_tracker);
277279
put_net(neigh->net);
278280
kfree(neigh);
279281
}

src/driver/linux_net/drivers/net/ethernet/sfc/tc_encap_actions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* @ttl: Time To Live associated with the route used
2727
* @dying: set when egdev is going away, to skip further updates
2828
* @egdev: egress device from the route lookup. Holds a reference
29+
* @dev_tracker: reference tracker entry for @egdev
2930
* @ref: counts encap actions referencing this entry
3031
* @used: jiffies of last time traffic hit any encap action using this.
3132
* When counter reads update this, a new neighbour event is sent to
@@ -53,6 +54,7 @@ struct efx_neigh_binder {
5354
u8 ttl;
5455
bool dying;
5556
struct net_device *egdev;
57+
netdevice_tracker dev_tracker;
5658
refcount_t ref;
5759
unsigned long used;
5860
struct list_head users;

0 commit comments

Comments
 (0)