Skip to content

Commit 574f1e9

Browse files
jahurleydavem330
authored andcommitted
nfp: flower: remove unused tun_mask variable
The tunnel dest IP is required for separate offload to the NFP. It is already verified that a dest IP must be present and must be an exact match in the flower rule. Therefore, we can just extract the IP from the generated offload rule and remove the unused mask variable. The function is then no longer required to return the IP separately. Because tun_dst is localised to tunnel matches, move the declaration to the tunnel if branch. Signed-off-by: John Hurley <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f988008 commit 574f1e9

File tree

1 file changed

+6
-5
lines changed
  • drivers/net/ethernet/netronome/nfp/flower

1 file changed

+6
-5
lines changed

drivers/net/ethernet/netronome/nfp/flower/match.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ nfp_flower_compile_ipv6(struct nfp_flower_ipv6 *frame,
218218
static void
219219
nfp_flower_compile_vxlan(struct nfp_flower_vxlan *frame,
220220
struct tc_cls_flower_offload *flow,
221-
bool mask_version, __be32 *tun_dst)
221+
bool mask_version)
222222
{
223223
struct fl_flow_key *target = mask_version ? flow->mask : flow->key;
224224
struct flow_dissector_key_ipv4_addrs *vxlan_ips;
@@ -246,7 +246,6 @@ nfp_flower_compile_vxlan(struct nfp_flower_vxlan *frame,
246246
target);
247247
frame->ip_src = vxlan_ips->src;
248248
frame->ip_dst = vxlan_ips->dst;
249-
*tun_dst = vxlan_ips->dst;
250249
}
251250
}
252251

@@ -256,7 +255,6 @@ int nfp_flower_compile_flow_match(struct tc_cls_flower_offload *flow,
256255
struct nfp_fl_payload *nfp_flow)
257256
{
258257
enum nfp_flower_tun_type tun_type = NFP_FL_TUNNEL_NONE;
259-
__be32 tun_dst, tun_dst_mask = 0;
260258
struct nfp_repr *netdev_repr;
261259
int err;
262260
u8 *ext;
@@ -342,12 +340,15 @@ int nfp_flower_compile_flow_match(struct tc_cls_flower_offload *flow,
342340
}
343341

344342
if (key_ls->key_layer & NFP_FLOWER_LAYER_VXLAN) {
343+
__be32 tun_dst;
344+
345345
/* Populate Exact VXLAN Data. */
346346
nfp_flower_compile_vxlan((struct nfp_flower_vxlan *)ext,
347-
flow, false, &tun_dst);
347+
flow, false);
348348
/* Populate Mask VXLAN Data. */
349349
nfp_flower_compile_vxlan((struct nfp_flower_vxlan *)msk,
350-
flow, true, &tun_dst_mask);
350+
flow, true);
351+
tun_dst = ((struct nfp_flower_vxlan *)ext)->ip_dst;
351352
ext += sizeof(struct nfp_flower_vxlan);
352353
msk += sizeof(struct nfp_flower_vxlan);
353354

0 commit comments

Comments
 (0)