[1/5] net/hns3: fix offload flag of IEEE 1588

Message ID 20240403101624.2771140-2-haijie1@huawei.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series net/hns3: add some bugfix |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Hai April 3, 2024, 10:16 a.m. UTC
  From: Dengdui Huang <huangdengdui@huawei.com>

Currently, the RTE_MBUF_F_RX_IEEE1588_TMST offload flag will
not be set when the scatter algorithm is used.
This patch fixes it.

Fixes: 4801f0403b58 ("net/hns3: fix IEEE 1588 PTP for scalar scattered Rx")
Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Patrick Robb April 5, 2024, 2:33 p.m. UTC | #1
Recheck-request: iol-intel-Functional, iol-intel-Performance

On Wed, Apr 3, 2024 at 6:21 AM Jie Hai <haijie1@huawei.com> wrote:
>
> From: Dengdui Huang <huangdengdui@huawei.com>
>
> Currently, the RTE_MBUF_F_RX_IEEE1588_TMST offload flag will
> not be set when the scatter algorithm is used.
> This patch fixes it.
>
> Fixes: 4801f0403b58 ("net/hns3: fix IEEE 1588 PTP for scalar scattered Rx")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> ---
>  drivers/net/hns3/hns3_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
> index 7e636a0a2e99..3e7dd1057940 100644
> --- a/drivers/net/hns3/hns3_rxtx.c
> +++ b/drivers/net/hns3/hns3_rxtx.c
> @@ -2669,6 +2669,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
>                         continue;
>                 }
>
> +               first_seg->ol_flags = 0;
>                 if (unlikely(bd_base_info & BIT(HNS3_RXD_TS_VLD_B)))
>                         hns3_rx_ptp_timestamp_handle(rxq, first_seg, timestamp);
>
> @@ -2698,7 +2699,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
>
>                 first_seg->port = rxq->port_id;
>                 first_seg->hash.rss = rte_le_to_cpu_32(rxd.rx.rss_hash);
> -               first_seg->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
> +               first_seg->ol_flags |= RTE_MBUF_F_RX_RSS_HASH;
>                 if (unlikely(bd_base_info & BIT(HNS3_RXD_LUM_B))) {
>                         first_seg->hash.fdir.hi =
>                                 rte_le_to_cpu_16(rxd.rx.fd_id);
> --
> 2.30.0
>
  

Patch

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 7e636a0a2e99..3e7dd1057940 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2669,6 +2669,7 @@  hns3_recv_scattered_pkts(void *rx_queue,
 			continue;
 		}
 
+		first_seg->ol_flags = 0;
 		if (unlikely(bd_base_info & BIT(HNS3_RXD_TS_VLD_B)))
 			hns3_rx_ptp_timestamp_handle(rxq, first_seg, timestamp);
 
@@ -2698,7 +2699,7 @@  hns3_recv_scattered_pkts(void *rx_queue,
 
 		first_seg->port = rxq->port_id;
 		first_seg->hash.rss = rte_le_to_cpu_32(rxd.rx.rss_hash);
-		first_seg->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
+		first_seg->ol_flags |= RTE_MBUF_F_RX_RSS_HASH;
 		if (unlikely(bd_base_info & BIT(HNS3_RXD_LUM_B))) {
 			first_seg->hash.fdir.hi =
 				rte_le_to_cpu_16(rxd.rx.fd_id);