aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/af_xdp/plugin.c
blob: 444ee553cbf98a03f893311b8cf4b900fe040e43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 *------------------------------------------------------------------
 * Copyright (c) 2018 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *------------------------------------------------------------------
 */

#include <vlib/vlib.h>
#include <vnet/plugin/plugin.h>
#include <vpp/app/version.h>

/* *INDENT-OFF* */
VLIB_PLUGIN_REGISTER () = {
  .version = VPP_BUILD_VER,
  .description = "AF_XDP Device Plugin",
};
/* *INDENT-ON* */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2017 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/** \file

    This file defines vpe control-plane API messages for
    the bonding device driver
*/

option version = "1.0.0";

/** \brief Initialize a new bond interface with the given paramters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param use_custom_mac - if set, mac_address is valid
    @param mac_address - mac addr to assign to the interface if use_custom_mac is set
    @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcastcast, 5=lacp)
    @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored
*/
define bond_create
{
  u32 client_index;
  u32 context;
  u8 use_custom_mac;
  u8 mac_address[6];
  u8 mode;
  u8 lb;
};

/** \brief Reply for bond create reply
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param sw_if_index - software index allocated for the new tap interface
*/
define bond_create_reply
{
  u32 context;
  i32 retval;
  u32 sw_if_index;
};

/** \brief Delete bond interface
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface index of slave interface
*/
autoreply define bond_delete
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
};

/** \brief Initialize a new bond interface with the given paramters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - slave sw_if_index
    @param bond_sw_if_index - bond sw_if_index
    @param is_passive - interface does not initiate the lacp protocol, remote must be active speaker
    @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
*/
define bond_enslave
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u32 bond_sw_if_index;
  u8 is_passive;
  u8 is_long_timeout;
};

/** \brief Reply for bond enslave reply
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define bond_enslave_reply
{
  u32 context;
  i32 retval;
};

/** \brief bond detach slave
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface index of slave interface
*/
autoreply define bond_detach_slave
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
};

/** \brief Dump bond interfaces request */
define sw_interface_bond_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for bond dump request
    @param sw_if_index - software index of bond interface
    @param interface_name - name of interface
    @param mode - bonding mode
    @param lb - load balance algo
    @param active_slaves - active slaves count
    @param slaves - config slave count
*/
define sw_interface_bond_details
{
  u32 context;
  u32 sw_if_index;
  u8 interface_name[64];
  u8 mode;
  u8 lb;
  u32 active_slaves;
  u32 slaves;
};

/** \brief bond slave dump
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface index of bond interface
*/
define sw_interface_slave_dump
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
};

/** \brief Reply for slave dump request
    @param sw_if_index - software index of slave interface
    @param interface_name - name of interface
    @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker
    @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
*/
define sw_interface_slave_details
{
  u32 context;
  u32 sw_if_index;
  u8 interface_name[64];
  u8 is_passive;
  u8 is_long_timeout;
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */