-static int
-timestamp_check_handler(__rte_unused const char *key,
- const char *value, __rte_unused void *opaque)
-{
- if (strcmp(value, "1"))
- return -1;
-
- return 0;
-}
-
-
-static int
-nfb_check_timestamp(struct rte_devargs *devargs)
-{
- struct rte_kvargs *kvlist;
- int ret;
-
- if (devargs == NULL)
- return 0;
-
- kvlist = rte_kvargs_parse(devargs->args, NULL);
- if (kvlist == NULL)
- return 0;
-
- if (!rte_kvargs_count(kvlist, TIMESTAMP_ARG)) {
- rte_kvargs_free(kvlist);
- return 0;
- }
- /* Timestamps are enabled when there is
- * key-value pair: enable_timestamp=1
- * TODO: timestamp should be enabled with RTE_ETH_RX_OFFLOAD_TIMESTAMP
- */
- if (rte_kvargs_process(kvlist, TIMESTAMP_ARG,
- timestamp_check_handler, NULL) < 0) {
- rte_kvargs_free(kvlist);
- return 0;
- }
- rte_kvargs_free(kvlist);
-
- ret = rte_mbuf_dyn_rx_timestamp_register(
- &nfb_timestamp_dynfield_offset,
- &nfb_timestamp_rx_dynflag);
- if (ret != 0) {
- RTE_LOG(ERR, PMD, "Cannot register Rx timestamp field/flag\n");
- return -rte_errno;
- }
-
- return 1;
-}
-