]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfp: flower: rename tunnel related functions in action offload
authorPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Thu, 27 Jun 2019 23:12:41 +0000 (16:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jun 2019 02:47:36 +0000 (19:47 -0700)
Previously tunnel related functions in action offload only applied
to UDP tunnels. Rename these functions in preparation for new
tunnel types.

Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/action.c
drivers/net/ethernet/netronome/nfp/flower/cmsg.h

index 8bea3004d66c1b15d6a32616e3e7a452792eeb70..88fedb5ada977bf376961af1e82ab71e20bf32b9 100644 (file)
@@ -171,8 +171,8 @@ nfp_fl_output(struct nfp_app *app, struct nfp_fl_output *output,
 }
 
 static enum nfp_flower_tun_type
-nfp_fl_get_tun_from_act_l4_port(struct nfp_app *app,
-                               const struct flow_action_entry *act)
+nfp_fl_get_tun_from_act(struct nfp_app *app,
+                       const struct flow_action_entry *act)
 {
        const struct ip_tunnel_info *tun = act->tunnel;
        struct nfp_flower_priv *priv = app->priv;
@@ -281,15 +281,13 @@ nfp_fl_push_geneve_options(struct nfp_fl_payload *nfp_fl, int *list_len,
 }
 
 static int
-nfp_fl_set_ipv4_udp_tun(struct nfp_app *app,
-                       struct nfp_fl_set_ipv4_udp_tun *set_tun,
-                       const struct flow_action_entry *act,
-                       struct nfp_fl_pre_tunnel *pre_tun,
-                       enum nfp_flower_tun_type tun_type,
-                       struct net_device *netdev,
-                       struct netlink_ext_ack *extack)
+nfp_fl_set_ipv4_tun(struct nfp_app *app, struct nfp_fl_set_ipv4_tun *set_tun,
+                   const struct flow_action_entry *act,
+                   struct nfp_fl_pre_tunnel *pre_tun,
+                   enum nfp_flower_tun_type tun_type,
+                   struct net_device *netdev, struct netlink_ext_ack *extack)
 {
-       size_t act_size = sizeof(struct nfp_fl_set_ipv4_udp_tun);
+       size_t act_size = sizeof(struct nfp_fl_set_ipv4_tun);
        const struct ip_tunnel_info *ip_tun = act->tunnel;
        struct nfp_flower_priv *priv = app->priv;
        u32 tmp_set_ip_tun_type_index = 0;
@@ -845,7 +843,7 @@ nfp_flower_loop_action(struct nfp_app *app, const struct flow_action_entry *act,
                       struct nfp_flower_pedit_acts *set_act,
                       struct netlink_ext_ack *extack)
 {
-       struct nfp_fl_set_ipv4_udp_tun *set_tun;
+       struct nfp_fl_set_ipv4_tun *set_tun;
        struct nfp_fl_pre_tunnel *pre_tun;
        struct nfp_fl_push_vlan *psh_v;
        struct nfp_fl_pop_vlan *pop_v;
@@ -898,7 +896,7 @@ nfp_flower_loop_action(struct nfp_app *app, const struct flow_action_entry *act,
        case FLOW_ACTION_TUNNEL_ENCAP: {
                const struct ip_tunnel_info *ip_tun = act->tunnel;
 
-               *tun_type = nfp_fl_get_tun_from_act_l4_port(app, act);
+               *tun_type = nfp_fl_get_tun_from_act(app, act);
                if (*tun_type == NFP_FL_TUNNEL_NONE) {
                        NL_SET_ERR_MSG_MOD(extack, "unsupported offload: unsupported tunnel type in action list");
                        return -EOPNOTSUPP;
@@ -914,7 +912,7 @@ nfp_flower_loop_action(struct nfp_app *app, const struct flow_action_entry *act,
                 * If none, the packet falls back before applying other actions.
                 */
                if (*a_len + sizeof(struct nfp_fl_pre_tunnel) +
-                   sizeof(struct nfp_fl_set_ipv4_udp_tun) > NFP_FL_MAX_A_SIZ) {
+                   sizeof(struct nfp_fl_set_ipv4_tun) > NFP_FL_MAX_A_SIZ) {
                        NL_SET_ERR_MSG_MOD(extack, "unsupported offload: maximum allowed action list size exceeded at tunnel encap");
                        return -EOPNOTSUPP;
                }
@@ -928,11 +926,11 @@ nfp_flower_loop_action(struct nfp_app *app, const struct flow_action_entry *act,
                        return err;
 
                set_tun = (void *)&nfp_fl->action_data[*a_len];
-               err = nfp_fl_set_ipv4_udp_tun(app, set_tun, act, pre_tun,
-                                             *tun_type, netdev, extack);
+               err = nfp_fl_set_ipv4_tun(app, set_tun, act, pre_tun,
+                                         *tun_type, netdev, extack);
                if (err)
                        return err;
-               *a_len += sizeof(struct nfp_fl_set_ipv4_udp_tun);
+               *a_len += sizeof(struct nfp_fl_set_ipv4_tun);
                }
                break;
        case FLOW_ACTION_TUNNEL_DECAP:
index 0d3d1b68232c15506aa57603e2a0aebc5fc5fc92..d0d57d1ef75062acc130bd73ea2351c2df000ece 100644 (file)
@@ -203,7 +203,7 @@ struct nfp_fl_pre_tunnel {
        __be32 extra[3];
 };
 
-struct nfp_fl_set_ipv4_udp_tun {
+struct nfp_fl_set_ipv4_tun {
        struct nfp_fl_act_head head;
        __be16 reserved;
        __be64 tun_id __packed;