summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2018-07-24 14:00:41 +0200
committerNeale Ranns <nranns@cisco.com>2018-07-25 12:05:29 +0000
commit4e6014fc9e8611eef16d9267151f1039ff00c190 (patch)
tree4fb9652a20399925f57f4a86064ec83b2e38d2d1 /src/plugins
parente8b68a3da28aa0a2c5f2b7db8e4a59b787c3c4d1 (diff)
avf: api fix
avf_create_reply returns software index for the new interface Change-Id: I8a6b1a1985b072efafa24eb258b1f2cb1bea1110 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/avf/avf.api15
-rw-r--r--src/plugins/avf/avf.h1
-rw-r--r--src/plugins/avf/avf_api.c14
-rw-r--r--src/plugins/avf/device.c2
4 files changed, 25 insertions, 7 deletions
diff --git a/src/plugins/avf/avf.api b/src/plugins/avf/avf.api
index 096d45b8c82..cbded705e49 100644
--- a/src/plugins/avf/avf.api
+++ b/src/plugins/avf/avf.api
@@ -27,7 +27,7 @@ option version = "1.0.0";
@param txq_size - transmit queue size
*/
-autoreply define avf_create
+define avf_create
{
u32 client_index;
u32 context;
@@ -39,6 +39,19 @@ autoreply define avf_create
};
/** \brief
+ @param context - sender context, to match reply w/ request
+ @param retval - return value for request
+ @param sw_if_index - software index for the new avf interface
+*/
+
+define avf_create_reply
+{
+ u32 context;
+ i32 retval;
+ u32 sw_if_index;
+};
+
+/** \brief
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param sw_if_index - interface index
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h
index 32bbb46fde4..14d78195f76 100644
--- a/src/plugins/avf/avf.h
+++ b/src/plugins/avf/avf.h
@@ -204,6 +204,7 @@ typedef struct
u16 txq_size;
/* return */
int rv;
+ u32 sw_if_index;
clib_error_t *error;
} avf_create_if_args_t;
diff --git a/src/plugins/avf/avf_api.c b/src/plugins/avf/avf_api.c
index 7c5925244ca..3bb720b27f2 100644
--- a/src/plugins/avf/avf_api.c
+++ b/src/plugins/avf/avf_api.c
@@ -62,20 +62,24 @@ vl_api_avf_create_t_handler (vl_api_avf_create_t * mp)
avf_main_t *am = &avf_main;
vl_api_avf_create_reply_t *rmp;
avf_create_if_args_t args;
- int rv = 0;
+ int rv;
memset (&args, 0, sizeof (avf_create_if_args_t));
args.enable_elog = ntohl (mp->enable_elog);
args.addr.as_u32 = ntohl (mp->pci_addr);
- args.rxq_size = ntohl (mp->rxq_size);
- args.txq_size = ntohl (mp->txq_size);
+ args.rxq_size = ntohs (mp->rxq_size);
+ args.txq_size = ntohs (mp->txq_size);
avf_create_if (vm, &args);
-
rv = args.rv;
- REPLY_MACRO (VL_API_AVF_CREATE_REPLY + am->msg_id_base);
+ /* *INDENT-OFF* */
+ REPLY_MACRO2 (VL_API_AVF_CREATE_REPLY + am->msg_id_base,
+ ({
+ rmp->sw_if_index = ntohl (args.sw_if_index);
+ }));
+ /* *INDENT-ON* */
}
static void
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index be2205b6169..0e9a8bfe517 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -1171,7 +1171,7 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args)
goto error;
vnet_sw_interface_t *sw = vnet_get_hw_sw_interface (vnm, ad->hw_if_index);
- ad->sw_if_index = sw->sw_if_index;
+ args->sw_if_index = ad->sw_if_index = sw->sw_if_index;
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, ad->hw_if_index);
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE;
d7700 } /* 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 */ }
Vector Packet Processing
========================

## Introduction

The VPP platform is an extensible framework that provides out-of-the-box
production quality switch/router functionality. It is the open source version
of Cisco's Vector Packet Processing (VPP) technology: a high performance,
packet-processing stack that can run on commodity CPUs.

The benefits of this implementation of VPP are its high performance, proven
technology, its modularity and flexibility, and rich feature set.

For more information on VPP and its features please visit the
[FD.io website](http://fd.io/) and
[What is VPP?](https://wiki.fd.io/view/VPP/What_is_VPP%3F) pages.


## Changes

Details of the changes leading up to this version of VPP can be found under
doc/releasenotes.


## Directory layout

| Directory name         | Description                                 |
| ---------------------- | ------------------------------------------- |
| build-data             | Build metadata                              |
| build-root             | Build output directory                      |
| docs                   | Sphinx Documentation                        |
| dpdk                   | DPDK patches and build infrastructure       |
| extras/libmemif        | Client library for memif                    |
| src/examples           | VPP example code                            |
| src/plugins            | VPP bundled plugins directory               |
| src/svm                | Shared virtual memory allocation library    |
| src/tests              | Standalone tests (not part of test harness) |
| src/vat                | VPP API test program                        |
| src/vlib               | VPP application library                     |
| src/vlibapi            | VPP API library                             |
| src/vlibmemory         | VPP Memory management                       |
| src/vnet               | VPP networking                              |
| src/vpp                | VPP application                             |
| src/vpp-api            | VPP application API bindings                |
| src/vppinfra           | VPP core library                            |
| src/vpp/api            | Not-yet-relocated API bindings              |
| test                   | Unit tests and Python test harness          |

## Getting started

In general anyone interested in building, developing or running VPP should
consult the [VPP wiki](https://wiki.fd.io/view/VPP) for more complete
documentation.

In particular, readers are recommended to take a look at [Pulling, Building,
Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run
ning,_Hacking_and_Pushing_VPP_Code) which provides extensive step-by-step
coverage of the topic.

For the impatient, some salient information is distilled below.


### Quick-start: On an existing Linux host

To install system dependencies, build VPP and then install it, simply run the
build script. This should be performed a non-privileged user with `sudo`
access from the project base directory:

    ./extras/vagrant/build.sh

If you want a more fine-grained approach because you intend to do some
development work, the `Makefile` in the root directory of the source tree
provides several convenience shortcuts as `make` targets that may be of
interest. To see the available targets run:

    make


### Quick-start: Vagrant

The directory `extras/vagrant` contains a `VagrantFile` and supporting
scripts to bootstrap a working VPP inside a Vagrant-managed Virtual Machine.
This VM can then be used to test concepts with VPP or as a development
platform to extend VPP. Some obvious caveats apply when using a VM for VPP
since its performance will never match that of bare metal; if your work is
timing or performance sensitive, consider using bare metal in addition or
instead of the VM.

For this to work you will need a working installation of Vagrant. Instructions
for this can be found [on the Setting up Vagrant wiki page]
(https://wiki.fd.io/view/DEV/Setting_Up_Vagrant).


## More information

Several modules provide documentation, see @subpage user_doc for more
end-user-oriented information. Also see @subpage dev_doc for developer notes.

Visit the [VPP wiki](https://wiki.fd.io/view/VPP) for details on more
advanced building strategies and other development notes.