Skip to content

Commit

Permalink
netdev-offload-dpdk: Fix build with v24.11-rc1.
Browse files Browse the repository at this point in the history
Following introduction of a IPv6 address structure and its use in
the rte_ipv6_hdr struct referenced by rte_flow IPv6 object,
adjust code manipulating IPv6 rules in the offload code.

Link: https://git.dpdk.org/dpdk/commit/?id=89b5642d0d45
Signed-off-by: David Marchand <[email protected]>
Reviewed-by: Robin Jarry <[email protected]>
Acked-by: Eelco Chaudron <[email protected]>
Signed-off-by: Kevin Traynor <[email protected]>
  • Loading branch information
david-marchand authored and kevintraynor committed Oct 21, 2024
1 parent 645df77 commit 541acde
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/netdev-offload-dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,15 @@ dump_flow_pattern(struct ds *s,
if (!ipv6_mask) {
ipv6_mask = &rte_flow_item_ipv6_mask;
}
memcpy(&addr, ipv6_spec->hdr.src_addr, sizeof addr);
memcpy(&mask, ipv6_mask->hdr.src_addr, sizeof mask);
memcpy(&addr, &ipv6_spec->hdr.src_addr, sizeof addr);
memcpy(&mask, &ipv6_mask->hdr.src_addr, sizeof mask);
ipv6_string_mapped(addr_str, &addr);
ipv6_string_mapped(mask_str, &mask);
DUMP_PATTERN_ITEM(mask, false, "src", "%s",
addr_str, mask_str, "");

memcpy(&addr, ipv6_spec->hdr.dst_addr, sizeof addr);
memcpy(&mask, ipv6_mask->hdr.dst_addr, sizeof mask);
memcpy(&addr, &ipv6_spec->hdr.dst_addr, sizeof addr);
memcpy(&mask, &ipv6_mask->hdr.dst_addr, sizeof mask);
ipv6_string_mapped(addr_str, &addr);
ipv6_string_mapped(mask_str, &mask);
DUMP_PATTERN_ITEM(mask, false, "dst", "%s",
Expand Down Expand Up @@ -695,10 +695,10 @@ dump_vxlan_encap(struct ds *s, const struct rte_flow_item *items)
struct in6_addr addr;

ds_put_cstr(s, "ip-src ");
memcpy(&addr, ipv6->hdr.src_addr, sizeof addr);
memcpy(&addr, &ipv6->hdr.src_addr, sizeof addr);
ipv6_format_mapped(&addr, s);
ds_put_cstr(s, " ip-dst ");
memcpy(&addr, ipv6->hdr.dst_addr, sizeof addr);
memcpy(&addr, &ipv6->hdr.dst_addr, sizeof addr);
ipv6_format_mapped(&addr, s);
ds_put_cstr(s, " ");
}
Expand Down Expand Up @@ -834,7 +834,7 @@ dump_flow_action(struct ds *s, struct ds *s_extra,
struct in6_addr addr;

ds_put_cstr(s, "ipv6_addr ");
memcpy(&addr, set_ipv6->ipv6_addr, sizeof addr);
memcpy(&addr, &set_ipv6->ipv6_addr, sizeof addr);
ipv6_format_addr(&addr, s);
ds_put_cstr(s, " ");
}
Expand Down Expand Up @@ -1210,18 +1210,18 @@ parse_tnl_ip_match(struct flow_patterns *patterns,
spec->hdr.hop_limits = match->flow.tunnel.ip_ttl;
spec->hdr.vtc_flow = htonl((uint32_t) match->flow.tunnel.ip_tos <<
RTE_IPV6_HDR_TC_SHIFT);
memcpy(spec->hdr.src_addr, &match->flow.tunnel.ipv6_src,
memcpy(&spec->hdr.src_addr, &match->flow.tunnel.ipv6_src,
sizeof spec->hdr.src_addr);
memcpy(spec->hdr.dst_addr, &match->flow.tunnel.ipv6_dst,
memcpy(&spec->hdr.dst_addr, &match->flow.tunnel.ipv6_dst,
sizeof spec->hdr.dst_addr);

mask->hdr.proto = UINT8_MAX;
mask->hdr.hop_limits = match->wc.masks.tunnel.ip_ttl;
mask->hdr.vtc_flow = htonl((uint32_t) match->wc.masks.tunnel.ip_tos <<
RTE_IPV6_HDR_TC_SHIFT);
memcpy(mask->hdr.src_addr, &match->wc.masks.tunnel.ipv6_src,
memcpy(&mask->hdr.src_addr, &match->wc.masks.tunnel.ipv6_src,
sizeof mask->hdr.src_addr);
memcpy(mask->hdr.dst_addr, &match->wc.masks.tunnel.ipv6_dst,
memcpy(&mask->hdr.dst_addr, &match->wc.masks.tunnel.ipv6_dst,
sizeof mask->hdr.dst_addr);

consumed_masks->tunnel.ip_tos = 0;
Expand Down Expand Up @@ -1532,9 +1532,9 @@ parse_flow_match(struct netdev *netdev,
spec->hdr.hop_limits = match->flow.nw_ttl;
spec->hdr.vtc_flow =
htonl((uint32_t) match->flow.nw_tos << RTE_IPV6_HDR_TC_SHIFT);
memcpy(spec->hdr.src_addr, &match->flow.ipv6_src,
memcpy(&spec->hdr.src_addr, &match->flow.ipv6_src,
sizeof spec->hdr.src_addr);
memcpy(spec->hdr.dst_addr, &match->flow.ipv6_dst,
memcpy(&spec->hdr.dst_addr, &match->flow.ipv6_dst,
sizeof spec->hdr.dst_addr);
if ((match->wc.masks.nw_frag & FLOW_NW_FRAG_ANY)
&& (match->flow.nw_frag & FLOW_NW_FRAG_ANY)) {
Expand All @@ -1545,9 +1545,9 @@ parse_flow_match(struct netdev *netdev,
mask->hdr.hop_limits = match->wc.masks.nw_ttl;
mask->hdr.vtc_flow =
htonl((uint32_t) match->wc.masks.nw_tos << RTE_IPV6_HDR_TC_SHIFT);
memcpy(mask->hdr.src_addr, &match->wc.masks.ipv6_src,
memcpy(&mask->hdr.src_addr, &match->wc.masks.ipv6_src,
sizeof mask->hdr.src_addr);
memcpy(mask->hdr.dst_addr, &match->wc.masks.ipv6_dst,
memcpy(&mask->hdr.dst_addr, &match->wc.masks.ipv6_dst,
sizeof mask->hdr.dst_addr);

consumed_masks->nw_ttl = 0;
Expand Down

0 comments on commit 541acde

Please sign in to comment.