" Disable hardware insertion of a VLAN header in"
" packets sent on a port.\n\n"
- "csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
+ "csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)\n"
" Select hardware or software calculation of the"
" checksum when transmitting a packet using the"
" csum forward engine.\n"
" ip|udp|tcp|sctp always concern the inner layer.\n"
" outer-ip concerns the outer IP layer in"
+ " outer-udp concerns the outer UDP layer in"
" case the packet is recognized as a tunnel packet by"
" the forward engine (vxlan, gre and ipip are supported)\n"
" Please check the NIC datasheet for HW limits.\n\n"
(tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) ? "hw" : "sw");
printf("Outer-Ip checksum offload is %s\n",
(tx_offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ? "hw" : "sw");
+ printf("Outer-Udp checksum offload is %s\n",
+ (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
/* display warnings if configuration is not supported by the NIC */
rte_eth_dev_info_get(port_id, &dev_info);
printf("Warning: hardware outer IP checksum enabled but not "
"supported by port %d\n", port_id);
}
+ if ((tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) &&
+ (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+ == 0) {
+ printf("Warning: hardware outer UDP checksum enabled but not "
+ "supported by port %d\n", port_id);
+ }
}
static void
printf("Outer IP checksum offload is not "
"supported by port %u\n", res->port_id);
}
+ } else if (!strcmp(res->proto, "outer-udp")) {
+ if (hw == 0 || (dev_info.tx_offload_capa &
+ DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
+ csum_offloads |=
+ DEV_TX_OFFLOAD_OUTER_UDP_CKSUM;
+ } else {
+ printf("Outer UDP checksum offload is not "
+ "supported by port %u\n", res->port_id);
+ }
}
if (hw) {
mode, "set");
cmdline_parse_token_string_t cmd_csum_proto =
TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
- proto, "ip#tcp#udp#sctp#outer-ip");
+ proto, "ip#tcp#udp#sctp#outer-ip#outer-udp");
cmdline_parse_token_string_t cmd_csum_hwsw =
TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
hwsw, "hw#sw");
cmdline_parse_inst_t cmd_csum_set = {
.f = cmd_csum_parsed,
.data = NULL,
- .help_str = "csum set ip|tcp|udp|sctp|outer-ip hw|sw <port_id>: "
+ .help_str = "csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw <port_id>: "
"Enable/Disable hardware calculation of L3/L4 checksum when "
"using csum forward engine",
.tokens = {
if (info->outer_l4_proto != IPPROTO_UDP)
return ol_flags;
+ /* Skip SW outer UDP checksum generation if HW supports it */
+ if (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+ ol_flags |= PKT_TX_OUTER_UDP_CKSUM;
+ return ol_flags;
+ }
+
udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
- /* outer UDP checksum is done in software as we have no hardware
- * supporting it today, and no API for it. In the other side, for
+ /* outer UDP checksum is done in software. In the other side, for
* UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
* set to zero.
*
if (info.tunnel_tso_segsz ||
(tx_offloads &
DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+ (tx_offloads &
+ DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
(tx_ol_flags & PKT_TX_OUTER_IPV6)) {
m->outer_l2_len = info.outer_l2_len;
m->outer_l3_len = info.outer_l3_len;
if (info.is_tunnel == 1) {
if ((tx_offloads &
DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+ (tx_offloads &
+ DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
(tx_ol_flags & PKT_TX_OUTER_IPV6))
printf("tx: m->outer_l2_len=%d "
"m->outer_l3_len=%d\n",
Select hardware or software calculation of the checksum when
transmitting a packet using the ``csum`` forwarding engine::
- testpmd> csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)
+ testpmd> csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)
Where:
as a tunnel packet by the forwarding engine (vxlan, gre and ipip are
supported). See also the ``csum parse-tunnel`` command.
+* ``outer-udp`` relates to the outer UDP layer in the case where the packet is recognized
+ as a tunnel packet by the forwarding engine (vxlan, vxlan-gpe are
+ supported). See also the ``csum parse-tunnel`` command.
+
.. note::
Check the NIC Datasheet for hardware limits.
* If parse-tunnel is enabled, the ``ip|udp|tcp|sctp`` parameters of ``csum set``
command relate to the inner headers (here ``ipv4_in`` and ``tcp_in``), and the
- ``outer-ip parameter`` relates to the outer headers (here ``ipv4_out``).
+ ``outer-ip|outer-udp`` parameter relates to the outer headers (here ``ipv4_out`` and ``udp_out``).
* If parse-tunnel is disabled, the ``ip|udp|tcp|sctp`` parameters of ``csum set``
command relate to the outer headers, here ``ipv4_out`` and ``udp_out``.