aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-11-06 19:34:07 +0000
committerFlorin Coras <florin.coras@gmail.com>2018-11-06 23:24:08 +0000
commit8d3397425b3fe0f58b621854eb95d225fcbb415f (patch)
tree3744396b7baaa4a0e23596344c79d2624c7a0f8b /src/plugins
parentdd04bb9538292140a4068a34aa7dccbcf5026355 (diff)
marvell: bump musdk version to 18.09.3
Change-Id: Ifb841312d4a382547153b24903230b407f649e73 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/marvell/CMakeLists.txt12
-rw-r--r--src/plugins/marvell/README.md22
-rw-r--r--src/plugins/marvell/pp2/format.c2
-rw-r--r--src/plugins/marvell/pp2/output.c2
-rw-r--r--src/plugins/marvell/pp2/pp2.c14
5 files changed, 35 insertions, 17 deletions
diff --git a/src/plugins/marvell/CMakeLists.txt b/src/plugins/marvell/CMakeLists.txt
index c606f3d5b81..4e4b76886fa 100644
--- a/src/plugins/marvell/CMakeLists.txt
+++ b/src/plugins/marvell/CMakeLists.txt
@@ -11,10 +11,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
+ return()
+endif()
+
find_path(MUSDK_INCLUDE_DIR NAMES mv_std.h)
-find_library(MUSDK_LIB NAMES musdk)
+find_library(MUSDK_LIB NAMES libmusdk.a)
if(MUSDK_INCLUDE_DIR AND MUSDK_LIB)
+ get_filename_component(MUSDK_LIB_DIR ${MUSDK_LIB} DIRECTORY)
+ set(MUSDK_LINK_FLAGS "-Wl,--whole-archive,${MUSDK_LIB_DIR}/libmusdk.a,--no-whole-archive")
add_vpp_plugin(marvell
SOURCES
plugin.c
@@ -24,8 +30,8 @@ if(MUSDK_INCLUDE_DIR AND MUSDK_LIB)
pp2/output.c
pp2/pp2.c
- LINK_LIBRARIES
- ${MUSDK_LIB}
+ LINK_FLAGS
+ ${MUSDK_LINK_FLAGS}
)
include_directories(${MUSDK_INCLUDE_DIR})
message(STATUS "Found Marvel MUSDK in ${MUSDK_INCLUDE_DIR}")
diff --git a/src/plugins/marvell/README.md b/src/plugins/marvell/README.md
index 300d5833b9e..012677aa652 100644
--- a/src/plugins/marvell/README.md
+++ b/src/plugins/marvell/README.md
@@ -6,22 +6,32 @@ Code is developed and tested on [MACCHIATObin][2] board.
##Prerequisites
Plugins depends on installed MUSDK and Marvell provided linux [kernel][3] with MUSDK provided kernel patches (see `patches/linux` in musdk repo and relevant documentation.
-Kernel version used: **4.4.52 armada-17.10.1**
-MUSDK version used: **armada-17.10.3**
-MUSDK must be compiled with `--enable-bpool-dma=64` parameter.
+Kernel version used: **4.14.22 armada-18.09.3**
+MUSDK version used: **armada-18.09.3**
Following kernel modules from MUSDK must be loaded for plugin to work:
-* `musdk_uio.ko`
+* `musdk_cma.ko`
* `mv_pp_uio.ko`
+##Musdk 18.09.3 compilation steps
+
+```
+./bootstrap
+./configure --prefix=/opt/vpp/external/aarch64/ CFLAGS="-Wno-error=unused-result -g -fPIC" --enable-shared=no
+sed -i -e 's/marvell,mv-pp-uio/generic-uio/' modules/pp2/mv_pp_uio.c
+sed -i -e 's/O_CREAT/O_CREAT, S_IRUSR | S_IWUSR/' src/lib/file_utils.c
+make
+sudo make install
+```
+
## Usage
### Interface Cration
Interfaces are dynamically created with following CLI:
```
create interface marvell pp2 name eth0
-set interface state mv-ppio0/0 up
+set interface state mv-ppio-0/0 up
```
-Where `eth0` is linux interface name and `mv-ppioX/Y` is VPP interface name where X is PP2 device ID and Y is PPIO ID
+Where `eth0` is linux interface name and `mv-ppio-X/Y` is VPP interface name where X is PP2 device ID and Y is PPIO ID
Interface needs to be assigned to MUSDK in FDT configuration and linux interface state must be up.
### Interface Deletion
diff --git a/src/plugins/marvell/pp2/format.c b/src/plugins/marvell/pp2/format.c
index 96b95edccb8..838f5169b05 100644
--- a/src/plugins/marvell/pp2/format.c
+++ b/src/plugins/marvell/pp2/format.c
@@ -43,7 +43,7 @@ format_mrvl_pp2_interface_name (u8 * s, va_list * args)
mrvl_pp2_main_t *ppm = &mrvl_pp2_main;
u32 dev_instance = va_arg (*args, u32);
mrvl_pp2_if_t *ppif = pool_elt_at_index (ppm->interfaces, dev_instance);
- return format (s, "mv-ppio%d/%d", ppif->ppio->pp2_id, ppif->ppio->port_id);
+ return format (s, "mv-ppio-%d/%d", ppif->ppio->pp2_id, ppif->ppio->port_id);
}
#define foreach_ppio_statistics_entry \
diff --git a/src/plugins/marvell/pp2/output.c b/src/plugins/marvell/pp2/output.c
index 108bbef72f2..468440c23a6 100644
--- a/src/plugins/marvell/pp2/output.c
+++ b/src/plugins/marvell/pp2/output.c
@@ -67,7 +67,7 @@ mrvl_pp2_interface_tx (vlib_main_t * vm,
{
u32 bi0 = buffers[0];
vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0);
- u64 paddr = vlib_buffer_get_va (vm, b0);
+ u64 paddr = vlib_buffer_get_pa (vm, b0);
pp2_ppio_outq_desc_reset (d);
pp2_ppio_outq_desc_set_phys_addr (d, paddr + b0->current_data);
diff --git a/src/plugins/marvell/pp2/pp2.c b/src/plugins/marvell/pp2/pp2.c
index b808f3c7bfb..016ad53cc96 100644
--- a/src/plugins/marvell/pp2/pp2.c
+++ b/src/plugins/marvell/pp2/pp2.c
@@ -157,9 +157,12 @@ mrvl_pp2_delete_if (mrvl_pp2_if_t * ppif)
while (n_bufs--)
{
struct pp2_buff_inf binf;
- if (pp2_bpool_get_buff
- (ppm->per_thread_data[0].hif, inq->bpool, &binf) == 0)
- vlib_buffer_free (vm, &binf.cookie, 1);
+ if (pp2_bpool_get_buff (ppm->per_thread_data[0].hif, inq->bpool,
+ &binf) == 0)
+ {
+ u32 bi = binf.cookie;
+ vlib_buffer_free (vm, &bi, 1);
+ }
}
pp2_bpool_deinit (inq->bpool);
}
@@ -212,8 +215,7 @@ mrvl_pp2_create_if (mrvl_pp2_create_if_args_t * args)
}
}
- pool_get (ppm->interfaces, ppif);
- clib_memset (ppif, 0, sizeof (*ppif));
+ pool_get_zero (ppm->interfaces, ppif);
ppif->dev_instance = ppif - ppm->interfaces;
ppif->hw_if_index = ~0;
vec_validate_aligned (ppif->inqs, n_inqs - 1, CLIB_CACHE_LINE_BYTES);
@@ -260,7 +262,7 @@ mrvl_pp2_create_if (mrvl_pp2_create_if_args_t * args)
ppio_params.inqs_params.tcs_params[0].pkt_offset = 0;
ppio_params.inqs_params.tcs_params[0].num_in_qs = n_inqs;
ppio_params.inqs_params.tcs_params[0].inqs_params = &inq_params;
- ppio_params.inqs_params.tcs_params[0].pools[0] = ppif->inqs[0].bpool;
+ ppio_params.inqs_params.tcs_params[0].pools[0][0] = ppif->inqs[0].bpool;
ppio_params.outqs_params.num_outqs = n_outqs;
for (i = 0; i < n_outqs; i++)
{