net/ice: fix build with 16-byte Rx descriptor
[dpdk.git] / drivers / net / ice / ice_rxtx.c
index c80d869..4f218bc 100644 (file)
@@ -163,6 +163,8 @@ ice_rxd_to_pkt_fields_by_comms_aux_v1(struct ice_rx_queue *rxq,
                        *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata;
                }
        }
+#else
+       RTE_SET_USED(rxq);
 #endif
 }
 
@@ -201,6 +203,8 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_queue *rxq,
                        *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata;
                }
        }
+#else
+       RTE_SET_USED(rxq);
 #endif
 }
 
@@ -1554,6 +1558,9 @@ ice_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union ice_rx_flex_desc *rxdp)
 #if (ICE_LOOK_AHEAD != 8)
 #error "PMD ICE: ICE_LOOK_AHEAD must be 8\n"
 #endif
+
+#define ICE_PTP_TS_VALID 0x1
+
 static inline int
 ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
 {
@@ -1634,6 +1641,10 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
                                   rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high);
                                mb->timesync = rxq->queue_id;
                                pkt_flags |= RTE_MBUF_F_RX_IEEE1588_PTP;
+                               if (rxdp[j].wb.time_stamp_low &
+                                   ICE_PTP_TS_VALID)
+                                       pkt_flags |=
+                                               RTE_MBUF_F_RX_IEEE1588_TMST;
                        }
 #endif
                        mb->ol_flags |= pkt_flags;
@@ -2490,18 +2501,35 @@ ice_txd_enable_checksum(uint64_t ol_flags,
                        << ICE_TX_DESC_LEN_MACLEN_S;
 
        /* Enable L3 checksum offloads */
-       if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
-               *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
-               *td_offset |= (tx_offload.l3_len >> 2) <<
-                             ICE_TX_DESC_LEN_IPLEN_S;
-       } else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
-               *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
-               *td_offset |= (tx_offload.l3_len >> 2) <<
-                             ICE_TX_DESC_LEN_IPLEN_S;
-       } else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
-               *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
-               *td_offset |= (tx_offload.l3_len >> 2) <<
-                             ICE_TX_DESC_LEN_IPLEN_S;
+       /*Tunnel package usage outer len enable L3 checksum offload*/
+       if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) {
+               if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
+                       *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
+                       *td_offset |= (tx_offload.outer_l3_len >> 2) <<
+                               ICE_TX_DESC_LEN_IPLEN_S;
+               } else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
+                       *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
+                       *td_offset |= (tx_offload.outer_l3_len >> 2) <<
+                               ICE_TX_DESC_LEN_IPLEN_S;
+               } else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
+                       *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
+                       *td_offset |= (tx_offload.outer_l3_len >> 2) <<
+                               ICE_TX_DESC_LEN_IPLEN_S;
+               }
+       } else {
+               if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
+                       *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM;
+                       *td_offset |= (tx_offload.l3_len >> 2) <<
+                               ICE_TX_DESC_LEN_IPLEN_S;
+               } else if (ol_flags & RTE_MBUF_F_TX_IPV4) {
+                       *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4;
+                       *td_offset |= (tx_offload.l3_len >> 2) <<
+                               ICE_TX_DESC_LEN_IPLEN_S;
+               } else if (ol_flags & RTE_MBUF_F_TX_IPV6) {
+                       *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6;
+                       *td_offset |= (tx_offload.l3_len >> 2) <<
+                               ICE_TX_DESC_LEN_IPLEN_S;
+               }
        }
 
        if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {