Commit Graph

36 Commits

Author SHA1 Message Date
Tomasz Duszynski
82c4f93279 net/mrvl: switch to the new Rx offload API
Since the old Rx offload API is now depracated
update the driver to use the latest one.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2018-01-29 10:04:28 +01:00
Ferruh Yigit
ffc905f3b8 ethdev: separate driver APIs
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.

There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.

More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-22 01:26:49 +01:00
Tomasz Duszynski
9f7d41e6a7 net/mrvl: allow adding MAC address before port init
Since DPDK restores ether address configuration after device
is started it is safe to add ether address to uninitialized port (ppio).

Fixes: c0511a8f74 ("net/mrvl: check if ppio is initialized")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2018-01-21 15:51:52 +01:00
Tomasz Duszynski
59c796c889 net/mrvl: allow changing MTU before port init
DPDK updates MTU once mtu_set() callback returns success.
Since PMD changes port's MTU to dev->mtu every time device is
started it is safe to call mtu_set() before MUSDK ppio was initialized.

Fixes: c0511a8f74 ("net/mrvl: check if ppio is initialized")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2018-01-21 15:51:52 +01:00
Natalie Samsonov
c49ef7ef7f net/mrvl: keep shadow Txqs inside PMD Txq
Change shadow queues allocation from port/core to txq/core.
Use array of shadow queues (one per lcore) for each tx queue object to
avoid data corruption when few tx queues are handled by one lcore and
buffers that were not sent yet, can be released and used for receive.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")
Cc: stable@dpdk.org

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
2018-01-16 18:47:49 +01:00
Natalie Samsonov
b2e5d0868e net/mrvl: fix shadow queue tail and size calculations
Reset skip_buf after use to avoid wrong tail and size calculations.

Fixes: afb4d0d0bf ("net/mrvl: add Rx/Tx support")
Cc: stable@dpdk.org

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
2018-01-16 18:47:49 +01:00
Natalie Samsonov
a9bd1322b8 net/mrvl: fix oversize bpool handling
Don't return mbuf to dpdk pool if failed to get buffer from the bpool.
Fix maximum bpool size calculation to prevent unnecessary bpool
oversize cases when working with small rx queues.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")
Cc: stable@dpdk.org

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
2018-01-16 18:47:49 +01:00
Natalie Samsonov
3588aaa68e net/mrvl: fix HIF objects allocation
1. Add checking for non-EAL threads.

2. Create hif objects on first use since sometimes on probe not all
   lcores are initialized and can be added later.
   In this case the hif objects for later cores were not created and
   this caused system crash.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")
Cc: stable@dpdk.org

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
2018-01-16 18:47:49 +01:00
Natalie Samsonov
10bce9cf9b net/mrvl: fix multiple probe
MUSDK library initialization and cleanup should be done once.
This commit fixes that by doing necessary initialization once the first
port is probed and cleanup once the last port is removed.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")
Cc: stable@dpdk.org

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
2018-01-16 18:47:49 +01:00
Tomasz Duszynski
1a05aff28c net/mrvl: add extra error logs
Add extra error logs in a few places.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
2018-01-16 18:47:49 +01:00
Tomasz Duszynski
c0511a8f74 net/mrvl: check if ppio is initialized
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>
2018-01-16 18:47:49 +01:00
Tomasz Duszynski
004afcde78 net/mrvl: do not enable port after setting MAC address
Setting enabled port's mac address caused it to stop receiving
packets. Now as that issue is fixed in library reenabling port
is no longer necessary.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
2018-01-16 18:47:49 +01:00
Tomasz Duszynski
c21051624d net/mrvl: query link status using library API
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>
2018-01-16 18:47:49 +01:00
Tomasz Duszynski
c2b1c48ac1 drivers: switch mrvl to musdk-17.10
Following 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 auto generated 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>
2018-01-16 18:47:49 +01:00
Jianfeng Tan
d4a586d29e bus/vdev: move code from EAL into a new driver
Move the vdev bus from lib/librte_eal to drivers/bus.

As the crypto vdev helper function refers to data structure
in rte_vdev.h, so we move those helper function into drivers/bus
too.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2017-11-07 16:54:07 +01:00
Tomasz Duszynski
629bccc440 net/mrvl: reset errno before library call
In case errno contains some non-zero value and call to strtoul() is
successful -2 error will be returned.

Setting errno to zero before calling strtoul() makes sure
errors will be handled correctly.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-11-02 19:42:11 +01:00
Thomas Monjalon
bfa9a8a460 mbuf: rename data address helpers to IOVA
The following inline functions and macros have been renamed to be
consistent with the IOVA wording:

rte_mbuf_data_dma_addr         -> rte_mbuf_data_iova
rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
rte_pktmbuf_mtophys            -> rte_pktmbuf_iova
rte_pktmbuf_mtophys_offset     -> rte_pktmbuf_iova_offset

The deprecated functions and macros are kept to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-11-06 22:44:26 +01:00
Thomas Monjalon
f1a7a5c5f4 remove include of generated config header
The file rte_config.h is generated and automatically included
with -include option.
The explicit includes in drivers and libraries are useless.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-11-06 21:56:07 +01:00
Tomasz Duszynski
00fabc423d net/mrvl: update copyright holders
Add Marvell International Ltd. to the copyright holders.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")
Fixes: 1a286a1139 ("doc: add mrvl NIC guide")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-26 02:33:00 +02:00
Tomasz Duszynski
b32a42e4d6 net/mrvl: remove DMA buffer size from configuration
RTE_MRVL_MUSDK_DMA_MEMSIZE can be removed from DPDK configuration
as it's no longer used as a synchronization point for net and crypto
mrvl pmds.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-26 02:33:00 +02:00
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Zhiyong Yang
e6399f6b90 net/mrvl: fix port id type
port id should be defined as uint16_t.

Fixes: f8244c6399 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-13 21:57:48 +02:00
Matan Azrad
d5b0924ba6 ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot
return an error in case of failure at stats getting process time.

Since PCI devices can be removed and there is a time between the
physical removal to the RMV interrupt, the user may get invalid stats
without any indication.

This patch changes the stats_get API return value to be int instead of
void.

All the net PMDs stats_get dev ops are adjusted by this patch.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-12 01:52:49 +01:00
Tomasz Duszynski
bdffe0c70a net/mrvl: support basic stats
Add support for both per queue and overall basic statistics.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
f3f0d77db6 net/mrvl: support packet type parsing
Add packet type parsing support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
6ba75e403c net/mrvl: support CRC and L3/L4 offloads
Add support for crc offload and l3/l4 checksum offloads.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
a8f3d6783a net/mrvl: support VLAN filtering
Add support for vlan filtering.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
a20e0cd897 net/mrvl: support RSS hashing
Add support for rss hashing on rx.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
079bd31749 net/mrvl: support MAC filtering
Add support for unicast and multicast mac filters.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
b8b8c9962e net/mrvl: support for promiscuous and allmulticast
Add support for promiscuous and allmulticast modes.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
9b6924e957 net/mrvl: support jumbo frame
Add jumbo frame support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
e53f0eb532 net/mrvl: support updating MTU
Add support for updating mtu.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
d9e7317e1b net/mrvl: add link speed capabilities
Return supported link speed capabilities via rte_dev_info_get().

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
b684847a33 net/mrvl: add link update
Add support for retrieving physical link information i.e:
speed, duplex and link status.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
afb4d0d0bf net/mrvl: add Rx/Tx support
Add rx/tx support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00
Tomasz Duszynski
0ddc9b815b net/mrvl: add net PMD skeleton
Add mrvl net pmd driver skeleton providing base for the further
development. Besides the basic functionality QoS configuration is
introduced as well.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-12 01:36:58 +01:00