dpdk: improve tx offload formatting
Type: improvement
#define foreach_dpdk_pkt_tx_offload_flag \
_ (PKT_TX_VLAN_PKT, "TX packet is a 802.1q VLAN packet") \
+ _ (PKT_TX_TUNNEL_VXLAN, "TX packet is a VXLAN packet") \
_ (PKT_TX_IP_CKSUM, "IP cksum of TX pkt. computed by NIC") \
_ (PKT_TX_TCP_CKSUM, "TCP cksum of TX pkt. computed by NIC") \
_ (PKT_TX_SCTP_CKSUM, "SCTP cksum of TX pkt. computed by NIC") \
+ _ (PKT_TX_OUTER_IP_CKSUM, "Outer IP cksum of Tx pkt. computed by NIC") \
+ _ (PKT_TX_TCP_SEG, "TSO of TX pkt. done by NIC") \
_ (PKT_TX_IEEE1588_TMST, "TX IEEE1588 packet to timestamp")
#define foreach_dpdk_pkt_offload_flag \
@@ -880,6 +883,17 @@ format_dpdk_pkt_offload_flags (u8 * s, va_list * va)
return s;
}
+u8 *
+format_dpdk_rte_mbuf_tso (u8 *s, va_list *va)
+{
+ struct rte_mbuf *mb = va_arg (*va, struct rte_mbuf *);
+ if (mb->ol_flags & PKT_TX_TCP_SEG)
+ {
+ s = format (s, "l4_len %u tso_segsz %u", mb->l4_len, mb->tso_segsz);
+ }
+ return s;
+}
+
u8 *
format_dpdk_rte_mbuf_vlan (u8 * s, va_list * va)
{
@@ -908,15 +922,17 @@ format_dpdk_rte_mbuf (u8 * s, va_list * va)
ethernet_header_t *eth_hdr = va_arg (*va, ethernet_header_t *);
u32 indent = format_get_indent (s) + 2;
- s = format (s, "PKT MBUF: port %d, nb_segs %d, pkt_len %d"
+ s = format (
+ s,
+ "PKT MBUF: port %d, nb_segs %d, pkt_len %d"
"\n%Ubuf_len %d, data_len %d, ol_flags 0x%lx, data_off %d, phys_addr 0x%x"
"\n%Upacket_type 0x%x l2_len %u l3_len %u outer_l2_len %u outer_l3_len %u "
+ "%U"
"\n%Urss 0x%x fdir.hi 0x%x fdir.lo 0x%x",
- mb->port, mb->nb_segs, mb->pkt_len,
- format_white_space, indent,
- mb->buf_len, mb->data_len, mb->ol_flags, mb->data_off,
- mb->buf_iova, format_white_space, indent, mb->packet_type,
- mb->l2_len, mb->l3_len, mb->outer_l2_len, mb->outer_l3_len,
+ mb->port, mb->nb_segs, mb->pkt_len, format_white_space, indent,
+ mb->buf_len, mb->data_len, mb->ol_flags, mb->data_off, mb->buf_iova,
+ format_white_space, indent, mb->packet_type, mb->l2_len, mb->l3_len,
+ mb->outer_l2_len, mb->outer_l3_len, format_dpdk_rte_mbuf_tso, mb,
format_white_space, indent, mb->hash.rss, mb->hash.fdir.hi,
mb->hash.fdir.lo);
