@@ -675,7 +675,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"port config all max-pkt-len (value)\n"
" Set the max packet length.\n\n"
- "port config all (crc-strip|scatter|rx-cksum|hw-vlan|hw-vlan-filter|"
+ "port config all (crc-strip|scatter|rx-cksum|rx-timestamp|hw-vlan|hw-vlan-filter|"
"hw-vlan-strip|hw-vlan-extend|drop-en)"
" (on|off)\n"
" Set crc-strip/scatter/rx-checksum/hardware-vlan/drop_en"
@@ -1584,6 +1584,15 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
printf("Unknown parameter\n");
return;
}
+ } else if (!strcmp(res->name, "rx-timestamp")) {
+ if (!strcmp(res->value, "on"))
+ rx_mode.hw_timestamp = 1;
+ else if (!strcmp(res->value, "off"))
+ rx_mode.hw_timestamp = 0;
+ else {
+ printf("Unknown parameter\n");
+ return;
+ }
} else if (!strcmp(res->name, "hw-vlan")) {
if (!strcmp(res->value, "on")) {
rx_mode.hw_vlan_filter = 1;
@@ -1652,7 +1661,7 @@ cmdline_parse_token_string_t cmd_config_rx_mode_flag_all =
TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, all, "all");
cmdline_parse_token_string_t cmd_config_rx_mode_flag_name =
TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, name,
- "crc-strip#scatter#rx-cksum#hw-vlan#"
+ "crc-strip#scatter#rx-cksum#rx-timestamp#hw-vlan#"
"hw-vlan-filter#hw-vlan-strip#hw-vlan-extend");
cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =
TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, value,
@@ -1661,7 +1670,7 @@ cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =
cmdline_parse_inst_t cmd_config_rx_mode_flag = {
.f = cmd_config_rx_mode_flag_parsed,
.data = NULL,
- .help_str = "port config all crc-strip|scatter|rx-cksum|hw-vlan|"
+ .help_str = "port config all crc-strip|scatter|rx-cksum|rx-timestamp|hw-vlan|"
"hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off",
.tokens = {
(void *)&cmd_config_rx_mode_flag_port,
@@ -598,6 +598,14 @@ port_offload_cap_display(portid_t port_id)
printf("off\n");
}
+ if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP) {
+ printf("HW timestamp: ");
+ if (dev->data->dev_conf.rxmode.hw_timestamp)
+ printf("on\n");
+ else
+ printf("off\n");
+ }
+
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) {
printf("Double VLANs insert: ");
if (ports[port_id].tx_ol_flags &
@@ -162,6 +162,7 @@ usage(char* progname)
printf(" --disable-crc-strip: disable CRC stripping by hardware.\n");
printf(" --enable-lro: enable large receive offload.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
+ printf(" --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
printf(" --disable-hw-vlan: disable hardware vlan.\n");
printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
@@ -601,6 +602,7 @@ launch_args_parse(int argc, char** argv)
{ "disable-crc-strip", 0, 0, 0 },
{ "enable-lro", 0, 0, 0 },
{ "enable-rx-cksum", 0, 0, 0 },
+ { "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
{ "disable-hw-vlan", 0, 0, 0 },
{ "disable-hw-vlan-filter", 0, 0, 0 },
@@ -899,6 +901,9 @@ launch_args_parse(int argc, char** argv)
rx_mode.enable_scatter = 1;
if (!strcmp(lgopts[opt_idx].name, "enable-rx-cksum"))
rx_mode.hw_ip_checksum = 1;
+ if (!strcmp(lgopts[opt_idx].name,
+ "enable-rx-timestamp"))
+ rx_mode.hw_timestamp = 1;
if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan")) {
rx_mode.hw_vlan_filter = 0;
@@ -158,6 +158,8 @@ pkt_burst_receive(struct fwd_stream *fs)
printf("hash=0x%x ID=0x%x ",
mb->hash.fdir.hash, mb->hash.fdir.id);
}
+ if (ol_flags & PKT_RX_TIMESTAMP)
+ printf(" - timestamp %lu ", mb->timestamp);
if (ol_flags & PKT_RX_VLAN_STRIPPED)
printf(" - VLAN tci=0x%x", mb->vlan_tci);
if (ol_flags & PKT_RX_QINQ_STRIPPED)
@@ -339,6 +339,7 @@ struct rte_eth_rxmode rx_mode = {
.hw_vlan_extend = 0, /**< Extended VLAN disabled. */
.jumbo_frame = 0, /**< Jumbo Frame Support disabled. */
.hw_strip_crc = 1, /**< CRC stripping by hardware enabled. */
+ .hw_timestamp = 0, /**< HW timestamp enabled. */
};
struct rte_fdir_conf fdir_conf = {