Skip to content

Commit

Permalink
net/ice: fix timestamp enabling
Browse files Browse the repository at this point in the history
[ upstream commit 71021636964dcd074ff2ee1663dc67ec830e6a14 ]

Use the following command:
1. dpdk-testpmd -c 0x3 -n 4 --force-max-simd-bitwidth=64
   -- -i --enable-rx-timestamp
2. port stop 0
3. port config 0 rx_offload timestamp off
4. port start 0
Then start it, log will show timestamp info, which should
not appear. Because ice_timestamp_dynflag is still more
than 0, code will still calculate timestamp. So fix it.

Fixes: f9c561f ("net/ice: fix performance for Rx timestamp")

Signed-off-by: Wenjing Qiao <wenjing.qiao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Qiao-Intel authored and kevintraynor committed Jul 11, 2023
1 parent 285bc0e commit 634cd44
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/ice/ice_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,8 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
ice_rxd_to_vlan_tci(mb, &rxdp[j]);
rxd_to_pkt_fields_ops[rxq->rxdid](rxq, mb, &rxdp[j]);
#ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC
if (ice_timestamp_dynflag > 0) {
if (ice_timestamp_dynflag > 0 &&
(rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) {
rxq->time_high =
rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high);
if (unlikely(is_tsinit)) {
Expand Down Expand Up @@ -1984,7 +1985,8 @@ ice_recv_scattered_pkts(void *rx_queue,
rxd_to_pkt_fields_ops[rxq->rxdid](rxq, first_seg, &rxd);
pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0);
#ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC
if (ice_timestamp_dynflag > 0) {
if (ice_timestamp_dynflag > 0 &&
(rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) {
rxq->time_high =
rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high);
if (unlikely(is_tsinit)) {
Expand Down Expand Up @@ -2435,7 +2437,8 @@ ice_recv_pkts(void *rx_queue,
rxd_to_pkt_fields_ops[rxq->rxdid](rxq, rxm, &rxd);
pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0);
#ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC
if (ice_timestamp_dynflag > 0) {
if (ice_timestamp_dynflag > 0 &&
(rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) {
rxq->time_high =
rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high);
if (unlikely(is_tsinit)) {
Expand Down

0 comments on commit 634cd44

Please sign in to comment.