Commit a427673e authored by John Hurley's avatar John Hurley Committed by David S. Miller

nfp: flower: remove dead code paths

Port matching is selected by default on every rule so remove check for it
and delete 'else' side of the statement. Remove nfp_flower_meta_one as now
it will not feature in the code. Rename nfp_flower_meta_two given that one
has been removed.

'Additional metadata' if statement can never be true so remove it as well.
Signed-off-by: default avatarJohn Hurley <john.hurley@netronome.com>
Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de7d9549
......@@ -165,20 +165,6 @@ struct nfp_fl_pop_vlan {
__be16 reserved;
};
/* Metadata without L2 (1W/4B)
* ----------------------------------------------------------------
* 3 2 1
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | key_layers | mask_id | reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct nfp_flower_meta_one {
u8 nfp_flow_key_layer;
u8 mask_id;
u16 reserved;
};
struct nfp_fl_pre_tunnel {
struct nfp_fl_act_head head;
__be16 reserved;
......@@ -209,7 +195,7 @@ struct nfp_fl_set_vxlan {
* NOTE: | TCI |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct nfp_flower_meta_two {
struct nfp_flower_meta_tci {
u8 nfp_flow_key_layer;
u8 mask_id;
__be16 tci;
......
......@@ -38,7 +38,7 @@
#include "main.h"
static void
nfp_flower_compile_meta_tci(struct nfp_flower_meta_two *frame,
nfp_flower_compile_meta_tci(struct nfp_flower_meta_tci *frame,
struct tc_cls_flower_offload *flow, u8 key_type,
bool mask_version)
{
......@@ -46,7 +46,7 @@ nfp_flower_compile_meta_tci(struct nfp_flower_meta_two *frame,
struct flow_dissector_key_vlan *flow_vlan;
u16 tmp_tci;
memset(frame, 0, sizeof(struct nfp_flower_meta_two));
memset(frame, 0, sizeof(struct nfp_flower_meta_tci));
/* Populate the metadata frame. */
frame->nfp_flow_key_layer = key_type;
frame->mask_id = ~0;
......@@ -67,14 +67,6 @@ nfp_flower_compile_meta_tci(struct nfp_flower_meta_two *frame,
}
}
static void
nfp_flower_compile_meta(struct nfp_flower_meta_one *frame, u8 key_type)
{
frame->nfp_flow_key_layer = key_type;
frame->mask_id = 0;
frame->reserved = 0;
}
static int
nfp_flower_compile_port(struct nfp_flower_in_port *frame, u32 cmsg_port,
bool mask_version, enum nfp_flower_tun_type tun_type)
......@@ -278,15 +270,15 @@ int nfp_flower_compile_flow_match(struct tc_cls_flower_offload *flow,
ext = nfp_flow->unmasked_data;
msk = nfp_flow->mask_data;
if (NFP_FLOWER_LAYER_PORT & key_ls->key_layer) {
/* Populate Exact Metadata. */
nfp_flower_compile_meta_tci((struct nfp_flower_meta_two *)ext,
nfp_flower_compile_meta_tci((struct nfp_flower_meta_tci *)ext,
flow, key_ls->key_layer, false);
/* Populate Mask Metadata. */
nfp_flower_compile_meta_tci((struct nfp_flower_meta_two *)msk,
nfp_flower_compile_meta_tci((struct nfp_flower_meta_tci *)msk,
flow, key_ls->key_layer, true);
ext += sizeof(struct nfp_flower_meta_two);
msk += sizeof(struct nfp_flower_meta_two);
ext += sizeof(struct nfp_flower_meta_tci);
msk += sizeof(struct nfp_flower_meta_tci);
/* Populate Exact Port data. */
err = nfp_flower_compile_port((struct nfp_flower_in_port *)ext,
......@@ -304,23 +296,6 @@ int nfp_flower_compile_flow_match(struct tc_cls_flower_offload *flow,
ext += sizeof(struct nfp_flower_in_port);
msk += sizeof(struct nfp_flower_in_port);
} else {
/* Populate Exact Metadata. */
nfp_flower_compile_meta((struct nfp_flower_meta_one *)ext,
key_ls->key_layer);
/* Populate Mask Metadata. */
nfp_flower_compile_meta((struct nfp_flower_meta_one *)msk,
key_ls->key_layer);
ext += sizeof(struct nfp_flower_meta_one);
msk += sizeof(struct nfp_flower_meta_one);
}
if (NFP_FLOWER_LAYER_META & key_ls->key_layer) {
/* Additional Metadata Fields.
* Currently unsupported.
*/
return -EOPNOTSUPP;
}
if (NFP_FLOWER_LAYER_MAC & key_ls->key_layer) {
/* Populate Exact MAC Data. */
......
......@@ -151,7 +151,7 @@ nfp_flower_calculate_key_layers(struct nfp_fl_key_ls *ret_key_ls,
key_layer_two = 0;
key_layer = NFP_FLOWER_LAYER_PORT;
key_size = sizeof(struct nfp_flower_meta_one) +
key_size = sizeof(struct nfp_flower_meta_tci) +
sizeof(struct nfp_flower_in_port);
if (dissector_uses_key(flow->dissector, FLOW_DISSECTOR_KEY_ETH_ADDRS) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment