* [dpdk-dev] [PATCH 1/7] net/mrvl: sync compilation with musdk-17.10
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
@ 2017-12-01 15:19 ` Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 2/7] net/mrvl: query link status using library API Tomasz Duszynski
` (7 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-01 15:19 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Followig changes are needed to switch to musdk-17.10:
- With a new version of the musdk library it's no longer necessary to
explicitly define MVCONF_ARCH_DMA_ADDR_T_64BIT and
CONF_PP2_BPOOL_COOKIE_SIZE.
Proper defines are autogenerated by ./configure script based on
passed options and available after mv_autogen_comp_flags.h inclusion.
- API used to set promiscuous mode was renamed. Thus in order to
compile against the latest library new API must be used.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
drivers/net/mrvl/Makefile | 4 ++--
drivers/net/mrvl/mrvl_ethdev.c | 8 ++------
drivers/net/mrvl/mrvl_ethdev.h | 5 +++++
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mrvl/Makefile b/drivers/net/mrvl/Makefile
index 815c3ba..f75e53c 100644
--- a/drivers/net/mrvl/Makefile
+++ b/drivers/net/mrvl/Makefile
@@ -51,8 +51,8 @@ EXPORT_MAP := rte_pmd_mrvl_version.map
# external library dependencies
CFLAGS += -I$(LIBMUSDK_PATH)/include
-CFLAGS += -DMVCONF_ARCH_DMA_ADDR_T_64BIT
-CFLAGS += -DCONF_PP2_BPOOL_COOKIE_SIZE=32
+CFLAGS += -DMVCONF_TYPES_PUBLIC
+CFLAGS += -DMVCONF_DMA_PHYS_ADDR_T_PUBLIC
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -O3
LDLIBS += -L$(LIBMUSDK_PATH)/lib
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 2936165..a1ae2c1 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -47,10 +47,6 @@
#undef container_of
#endif
-#include <drivers/mv_pp2.h>
-#include <drivers/mv_pp2_bpool.h>
-#include <drivers/mv_pp2_hif.h>
-
#include <fcntl.h>
#include <linux/ethtool.h>
#include <linux/sockios.h>
@@ -690,7 +686,7 @@ mrvl_promiscuous_enable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
- ret = pp2_ppio_set_uc_promisc(priv->ppio, 1);
+ ret = pp2_ppio_set_promisc(priv->ppio, 1);
if (ret)
RTE_LOG(ERR, PMD, "Failed to enable promiscuous mode\n");
}
@@ -724,7 +720,7 @@ mrvl_promiscuous_disable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
- ret = pp2_ppio_set_uc_promisc(priv->ppio, 0);
+ ret = pp2_ppio_set_promisc(priv->ppio, 0);
if (ret)
RTE_LOG(ERR, PMD, "Failed to disable promiscuous mode\n");
}
diff --git a/drivers/net/mrvl/mrvl_ethdev.h b/drivers/net/mrvl/mrvl_ethdev.h
index 2a4ab5a..8a647a5 100644
--- a/drivers/net/mrvl/mrvl_ethdev.h
+++ b/drivers/net/mrvl/mrvl_ethdev.h
@@ -36,7 +36,12 @@
#define _MRVL_ETHDEV_H_
#include <rte_spinlock.h>
+
+#include <env/mv_autogen_comp_flags.h>
+#include <drivers/mv_pp2.h>
+#include <drivers/mv_pp2_bpool.h>
#include <drivers/mv_pp2_cls.h>
+#include <drivers/mv_pp2_hif.h>
#include <drivers/mv_pp2_ppio.h>
/** Maximum number of rx queues per port */
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 2/7] net/mrvl: query link status using library API
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 1/7] net/mrvl: sync compilation with musdk-17.10 Tomasz Duszynski
@ 2017-12-01 15:19 ` Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 3/7] net/mrvl: do not enable port after setting MAC address Tomasz Duszynski
` (6 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-01 15:19 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Up to now link status was updated unconditionally during
link_up()/link_down() calls thus one was never sure about
it's true status.
Using dedicated library api makes sure the true link status is set.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index a1ae2c1..47f12b8 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -361,8 +361,6 @@ mrvl_dev_set_link_up(struct rte_eth_dev *dev)
if (ret)
pp2_ppio_disable(priv->ppio);
- dev->data->dev_link.link_status = ETH_LINK_UP;
-
return ret;
}
@@ -379,15 +377,8 @@ static int
mrvl_dev_set_link_down(struct rte_eth_dev *dev)
{
struct mrvl_priv *priv = dev->data->dev_private;
- int ret;
-
- ret = pp2_ppio_disable(priv->ppio);
- if (ret)
- return ret;
-
- dev->data->dev_link.link_status = ETH_LINK_DOWN;
- return ret;
+ return pp2_ppio_disable(priv->ppio);
}
/**
@@ -628,9 +619,10 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
* TODO
* once MUSDK provides necessary API use it here
*/
+ struct mrvl_priv *priv = dev->data->dev_private;
struct ethtool_cmd edata;
struct ifreq req;
- int ret, fd;
+ int ret, fd, link_up;
edata.cmd = ETHTOOL_GSET;
@@ -670,6 +662,8 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
ETH_LINK_HALF_DUPLEX;
dev->data->dev_link.link_autoneg = edata.autoneg ? ETH_LINK_AUTONEG :
ETH_LINK_FIXED;
+ pp2_ppio_get_link_state(priv->ppio, &link_up);
+ dev->data->dev_link.link_status = link_up ? ETH_LINK_UP : ETH_LINK_DOWN;
return 0;
}
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 3/7] net/mrvl: do not enable port after setting MAC address
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 1/7] net/mrvl: sync compilation with musdk-17.10 Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 2/7] net/mrvl: query link status using library API Tomasz Duszynski
@ 2017-12-01 15:19 ` Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 4/7] net/mrvl: check if ppio is initialized Tomasz Duszynski
` (5 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-01 15:19 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Setting enabled port's mac address caused it to stop receiving
packets. Now as that issue is fixed in library renabling port
is no longer necessary.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 47f12b8..c44a2bc 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -822,15 +822,14 @@ static void
mrvl_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
{
struct mrvl_priv *priv = dev->data->dev_private;
+ int ret;
- pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes);
- /*
- * TODO
- * Port stops sending packets if pp2_ppio_set_mac_addr()
- * was called after pp2_ppio_enable(). As a quick fix issue
- * enable port once again.
- */
- pp2_ppio_enable(priv->ppio);
+ ret = pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes);
+ if (ret) {
+ char buf[ETHER_ADDR_FMT_SIZE];
+ ether_format_addr(buf, sizeof(buf), mac_addr);
+ RTE_LOG(ERR, PMD, "Failed to set mac to %s\n", buf);
+ }
}
/**
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 4/7] net/mrvl: check if ppio is initialized
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
` (2 preceding siblings ...)
2017-12-01 15:19 ` [dpdk-dev] [PATCH 3/7] net/mrvl: do not enable port after setting MAC address Tomasz Duszynski
@ 2017-12-01 15:19 ` Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 5/7] net/mrvl: add extra error logs Tomasz Duszynski
` (4 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-01 15:19 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Uninitialized ppio cannot be passed to MUSDK library routines as
application will crash.
Fix this by first checking whether ppio has been initialized.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index c44a2bc..40f2ead 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -324,6 +324,9 @@ mrvl_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
if (mtu < ETHER_MIN_MTU || mru > MRVL_PKT_SIZE_MAX)
return -EINVAL;
+ if (!priv->ppio)
+ return -EPERM;
+
ret = pp2_ppio_set_mru(priv->ppio, mru);
if (ret)
return ret;
@@ -346,6 +349,9 @@ mrvl_dev_set_link_up(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return -EPERM;
+
ret = pp2_ppio_enable(priv->ppio);
if (ret)
return ret;
@@ -378,6 +384,9 @@ mrvl_dev_set_link_down(struct rte_eth_dev *dev)
{
struct mrvl_priv *priv = dev->data->dev_private;
+ if (!priv->ppio)
+ return -EPERM;
+
return pp2_ppio_disable(priv->ppio);
}
@@ -624,6 +633,9 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
struct ifreq req;
int ret, fd, link_up;
+ if (!priv->ppio)
+ return -EPERM;
+
edata.cmd = ETHTOOL_GSET;
strcpy(req.ifr_name, dev->data->name);
@@ -680,6 +692,9 @@ mrvl_promiscuous_enable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_promisc(priv->ppio, 1);
if (ret)
RTE_LOG(ERR, PMD, "Failed to enable promiscuous mode\n");
@@ -697,6 +712,9 @@ mrvl_allmulticast_enable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_mc_promisc(priv->ppio, 1);
if (ret)
RTE_LOG(ERR, PMD, "Failed enable all-multicast mode\n");
@@ -714,6 +732,9 @@ mrvl_promiscuous_disable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_promisc(priv->ppio, 0);
if (ret)
RTE_LOG(ERR, PMD, "Failed to disable promiscuous mode\n");
@@ -731,6 +752,9 @@ mrvl_allmulticast_disable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_mc_promisc(priv->ppio, 0);
if (ret)
RTE_LOG(ERR, PMD, "Failed to disable all-multicast mode\n");
@@ -751,6 +775,9 @@ mrvl_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
char buf[ETHER_ADDR_FMT_SIZE];
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_remove_mac_addr(priv->ppio,
dev->data->mac_addrs[index].addr_bytes);
if (ret) {
@@ -787,6 +814,9 @@ mrvl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
/* For setting index 0, mrvl_mac_addr_set() should be used.*/
return -1;
+ if (!priv->ppio)
+ return -EPERM;
+
/*
* Maximum number of uc addresses can be tuned via kernel module mvpp2x
* parameter uc_filter_max. Maximum number of mc addresses is then
@@ -824,6 +854,9 @@ mrvl_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes);
if (ret) {
char buf[ETHER_ADDR_FMT_SIZE];
@@ -851,6 +884,9 @@ mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
uint64_t drop_mac = 0;
unsigned int i, idx, ret;
+ if (!priv->ppio)
+ return -EPERM;
+
for (i = 0; i < dev->data->nb_rx_queues; i++) {
struct mrvl_rxq *rxq = dev->data->rx_queues[i];
struct pp2_ppio_inq_statistics rx_stats;
@@ -943,6 +979,9 @@ mrvl_stats_reset(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int i;
+ if (!priv->ppio)
+ return;
+
for (i = 0; i < dev->data->nb_rx_queues; i++) {
struct mrvl_rxq *rxq = dev->data->rx_queues[i];
@@ -1099,6 +1138,9 @@ mrvl_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
{
struct mrvl_priv *priv = dev->data->dev_private;
+ if (!priv->ppio)
+ return -EPERM;
+
return on ? pp2_ppio_add_vlan(priv->ppio, vlan_id) :
pp2_ppio_remove_vlan(priv->ppio, vlan_id);
}
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 5/7] net/mrvl: add extra error logs
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
` (3 preceding siblings ...)
2017-12-01 15:19 ` [dpdk-dev] [PATCH 4/7] net/mrvl: check if ppio is initialized Tomasz Duszynski
@ 2017-12-01 15:19 ` Tomasz Duszynski
2017-12-01 15:19 ` [dpdk-dev] [PATCH 6/7] devtools/test-build: add MRVL NET PMD to test-build Tomasz Duszynski
` (3 subsequent siblings)
8 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-01 15:19 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Add extra error logs in a few places.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 40f2ead..127ce44 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -426,8 +426,10 @@ mrvl_dev_start(struct rte_eth_dev *dev)
priv->bpool_min_size = priv->nb_rx_queues * MRVL_BURST_SIZE * 2;
ret = pp2_ppio_init(&priv->ppio_params, &priv->ppio);
- if (ret)
+ if (ret) {
+ RTE_LOG(ERR, PMD, "Failed to init ppio\n");
return ret;
+ }
/*
* In case there are some some stale uc/mc mac addresses flush them
@@ -462,17 +464,20 @@ mrvl_dev_start(struct rte_eth_dev *dev)
if (mrvl_qos_cfg) {
ret = mrvl_start_qos_mapping(priv);
if (ret) {
- pp2_ppio_deinit(priv->ppio);
- return ret;
+ RTE_LOG(ERR, PMD, "Failed to setup QoS mapping\n");
+ goto out;
}
}
ret = mrvl_dev_set_link_up(dev);
- if (ret)
+ if (ret) {
+ RTE_LOG(ERR, PMD, "Failed to set link up\n");
goto out;
+ }
return 0;
out:
+ RTE_LOG(ERR, PMD, "Failed to start device\n");
pp2_ppio_deinit(priv->ppio);
return ret;
}
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 6/7] devtools/test-build: add MRVL NET PMD to test-build
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
` (4 preceding siblings ...)
2017-12-01 15:19 ` [dpdk-dev] [PATCH 5/7] net/mrvl: add extra error logs Tomasz Duszynski
@ 2017-12-01 15:19 ` Tomasz Duszynski
2017-12-05 0:48 ` Ferruh Yigit
2017-12-01 15:19 ` [dpdk-dev] [PATCH 7/7] net/mrvl: update MRVL NET PMD documentation Tomasz Duszynski
` (2 subsequent siblings)
8 siblings, 1 reply; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-01 15:19 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Add MRVL NET PMD to test build tool.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
devtools/test-build.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 092d3a7..78609c9 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -197,6 +197,7 @@ config () # <directory> <target> <options>
sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
test -z "$LIBMUSDK_PATH" || \
sed -ri 's,(PMD_MRVL_CRYPTO=)n,\1y,' $1/.config
+ sed -ri 's,(MRVL_PMD=)n,\1y,' $1/.config
build_config_hook $1 $2 $3
# Explicit enabler/disabler (uppercase)
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 6/7] devtools/test-build: add MRVL NET PMD to test-build
2017-12-01 15:19 ` [dpdk-dev] [PATCH 6/7] devtools/test-build: add MRVL NET PMD to test-build Tomasz Duszynski
@ 2017-12-05 0:48 ` Ferruh Yigit
2017-12-05 8:38 ` Tomasz Duszynski
0 siblings, 1 reply; 32+ messages in thread
From: Ferruh Yigit @ 2017-12-05 0:48 UTC (permalink / raw)
To: Tomasz Duszynski, dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu
On 12/1/2017 7:19 AM, Tomasz Duszynski wrote:
> Add MRVL NET PMD to test build tool.
>
> Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
> ---
> devtools/test-build.sh | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/devtools/test-build.sh b/devtools/test-build.sh
> index 092d3a7..78609c9 100755
> --- a/devtools/test-build.sh
> +++ b/devtools/test-build.sh
> @@ -197,6 +197,7 @@ config () # <directory> <target> <options>
> sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
> test -z "$LIBMUSDK_PATH" || \
> sed -ri 's,(PMD_MRVL_CRYPTO=)n,\1y,' $1/.config
> + sed -ri 's,(MRVL_PMD=)n,\1y,' $1/.config
Won't MRVL_PMD also require LIBMUSDK_PATH?
For this case check doesn't cover it and will be enabled always.
> build_config_hook $1 $2 $3
>
> # Explicit enabler/disabler (uppercase)
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 6/7] devtools/test-build: add MRVL NET PMD to test-build
2017-12-05 0:48 ` Ferruh Yigit
@ 2017-12-05 8:38 ` Tomasz Duszynski
0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 8:38 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Tomasz Duszynski, dev, mw, jck, dima, nsamsono, jianbo.liu
On Mon, Dec 04, 2017 at 04:48:51PM -0800, Ferruh Yigit wrote:
> On 12/1/2017 7:19 AM, Tomasz Duszynski wrote:
> > Add MRVL NET PMD to test build tool.
> >
> > Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
> > ---
> > devtools/test-build.sh | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/devtools/test-build.sh b/devtools/test-build.sh
> > index 092d3a7..78609c9 100755
> > --- a/devtools/test-build.sh
> > +++ b/devtools/test-build.sh
> > @@ -197,6 +197,7 @@ config () # <directory> <target> <options>
> > sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
> > test -z "$LIBMUSDK_PATH" || \
> > sed -ri 's,(PMD_MRVL_CRYPTO=)n,\1y,' $1/.config
> > + sed -ri 's,(MRVL_PMD=)n,\1y,' $1/.config
>
> Won't MRVL_PMD also require LIBMUSDK_PATH?
> For this case check doesn't cover it and will be enabled always.
>
Good catch. Will be fixed in v3.
> > build_config_hook $1 $2 $3
> >
> > # Explicit enabler/disabler (uppercase)
> >
>
--
- Tomasz Duszyński
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH 7/7] net/mrvl: update MRVL NET PMD documentation
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
` (5 preceding siblings ...)
2017-12-01 15:19 ` [dpdk-dev] [PATCH 6/7] devtools/test-build: add MRVL NET PMD to test-build Tomasz Duszynski
@ 2017-12-01 15:19 ` Tomasz Duszynski
2017-12-04 2:25 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Jianbo Liu
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
8 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-01 15:19 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Update MRVL NET PMD documentation.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
doc/guides/nics/mrvl.rst | 69 +++++++++++++++++++++++++++++++-----------------
1 file changed, 45 insertions(+), 24 deletions(-)
diff --git a/doc/guides/nics/mrvl.rst b/doc/guides/nics/mrvl.rst
index fbfdf47..67b254c 100644
--- a/doc/guides/nics/mrvl.rst
+++ b/doc/guides/nics/mrvl.rst
@@ -87,31 +87,40 @@ Limitations
Prerequisites
-------------
-- Custom Linux Kernel sources available
- `here <https://github.com/MarvellEmbeddedProcessors/linux-marvell/tree/linux-4.4.52-armada-17.08>`__.
+- Custom Linux Kernel sources
-- Out of tree `mvpp2x_sysfs` kernel module sources available
- `here <https://github.com/MarvellEmbeddedProcessors/mvpp2x-marvell/tree/mvpp2x-armada-17.08>`__.
+ .. code-block:: console
-- MUSDK (Marvell User-Space SDK) sources available
- `here <https://github.com/MarvellEmbeddedProcessors/musdk-marvell/tree/musdk-armada-17.08>`__.
+ git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell.git -b linux-4.4.52-armada-17.10
- MUSDK is a light-weight library that provides direct access to Marvell's
- PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
- requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
- approval has been granted, library can be found by typing ``musdk`` in
- the search box.
+- Out of tree `mvpp2x_sysfs` kernel module sources
- MUSDK must be configured with the following features:
+ .. code-block:: console
- .. code-block:: console
+ git clone https://github.com/MarvellEmbeddedProcessors/mvpp2x-marvell.git -b mvpp2x-armada-17.10
- --enable-bpool-dma=64
+- MUSDK (Marvell User-Space SDK) sources
+
+ .. code-block:: console
+
+ git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-armada-17.10
+
+ MUSDK is a light-weight library that provides direct access to Marvell's
+ PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
+ requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
+ approval has been granted, library can be found by typing ``musdk`` in
+ the search box.
+
+ MUSDK must be configured with the following features:
+
+ .. code-block:: console
+
+ --enable-bpool-dma=64
- DPDK environment
- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
- DPDK environment.
+ Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
+ DPDK environment.
Config File Options
@@ -123,11 +132,6 @@ The following options can be modified in the ``config`` file.
Toggle compilation of the librte_pmd_mrvl driver.
-- ``CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE`` (default ``41943040``)
-
- Size in bytes of the contiguous memory region that MUSDK will allocate
- for run-time DMA-able data buffers.
-
QoS Configuration
-----------------
@@ -142,7 +146,7 @@ Configuration syntax
[port <portnum> default]
default_tc = <default_tc>
- qos_mode = <qos_priority>
+ mapping_priority = <mapping_priority>
[port <portnum> tc <traffic_class>]
rxq = <rx_queue_list>
@@ -160,7 +164,7 @@ Where:
- ``<default_tc>``: Default traffic class (e.g. 0)
-- ``<qos_priority>``: QoS priority for mapping (`ip`, `vlan`, `ip/vlan` or `vlan/ip`).
+- ``<mapping_priority>``: QoS priority for mapping (`ip`, `vlan`, `ip/vlan` or `vlan/ip`).
- ``<traffic_class>``: Traffic Class to be configured.
@@ -218,9 +222,26 @@ Building DPDK
Driver needs precompiled MUSDK library during compilation. Please consult
``doc/musdk_get_started.txt`` for the detailed build instructions.
+.. code-block:: console
+
+ export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
+ ./bootstrap
+ ./configure --enable-bpool-dma=64
+ make install
+
+MUSDK will be installed to `usr/local` under current directory.
+For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
+
Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
the path to the MUSDK installation directory needs to be exported.
+.. code-block:: console
+
+ export LIBMUSDK_PATH=<musdk>/usr/local
+ export CROSS=aarch64-linux-gnu-
+ make config T=arm64-armv8a-linuxapp-gcc
+ sed -ri 's,(MRVL_PMD=)n,\1y,' build/.config
+ make
Usage Example
-------------
@@ -242,7 +263,7 @@ Additionally interfaces used by DPDK application need to be put up:
.. code-block:: console
ip link set eth0 up
- ip link set eth1 up
+ ip link set eth2 up
In order to run testpmd example application following command can be used:
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
` (6 preceding siblings ...)
2017-12-01 15:19 ` [dpdk-dev] [PATCH 7/7] net/mrvl: update MRVL NET PMD documentation Tomasz Duszynski
@ 2017-12-04 2:25 ` Jianbo Liu
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
8 siblings, 0 replies; 32+ messages in thread
From: Jianbo Liu @ 2017-12-04 2:25 UTC (permalink / raw)
To: Tomasz Duszynski; +Cc: dev, mw, jck, dima, nsamsono
The 12/01/2017 16:19, Tomasz Duszynski wrote:
> This patchset brings following changes:
>
> o Sync with MUSDK-17.10. Latest version of the library comes with many
> improvements and fixes thus switching to it is beneficial.
>
> o A few code and documentation updates.
>
> Changes since v1:
> o Add extra error log in case setting link up fails.
> o Cram all MUSDK related headers into the same the driver header.
>
> Tomasz Duszynski (7):
> net/mrvl: sync compilation with musdk-17.10
> net/mrvl: query link status using library API
> net/mrvl: do not enable port after setting MAC address
> net/mrvl: check if ppio is initialized
> net/mrvl: add extra error logs
> devtools/test-build: add MRVL NET PMD to test-build
> net/mrvl: update MRVL NET PMD documentation
>
> devtools/test-build.sh | 1 +
> doc/guides/nics/mrvl.rst | 69 ++++++++++++++++++++-----------
> drivers/net/mrvl/Makefile | 4 +-
> drivers/net/mrvl/mrvl_ethdev.c | 92 +++++++++++++++++++++++++++++-------------
> drivers/net/mrvl/mrvl_ethdev.h | 5 +++
> 5 files changed, 117 insertions(+), 54 deletions(-)
>
> --
> 2.7.4
>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
PS, don't forget to add version number in the mail subject next time :-)
--
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 0/7] Sync with MUSDK-17.10
2017-12-01 15:19 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Tomasz Duszynski
` (7 preceding siblings ...)
2017-12-04 2:25 ` [dpdk-dev] [PATCH 0/7] Sync with MUSDK-17.10 Jianbo Liu
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 1/7] net/mrvl: sync compilation with musdk-17.10 Tomasz Duszynski
` (7 more replies)
8 siblings, 8 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
This patchset brings following changes:
o Sync with MUSDK-17.10. Latest version of the library comes with many
improvements and fixes thus switching to it is beneficial.
o A few code and documentation updates.
Changes since v2:
o Fix NET PMD conditional compilation in test-build.sh
Changes since v1:
o Add extra error log in case setting link up fails.
o Cram all MUSDK related headers into the same the driver header.
Tomasz Duszynski (7):
net/mrvl: sync compilation with musdk-17.10
net/mrvl: query link status using library API
net/mrvl: do not enable port after setting MAC address
net/mrvl: check if ppio is initialized
net/mrvl: add extra error logs
devtools/test-build: add MRVL NET PMD to test-build
net/mrvl: update MRVL NET PMD documentation
devtools/test-build.sh | 2 +
doc/guides/nics/mrvl.rst | 69 ++++++++++++++++++++-----------
drivers/net/mrvl/Makefile | 4 +-
drivers/net/mrvl/mrvl_ethdev.c | 92 +++++++++++++++++++++++++++++-------------
drivers/net/mrvl/mrvl_ethdev.h | 5 +++
5 files changed, 118 insertions(+), 54 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 1/7] net/mrvl: sync compilation with musdk-17.10
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 2/7] net/mrvl: query link status using library API Tomasz Duszynski
` (6 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Followig changes are needed to switch to musdk-17.10:
- With a new version of the musdk library it's no longer necessary to
explicitly define MVCONF_ARCH_DMA_ADDR_T_64BIT and
CONF_PP2_BPOOL_COOKIE_SIZE.
Proper defines are autogenerated by ./configure script based on
passed options and available after mv_autogen_comp_flags.h inclusion.
- API used to set promiscuous mode was renamed. Thus in order to
compile against the latest library new API must be used.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
drivers/net/mrvl/Makefile | 4 ++--
drivers/net/mrvl/mrvl_ethdev.c | 8 ++------
drivers/net/mrvl/mrvl_ethdev.h | 5 +++++
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mrvl/Makefile b/drivers/net/mrvl/Makefile
index 815c3ba..f75e53c 100644
--- a/drivers/net/mrvl/Makefile
+++ b/drivers/net/mrvl/Makefile
@@ -51,8 +51,8 @@ EXPORT_MAP := rte_pmd_mrvl_version.map
# external library dependencies
CFLAGS += -I$(LIBMUSDK_PATH)/include
-CFLAGS += -DMVCONF_ARCH_DMA_ADDR_T_64BIT
-CFLAGS += -DCONF_PP2_BPOOL_COOKIE_SIZE=32
+CFLAGS += -DMVCONF_TYPES_PUBLIC
+CFLAGS += -DMVCONF_DMA_PHYS_ADDR_T_PUBLIC
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -O3
LDLIBS += -L$(LIBMUSDK_PATH)/lib
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 2936165..a1ae2c1 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -47,10 +47,6 @@
#undef container_of
#endif
-#include <drivers/mv_pp2.h>
-#include <drivers/mv_pp2_bpool.h>
-#include <drivers/mv_pp2_hif.h>
-
#include <fcntl.h>
#include <linux/ethtool.h>
#include <linux/sockios.h>
@@ -690,7 +686,7 @@ mrvl_promiscuous_enable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
- ret = pp2_ppio_set_uc_promisc(priv->ppio, 1);
+ ret = pp2_ppio_set_promisc(priv->ppio, 1);
if (ret)
RTE_LOG(ERR, PMD, "Failed to enable promiscuous mode\n");
}
@@ -724,7 +720,7 @@ mrvl_promiscuous_disable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
- ret = pp2_ppio_set_uc_promisc(priv->ppio, 0);
+ ret = pp2_ppio_set_promisc(priv->ppio, 0);
if (ret)
RTE_LOG(ERR, PMD, "Failed to disable promiscuous mode\n");
}
diff --git a/drivers/net/mrvl/mrvl_ethdev.h b/drivers/net/mrvl/mrvl_ethdev.h
index 2a4ab5a..8a647a5 100644
--- a/drivers/net/mrvl/mrvl_ethdev.h
+++ b/drivers/net/mrvl/mrvl_ethdev.h
@@ -36,7 +36,12 @@
#define _MRVL_ETHDEV_H_
#include <rte_spinlock.h>
+
+#include <env/mv_autogen_comp_flags.h>
+#include <drivers/mv_pp2.h>
+#include <drivers/mv_pp2_bpool.h>
#include <drivers/mv_pp2_cls.h>
+#include <drivers/mv_pp2_hif.h>
#include <drivers/mv_pp2_ppio.h>
/** Maximum number of rx queues per port */
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 2/7] net/mrvl: query link status using library API
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 1/7] net/mrvl: sync compilation with musdk-17.10 Tomasz Duszynski
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 3/7] net/mrvl: do not enable port after setting MAC address Tomasz Duszynski
` (5 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Up to now link status was updated unconditionally during
link_up()/link_down() calls thus one was never sure about
it's true status.
Using dedicated library api makes sure the true link status is set.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index a1ae2c1..47f12b8 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -361,8 +361,6 @@ mrvl_dev_set_link_up(struct rte_eth_dev *dev)
if (ret)
pp2_ppio_disable(priv->ppio);
- dev->data->dev_link.link_status = ETH_LINK_UP;
-
return ret;
}
@@ -379,15 +377,8 @@ static int
mrvl_dev_set_link_down(struct rte_eth_dev *dev)
{
struct mrvl_priv *priv = dev->data->dev_private;
- int ret;
-
- ret = pp2_ppio_disable(priv->ppio);
- if (ret)
- return ret;
-
- dev->data->dev_link.link_status = ETH_LINK_DOWN;
- return ret;
+ return pp2_ppio_disable(priv->ppio);
}
/**
@@ -628,9 +619,10 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
* TODO
* once MUSDK provides necessary API use it here
*/
+ struct mrvl_priv *priv = dev->data->dev_private;
struct ethtool_cmd edata;
struct ifreq req;
- int ret, fd;
+ int ret, fd, link_up;
edata.cmd = ETHTOOL_GSET;
@@ -670,6 +662,8 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
ETH_LINK_HALF_DUPLEX;
dev->data->dev_link.link_autoneg = edata.autoneg ? ETH_LINK_AUTONEG :
ETH_LINK_FIXED;
+ pp2_ppio_get_link_state(priv->ppio, &link_up);
+ dev->data->dev_link.link_status = link_up ? ETH_LINK_UP : ETH_LINK_DOWN;
return 0;
}
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 3/7] net/mrvl: do not enable port after setting MAC address
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 1/7] net/mrvl: sync compilation with musdk-17.10 Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 2/7] net/mrvl: query link status using library API Tomasz Duszynski
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 4/7] net/mrvl: check if ppio is initialized Tomasz Duszynski
` (4 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Setting enabled port's mac address caused it to stop receiving
packets. Now as that issue is fixed in library renabling port
is no longer necessary.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 47f12b8..c44a2bc 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -822,15 +822,14 @@ static void
mrvl_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
{
struct mrvl_priv *priv = dev->data->dev_private;
+ int ret;
- pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes);
- /*
- * TODO
- * Port stops sending packets if pp2_ppio_set_mac_addr()
- * was called after pp2_ppio_enable(). As a quick fix issue
- * enable port once again.
- */
- pp2_ppio_enable(priv->ppio);
+ ret = pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes);
+ if (ret) {
+ char buf[ETHER_ADDR_FMT_SIZE];
+ ether_format_addr(buf, sizeof(buf), mac_addr);
+ RTE_LOG(ERR, PMD, "Failed to set mac to %s\n", buf);
+ }
}
/**
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 4/7] net/mrvl: check if ppio is initialized
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
` (2 preceding siblings ...)
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 3/7] net/mrvl: do not enable port after setting MAC address Tomasz Duszynski
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 5/7] net/mrvl: add extra error logs Tomasz Duszynski
` (3 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Uninitialized ppio cannot be passed to MUSDK library routines as
application will crash.
Fix this by first checking whether ppio has been initialized.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index c44a2bc..40f2ead 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -324,6 +324,9 @@ mrvl_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
if (mtu < ETHER_MIN_MTU || mru > MRVL_PKT_SIZE_MAX)
return -EINVAL;
+ if (!priv->ppio)
+ return -EPERM;
+
ret = pp2_ppio_set_mru(priv->ppio, mru);
if (ret)
return ret;
@@ -346,6 +349,9 @@ mrvl_dev_set_link_up(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return -EPERM;
+
ret = pp2_ppio_enable(priv->ppio);
if (ret)
return ret;
@@ -378,6 +384,9 @@ mrvl_dev_set_link_down(struct rte_eth_dev *dev)
{
struct mrvl_priv *priv = dev->data->dev_private;
+ if (!priv->ppio)
+ return -EPERM;
+
return pp2_ppio_disable(priv->ppio);
}
@@ -624,6 +633,9 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
struct ifreq req;
int ret, fd, link_up;
+ if (!priv->ppio)
+ return -EPERM;
+
edata.cmd = ETHTOOL_GSET;
strcpy(req.ifr_name, dev->data->name);
@@ -680,6 +692,9 @@ mrvl_promiscuous_enable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_promisc(priv->ppio, 1);
if (ret)
RTE_LOG(ERR, PMD, "Failed to enable promiscuous mode\n");
@@ -697,6 +712,9 @@ mrvl_allmulticast_enable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_mc_promisc(priv->ppio, 1);
if (ret)
RTE_LOG(ERR, PMD, "Failed enable all-multicast mode\n");
@@ -714,6 +732,9 @@ mrvl_promiscuous_disable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_promisc(priv->ppio, 0);
if (ret)
RTE_LOG(ERR, PMD, "Failed to disable promiscuous mode\n");
@@ -731,6 +752,9 @@ mrvl_allmulticast_disable(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_mc_promisc(priv->ppio, 0);
if (ret)
RTE_LOG(ERR, PMD, "Failed to disable all-multicast mode\n");
@@ -751,6 +775,9 @@ mrvl_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
char buf[ETHER_ADDR_FMT_SIZE];
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_remove_mac_addr(priv->ppio,
dev->data->mac_addrs[index].addr_bytes);
if (ret) {
@@ -787,6 +814,9 @@ mrvl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
/* For setting index 0, mrvl_mac_addr_set() should be used.*/
return -1;
+ if (!priv->ppio)
+ return -EPERM;
+
/*
* Maximum number of uc addresses can be tuned via kernel module mvpp2x
* parameter uc_filter_max. Maximum number of mc addresses is then
@@ -824,6 +854,9 @@ mrvl_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
struct mrvl_priv *priv = dev->data->dev_private;
int ret;
+ if (!priv->ppio)
+ return;
+
ret = pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes);
if (ret) {
char buf[ETHER_ADDR_FMT_SIZE];
@@ -851,6 +884,9 @@ mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
uint64_t drop_mac = 0;
unsigned int i, idx, ret;
+ if (!priv->ppio)
+ return -EPERM;
+
for (i = 0; i < dev->data->nb_rx_queues; i++) {
struct mrvl_rxq *rxq = dev->data->rx_queues[i];
struct pp2_ppio_inq_statistics rx_stats;
@@ -943,6 +979,9 @@ mrvl_stats_reset(struct rte_eth_dev *dev)
struct mrvl_priv *priv = dev->data->dev_private;
int i;
+ if (!priv->ppio)
+ return;
+
for (i = 0; i < dev->data->nb_rx_queues; i++) {
struct mrvl_rxq *rxq = dev->data->rx_queues[i];
@@ -1099,6 +1138,9 @@ mrvl_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
{
struct mrvl_priv *priv = dev->data->dev_private;
+ if (!priv->ppio)
+ return -EPERM;
+
return on ? pp2_ppio_add_vlan(priv->ppio, vlan_id) :
pp2_ppio_remove_vlan(priv->ppio, vlan_id);
}
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 5/7] net/mrvl: add extra error logs
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
` (3 preceding siblings ...)
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 4/7] net/mrvl: check if ppio is initialized Tomasz Duszynski
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 6/7] devtools/test-build: add MRVL NET PMD to test-build Tomasz Duszynski
` (2 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Add extra error logs in a few places.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
drivers/net/mrvl/mrvl_ethdev.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 40f2ead..127ce44 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -426,8 +426,10 @@ mrvl_dev_start(struct rte_eth_dev *dev)
priv->bpool_min_size = priv->nb_rx_queues * MRVL_BURST_SIZE * 2;
ret = pp2_ppio_init(&priv->ppio_params, &priv->ppio);
- if (ret)
+ if (ret) {
+ RTE_LOG(ERR, PMD, "Failed to init ppio\n");
return ret;
+ }
/*
* In case there are some some stale uc/mc mac addresses flush them
@@ -462,17 +464,20 @@ mrvl_dev_start(struct rte_eth_dev *dev)
if (mrvl_qos_cfg) {
ret = mrvl_start_qos_mapping(priv);
if (ret) {
- pp2_ppio_deinit(priv->ppio);
- return ret;
+ RTE_LOG(ERR, PMD, "Failed to setup QoS mapping\n");
+ goto out;
}
}
ret = mrvl_dev_set_link_up(dev);
- if (ret)
+ if (ret) {
+ RTE_LOG(ERR, PMD, "Failed to set link up\n");
goto out;
+ }
return 0;
out:
+ RTE_LOG(ERR, PMD, "Failed to start device\n");
pp2_ppio_deinit(priv->ppio);
return ret;
}
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 6/7] devtools/test-build: add MRVL NET PMD to test-build
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
` (4 preceding siblings ...)
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 5/7] net/mrvl: add extra error logs Tomasz Duszynski
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 7/7] net/mrvl: update MRVL NET PMD documentation Tomasz Duszynski
2017-12-07 1:13 ` [dpdk-dev] [PATCH v3 0/7] Sync with MUSDK-17.10 Ferruh Yigit
7 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Add MRVL NET PMD to test build tool.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
devtools/test-build.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 092d3a7..b551764 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -197,6 +197,8 @@ config () # <directory> <target> <options>
sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
test -z "$LIBMUSDK_PATH" || \
sed -ri 's,(PMD_MRVL_CRYPTO=)n,\1y,' $1/.config
+ test -z "$LIBMUSDK_PATH" || \
+ sed -ri 's,(MRVL_PMD=)n,\1y,' $1/.config
build_config_hook $1 $2 $3
# Explicit enabler/disabler (uppercase)
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* [dpdk-dev] [PATCH v3 7/7] net/mrvl: update MRVL NET PMD documentation
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
` (5 preceding siblings ...)
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 6/7] devtools/test-build: add MRVL NET PMD to test-build Tomasz Duszynski
@ 2017-12-05 9:39 ` Tomasz Duszynski
2017-12-07 1:13 ` [dpdk-dev] [PATCH v3 0/7] Sync with MUSDK-17.10 Ferruh Yigit
7 siblings, 0 replies; 32+ messages in thread
From: Tomasz Duszynski @ 2017-12-05 9:39 UTC (permalink / raw)
To: dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu, Tomasz Duszynski
Update MRVL NET PMD documentation.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
doc/guides/nics/mrvl.rst | 69 +++++++++++++++++++++++++++++++-----------------
1 file changed, 45 insertions(+), 24 deletions(-)
diff --git a/doc/guides/nics/mrvl.rst b/doc/guides/nics/mrvl.rst
index fbfdf47..67b254c 100644
--- a/doc/guides/nics/mrvl.rst
+++ b/doc/guides/nics/mrvl.rst
@@ -87,31 +87,40 @@ Limitations
Prerequisites
-------------
-- Custom Linux Kernel sources available
- `here <https://github.com/MarvellEmbeddedProcessors/linux-marvell/tree/linux-4.4.52-armada-17.08>`__.
+- Custom Linux Kernel sources
-- Out of tree `mvpp2x_sysfs` kernel module sources available
- `here <https://github.com/MarvellEmbeddedProcessors/mvpp2x-marvell/tree/mvpp2x-armada-17.08>`__.
+ .. code-block:: console
-- MUSDK (Marvell User-Space SDK) sources available
- `here <https://github.com/MarvellEmbeddedProcessors/musdk-marvell/tree/musdk-armada-17.08>`__.
+ git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell.git -b linux-4.4.52-armada-17.10
- MUSDK is a light-weight library that provides direct access to Marvell's
- PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
- requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
- approval has been granted, library can be found by typing ``musdk`` in
- the search box.
+- Out of tree `mvpp2x_sysfs` kernel module sources
- MUSDK must be configured with the following features:
+ .. code-block:: console
- .. code-block:: console
+ git clone https://github.com/MarvellEmbeddedProcessors/mvpp2x-marvell.git -b mvpp2x-armada-17.10
- --enable-bpool-dma=64
+- MUSDK (Marvell User-Space SDK) sources
+
+ .. code-block:: console
+
+ git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-armada-17.10
+
+ MUSDK is a light-weight library that provides direct access to Marvell's
+ PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
+ requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
+ approval has been granted, library can be found by typing ``musdk`` in
+ the search box.
+
+ MUSDK must be configured with the following features:
+
+ .. code-block:: console
+
+ --enable-bpool-dma=64
- DPDK environment
- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
- DPDK environment.
+ Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
+ DPDK environment.
Config File Options
@@ -123,11 +132,6 @@ The following options can be modified in the ``config`` file.
Toggle compilation of the librte_pmd_mrvl driver.
-- ``CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE`` (default ``41943040``)
-
- Size in bytes of the contiguous memory region that MUSDK will allocate
- for run-time DMA-able data buffers.
-
QoS Configuration
-----------------
@@ -142,7 +146,7 @@ Configuration syntax
[port <portnum> default]
default_tc = <default_tc>
- qos_mode = <qos_priority>
+ mapping_priority = <mapping_priority>
[port <portnum> tc <traffic_class>]
rxq = <rx_queue_list>
@@ -160,7 +164,7 @@ Where:
- ``<default_tc>``: Default traffic class (e.g. 0)
-- ``<qos_priority>``: QoS priority for mapping (`ip`, `vlan`, `ip/vlan` or `vlan/ip`).
+- ``<mapping_priority>``: QoS priority for mapping (`ip`, `vlan`, `ip/vlan` or `vlan/ip`).
- ``<traffic_class>``: Traffic Class to be configured.
@@ -218,9 +222,26 @@ Building DPDK
Driver needs precompiled MUSDK library during compilation. Please consult
``doc/musdk_get_started.txt`` for the detailed build instructions.
+.. code-block:: console
+
+ export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
+ ./bootstrap
+ ./configure --enable-bpool-dma=64
+ make install
+
+MUSDK will be installed to `usr/local` under current directory.
+For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
+
Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
the path to the MUSDK installation directory needs to be exported.
+.. code-block:: console
+
+ export LIBMUSDK_PATH=<musdk>/usr/local
+ export CROSS=aarch64-linux-gnu-
+ make config T=arm64-armv8a-linuxapp-gcc
+ sed -ri 's,(MRVL_PMD=)n,\1y,' build/.config
+ make
Usage Example
-------------
@@ -242,7 +263,7 @@ Additionally interfaces used by DPDK application need to be put up:
.. code-block:: console
ip link set eth0 up
- ip link set eth1 up
+ ip link set eth2 up
In order to run testpmd example application following command can be used:
--
2.7.4
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/7] Sync with MUSDK-17.10
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
` (6 preceding siblings ...)
2017-12-05 9:39 ` [dpdk-dev] [PATCH v3 7/7] net/mrvl: update MRVL NET PMD documentation Tomasz Duszynski
@ 2017-12-07 1:13 ` Ferruh Yigit
7 siblings, 0 replies; 32+ messages in thread
From: Ferruh Yigit @ 2017-12-07 1:13 UTC (permalink / raw)
To: Tomasz Duszynski, dev; +Cc: mw, jck, dima, nsamsono, jianbo.liu
On 12/5/2017 1:39 AM, Tomasz Duszynski wrote:
> This patchset brings following changes:
>
> o Sync with MUSDK-17.10. Latest version of the library comes with many
> improvements and fixes thus switching to it is beneficial.
>
> o A few code and documentation updates.
>
> Changes since v2:
> o Fix NET PMD conditional compilation in test-build.sh
>
> Changes since v1:
> o Add extra error log in case setting link up fails.
> o Cram all MUSDK related headers into the same the driver header.
>
> Tomasz Duszynski (7):
> net/mrvl: sync compilation with musdk-17.10
> net/mrvl: query link status using library API
> net/mrvl: do not enable port after setting MAC address
> net/mrvl: check if ppio is initialized
> net/mrvl: add extra error logs
> devtools/test-build: add MRVL NET PMD to test-build
> net/mrvl: update MRVL NET PMD documentation
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 32+ messages in thread