sizeof(uintptr_t) * OTX2_SSO_MAX_VHGRP);
ws->fc_mem = dev->fc_mem;
ws->xaq_lmt = dev->xaq_lmt;
+ ws->tstamp = dev->tstamp;
otx2_write64(val, OTX2_SSOW_GET_BASE_ADDR(
ws->ws_state[0].getwrk_op) + SSOW_LF_GWS_NW_TIM);
otx2_write64(val, OTX2_SSOW_GET_BASE_ADDR(
sizeof(uintptr_t) * OTX2_SSO_MAX_VHGRP);
ws->fc_mem = dev->fc_mem;
ws->xaq_lmt = dev->xaq_lmt;
+ ws->tstamp = dev->tstamp;
otx2_write64(val, base + SSOW_LF_GWS_NW_TIM);
}
/* MSIX offsets */
uint16_t sso_msixoff[OTX2_SSO_MAX_VHGRP];
uint16_t ssow_msixoff[OTX2_SSO_MAX_VHWS];
+ /* PTP timestamp */
+ struct otx2_timesync_info *tstamp;
} __rte_cache_aligned;
#define OTX2_SSOGWS_OPS \
uint64_t xaq_lmt __rte_cache_aligned;
uint64_t *fc_mem;
uintptr_t grps_base[OTX2_SSO_MAX_VHGRP];
+ /* PTP timestamp */
+ struct otx2_timesync_info *tstamp;
} __rte_cache_aligned;
struct otx2_ssogws_state {
uint64_t xaq_lmt __rte_cache_aligned;
uint64_t *fc_mem;
uintptr_t grps_base[OTX2_SSO_MAX_VHGRP];
+ /* PTP timestamp */
+ struct otx2_timesync_info *tstamp;
} __rte_cache_aligned;
static inline struct otx2_sso_evdev *
}
dev->rx_offloads |= otx2_eth_dev->rx_offload_flags;
+ dev->tstamp = &otx2_eth_dev->tstamp;
sso_fastpath_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
return 0;
event.event_type == RTE_EVENT_TYPE_ETHDEV) {
otx2_wqe_to_mbuf(get_work1, mbuf, event.sub_event_type,
(uint32_t) event.get_work0, flags, lookup_mem);
+ /* Extracting tstamp, if PTP enabled*/
+ otx2_nix_mbuf_to_tstamp((struct rte_mbuf *)mbuf, ws->tstamp,
+ flags);
get_work1 = mbuf;
}
event.event_type == RTE_EVENT_TYPE_ETHDEV) {
otx2_wqe_to_mbuf(get_work1, mbuf, event.sub_event_type,
(uint32_t) event.get_work0, flags, NULL);
+ /* Extracting tstamp, if PTP enabled*/
+ otx2_nix_mbuf_to_tstamp((struct rte_mbuf *)mbuf, ws->tstamp,
+ flags);
get_work1 = mbuf;
}
\
gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], \
&ws->ws_state[!ws->vws], ev, \
- flags, ws->lookup_mem); \
+ flags, ws->lookup_mem, \
+ ws->tstamp); \
ws->vws = !ws->vws; \
\
return gw; \
\
gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], \
&ws->ws_state[!ws->vws], ev, \
- flags, ws->lookup_mem); \
+ flags, ws->lookup_mem, \
+ ws->tstamp); \
ws->vws = !ws->vws; \
for (iter = 1; iter < timeout_ticks && (gw == 0); iter++) { \
gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], \
&ws->ws_state[!ws->vws], \
ev, flags, \
- ws->lookup_mem); \
+ ws->lookup_mem, \
+ ws->tstamp); \
ws->vws = !ws->vws; \
} \
\
gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], \
&ws->ws_state[!ws->vws], ev, \
flags | NIX_RX_MULTI_SEG_F, \
- ws->lookup_mem); \
+ ws->lookup_mem, \
+ ws->tstamp); \
ws->vws = !ws->vws; \
\
return gw; \
gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], \
&ws->ws_state[!ws->vws], ev, \
flags | NIX_RX_MULTI_SEG_F, \
- ws->lookup_mem); \
+ ws->lookup_mem, \
+ ws->tstamp); \
ws->vws = !ws->vws; \
for (iter = 1; iter < timeout_ticks && (gw == 0); iter++) { \
gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], \
&ws->ws_state[!ws->vws], \
ev, flags | \
NIX_RX_MULTI_SEG_F, \
- ws->lookup_mem); \
+ ws->lookup_mem, \
+ ws->tstamp); \
ws->vws = !ws->vws; \
} \
\
otx2_ssogws_dual_get_work(struct otx2_ssogws_state *ws,
struct otx2_ssogws_state *ws_pair,
struct rte_event *ev, const uint32_t flags,
- const void * const lookup_mem)
+ const void * const lookup_mem,
+ struct otx2_timesync_info * const tstamp)
{
const uint64_t set_gw = BIT_ULL(16) | 1;
union otx2_sso_event event;
event.event_type == RTE_EVENT_TYPE_ETHDEV) {
otx2_wqe_to_mbuf(get_work1, mbuf, event.sub_event_type,
(uint32_t) event.get_work0, flags, lookup_mem);
+ /* Extracting tstamp, if PTP enabled*/
+ otx2_nix_mbuf_to_tstamp((struct rte_mbuf *)mbuf, tstamp, flags);
get_work1 = mbuf;
}