bf_status_t bf_ts_global_baresync_ts_get(
bf_dev_id_t dev_id,
uint64_t * global_ts_ns,
uint64_t * baresync_ts_ns
)
bf_ts_global_baresync_ts_get Trigger and retrieve both global timestamp value and baresync timestamp value
Parameters
dev_id int chip id
global_ts_ns int64 ptr Pointer to buffer to store global timestamp value in ns
baresync_ts_ns int64 ptr Pointer to buffer to store baresync timestamp value in ns
Returns
status BF_SUCCESS on success BF ERROR code on failure
bf_port_1588_timestamp_tx_get
bf_status_t bf_port_1588_timestamp_tx_get (
bf_dev_id_t dev_id,
bf_dev_port_t dev_port,
uint64_t * ts,
bool * ts_valid,
int * ts_id
)
Get 1588 Tx timestamp on a tofino port.
[ POST_ENABLE ]
Parameters
dev_id : system-assigned identifier (0..BF_MAX_DEV_COUNT-1)
dev_port encoded port identifier
ts : returned timestamp
ts_valid returned timestamp valid indication
ts_id : returned timestamp id(0-3)
Returns
: BF_SUCCESS
: BF_INVALID_ARG: dev_id never added or dev_id > BF_MAX_DEV_COUNT-1
: BF_INVALID_ARG: invalid or missing bf_dev_port_t
: BF_INVALID_ARG: ts == NULL
: BF_INVALID_ARG: ts_valid == NULL
: BF_INVALID_ARG: ts_id == NULL
bf_port_1588_timestamp_tx_get
Line 195:bf_port_1588_timestamp_tx_get((bf_dev_id_t) 0, reqport, &capture_req_ts, &ts_valid1, &ts_id1);
在tofino埠上得到1588 Tx時間戳,存入&capture_req_ts 後面是否有效以及時間戳id
bool bf_pkt_is_inited (
bf_dev_id_t dev_id
)
query if pkt_mgr is initialized
Parameters
dev_id chip id
Returns
true: if initialized, false: otherwise
bf_pkt_data_copy
int bf_pkt_data_copy (
bf_pkt * pkt,
const uint8_t * pkt_buf,
uint16_t size
)
copy payload data to packet
Parameters
pkt bf packet pointer
pkt_buf payload data
size payload data size
Returns
0 on success, -1 on failure
bf_pkt_alloc
int bf_pkt_alloc (
bf_dev_id_t id,
bf_pkt ** pkt,
size_t size,
bf_dma_type_t dr
)
allocate a packet
Parameters
id chip id
pkt bf packet pointer
size buffer size
dr DR pool to use to allocate buffer (bf dma type)
Returns
0 on success, -1 on failure