net/hns3: fix IEEE 1588 PTP

Message ID 1619687943-50507-1-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/hns3: fix IEEE 1588 PTP |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

humin (Q) April 29, 2021, 9:19 a.m. UTC
  When jumbo frame is enabled, Rx function will choose 'Scalar Scattered'
function which has no PTP handling.

This patche fixed it by add PTP handling in 'Scalar Scattered' function.

Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Ferruh Yigit May 4, 2021, 3:04 p.m. UTC | #1
On 4/29/2021 10:19 AM, Min Hu (Connor) wrote:
> When jumbo frame is enabled, Rx function will choose 'Scalar Scattered'
> function which has no PTP handling.
> 
> This patche fixed it by add PTP handling in 'Scalar Scattered' function.
> 
> Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 3881a72..5b22c6c 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2654,6 +2654,9 @@  hns3_recv_scattered_pkts(void *rx_queue,
 			continue;
 		}
 
+		if (unlikely(bd_base_info & BIT(HNS3_RXD_TS_VLD_B)))
+			hns3_rx_ptp_timestamp_handle(rxq, first_seg, rxdp);
+
 		/*
 		 * The last buffer of the received packet. packet len from
 		 * buffer description may contains CRC len, packet len should
@@ -2704,6 +2707,9 @@  hns3_recv_scattered_pkts(void *rx_queue,
 		first_seg->packet_type = hns3_rx_calc_ptype(rxq,
 						l234_info, ol_info);
 
+		if (first_seg->packet_type == RTE_PTYPE_L2_ETHER_TIMESYNC)
+			rxm->ol_flags |= PKT_RX_IEEE1588_PTP;
+
 		hns3_rxd_to_vlan_tci(rxq, first_seg, l234_info, &rxd);
 
 		/* Increment bytes counter */