Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dafdae1

Browse files
Merge #251
Closes #251
2 parents 328fc11 + 240f104 commit dafdae1

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

‎src/lib/ciul/efxdp_vi.c‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,25 @@ static void efxdp_ef_vi_receive_push(ef_vi* vi)
264264
static int efxdp_ef_vi_receive_get_timestamp(struct ef_vi* vi, const void* pkt,
265265
ef_precisetime* ts_out)
266266
{
267-
return -EOPNOTSUPP;
267+
const uint64_t ns_to_sec = 1000UL * 1000 * 1000;
268+
const struct onload_xdp_rx_meta {
269+
#define ONLOAD_XDP_RX_META_TSTAMP 0x1
270+
uint64_t flags;
271+
uint64_t tstamp;
272+
} *meta = pkt;
273+
274+
/* pkt points to start of packet data. meta precedes that */
275+
meta--;
276+
if (!(meta->flags & ONLOAD_XDP_RX_META_TSTAMP)) {
277+
*ts_out = (ef_precisetime) { 0 };
278+
return -ENODATA;
279+
}
280+
281+
ts_out->tv_sec = meta->tstamp / ns_to_sec;
282+
ts_out->tv_nsec = meta->tstamp % ns_to_sec;
283+
ts_out->tv_nsec_frac = 0;
284+
ts_out->tv_flags = 0;
285+
return 0;
268286
}
269287

270288
static void efxdp_ef_eventq_prime(ef_vi* vi)

‎src/lib/transport/ip/netif_event.c‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -221,26 +221,6 @@ static void get_rx_timestamp(ci_netif* netif, ci_ip_pkt_fmt* pkt)
221221
ci_netif_state_nic_t* nsn = &netif->state->nic[pkt->intf_i];
222222
ef_vi* vi = ci_netif_vi(netif, pkt->intf_i);
223223

224-
/* AF_XDP timestamps are read in ci_netif_poll_evq
225-
* TODO: probably move here. we have all necessary data: vi and pkt */
226-
if( vi->nic_type.arch == EF_VI_ARCH_AF_XDP ) {
227-
struct onload_xdp_rx_meta {
228-
#define ONLOAD_XDP_RX_META_TSTAMP 0x1
229-
uint64_t flags;
230-
uint64_t tstamp;
231-
} *meta;
232-
const uint64_t ns_to_sec = 1000UL * 1000 * 1000;
233-
234-
meta = ((struct onload_xdp_rx_meta *)(pkt->dma_start + pkt->pkt_start_off)) - 1;
235-
if (meta->flags & ONLOAD_XDP_RX_META_TSTAMP) {
236-
pkt->hw_stamp.tv_sec = meta->tstamp / ns_to_sec;
237-
pkt->hw_stamp.tv_nsec = meta->tstamp % ns_to_sec;
238-
pkt->hw_stamp.tv_nsec_frac = 0;
239-
pkt->hw_stamp.tv_flags = 0;
240-
}
241-
return;
242-
}
243-
244224
/* We skip timestamping rx_ref packets here as we no longer have a reference
245225
* to them. Instead, we copy these earlier in get_efct_timestamp. */
246226
if( ! (nsn->oo_vi_flags & OO_VI_FLAGS_RX_REF) &&

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /