Skip to content

Commit

Permalink
doc: fix mbuf flags
Browse files Browse the repository at this point in the history
[ upstream commit 1d9077d101b5c9ac2f841a82187ef5ced0fc7f43 ]

Fixes: 2542ad5 ("doc: add description of the offload API")
Fixes: ae2c2cb ("net/cnxk: avoid command copy from Tx queue")

Signed-off-by: Yingming Mao <maoyingming@baidu.com>
Reviewed-by: Shuo Li <lishuo02@baidu.com>
  • Loading branch information
Yingming Mao authored and bluca committed Jul 29, 2024
1 parent ff2d7af commit b9c8076
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,6 @@ Mandeep Rohilla <mrohilla@brocade.com>
Manish Chopra <manishc@marvell.com>
Manish Tomar <manish.tomar@nxp.com>
Mao Jiang <maox.jiang@intel.com>
Mao YingMing <maoyingming@baidu.com>
Marcel Apfelbaum <marcel@redhat.com>
Marcel Cornu <marcel.d.cornu@intel.com>
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Expand Down Expand Up @@ -1271,6 +1270,7 @@ Shuanglin Wang <shuanglin.wang@broadcom.com>
Shuki Katzenelson <shuki@lightbitslabs.com>
Shun Hao <shunh@nvidia.com>
Shu Shen <shu.shen@radisys.com>
Shuo Li <lishuo02@baidu.com>
Shweta Choudaha <shweta.choudaha@att.com>
Shyam Kumar Shrivastav <shrivastav.shyam@gmail.com>
Shy Shyman <shys@nvidia.com> <shys@mellanox.com>
Expand Down Expand Up @@ -1567,6 +1567,7 @@ Yi Lu <luyi68@live.com>
Yilun Xu <yilun.xu@intel.com>
Yinan Wang <yinan.wang@intel.com>
Ying A Wang <ying.a.wang@intel.com>
Yingming Mao <maoyingming@baidu.com>
Yingya Han <yingyax.han@intel.com>
Yinjun Zhang <yinjun.zhang@corigine.com>
Yipeng Wang <yipeng1.wang@intel.com>
Expand Down
8 changes: 4 additions & 4 deletions doc/guides/prog_guide/mbuf_lib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ a vxlan-encapsulated tcp packet:

mb->l2_len = len(out_eth)
mb->l3_len = len(out_ip)
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CSUM
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM
set out_ip checksum to 0 in the packet

This is supported on hardware advertising RTE_ETH_TX_OFFLOAD_IPV4_CKSUM.
Expand All @@ -143,7 +143,7 @@ a vxlan-encapsulated tcp packet:

mb->l2_len = len(out_eth)
mb->l3_len = len(out_ip)
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CSUM | RTE_MBUF_F_TX_UDP_CKSUM
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_UDP_CKSUM
set out_ip checksum to 0 in the packet
set out_udp checksum to pseudo header using rte_ipv4_phdr_cksum()

Expand All @@ -154,7 +154,7 @@ a vxlan-encapsulated tcp packet:

mb->l2_len = len(out_eth + out_ip + out_udp + vxlan + in_eth)
mb->l3_len = len(in_ip)
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CSUM
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM
set in_ip checksum to 0 in the packet

This is similar to case 1), but l2_len is different. It is supported
Expand All @@ -165,7 +165,7 @@ a vxlan-encapsulated tcp packet:

mb->l2_len = len(out_eth + out_ip + out_udp + vxlan + in_eth)
mb->l3_len = len(in_ip)
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CSUM | RTE_MBUF_F_TX_TCP_CKSUM
mb->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_TCP_CKSUM
set in_ip checksum to 0 in the packet
set in_tcp checksum to pseudo header using rte_ipv4_phdr_cksum()

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cnxk/cn10k_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ cn10k_nix_xmit_prepare_tstamp(struct cn10k_eth_txq *txq, uintptr_t lmt_addr,
struct nix_send_mem_s *send_mem;

send_mem = (struct nix_send_mem_s *)(lmt + off);
/* Packets for which PKT_TX_IEEE1588_TMST is not set, tx tstamp
/* Packets for which RTE_MBUF_F_TX_IEEE1588_TMST is not set, Tx tstamp
* should not be recorded, hence changing the alg type to
* NIX_SENDMEMALG_SUB and also changing send mem addr field to
* next 8 bytes as it corrupts the actual Tx tstamp registered
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cnxk/cn9k_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ cn9k_nix_xmit_prepare_tstamp(struct cn9k_eth_txq *txq, uint64_t *cmd,

send_mem = (struct nix_send_mem_s *)(cmd + off);

/* Packets for which PKT_TX_IEEE1588_TMST is not set, tx tstamp
/* Packets for which RTE_MBUF_F_TX_IEEE1588_TMST is not set, Tx tstamp
* should not be recorded, hence changing the alg type to
* NIX_SENDMEMALG_SUB and also changing send mem addr field to
* next 8 bytes as it corrupts the actual Tx tstamp registered
Expand Down

0 comments on commit b9c8076

Please sign in to comment.