Anoob Joseph [Tue, 9 Oct 2018 09:07:39 +0000 (14:37 +0530)]
crypto/octeontx: add global resource init
Adding initialization of global resources. This will be saved as
metadata in cptvf and would be used by common code. Exit path for
failure case is also added along with the new routines.
Anoob Joseph [Tue, 9 Oct 2018 09:07:38 +0000 (14:37 +0530)]
common/cpt: add PMD ops helper functions
Adding pmd ops helper functions. Control path accessed APIs would be
added as helper functions. Adding microcode defined macros etc as
dependencies to the helper functions.
Anoob Joseph [Tue, 9 Oct 2018 09:07:34 +0000 (14:37 +0530)]
crypto/octeontx: add PMD skeleton
Adding OCTEON TX crypto PMD skeleton. Updating the maintainers files to
claim responsibility. Also enabling driver by default by adding the
component in common_base.
Zyta Szpak [Mon, 27 Aug 2018 12:22:52 +0000 (14:22 +0200)]
crypto/mvsam: support scatter gather
The patch adds support for chained source mbufs given
to crypto operations. The crypto engine accepts source buffer
containing a number of segments. The destination buffer
stays the same - always one segment.
On decryption, EIP engine will look for digest at 'auth_icv_offset'
offset in SRC buffer.It must be placed in the last segment and the
offset must be set to reach digest in the last segment.
If application doesn't placed digest in source mbuf, driver try to
copy it to a last segment.
Thomas Monjalon [Wed, 19 Sep 2018 23:37:14 +0000 (01:37 +0200)]
eal: allow probing a device again
In the devargs syntax for device representors, it is possible to add
several devices at once: -w dbdf,representor=[0-3]
It will become a more frequent case when introducing wildcards
and ranges in the new devargs syntax.
If a devargs string is provided for probing, and updated with a bigger
range for a new probing, then we do not want it to fail because
part of this range was already probed previously.
There can be new ports to create from an existing rte_device.
That's why the check for an already probed device
is moved as bus responsibility.
In the case of vdev, a global check is kept in insert_vdev(),
assuming that a vdev will always have only one port.
In the case of ifpga and vmbus, already probed devices are checked.
In the case of NXP buses, the probing is done only once (no hotplug),
though a check is added at bus level for consistency.
In the case of PCI, a driver flag is added to allow PMD probing again.
Only the PMD knows the ports attached to one rte_device.
As another consequence of being able to probe in several steps,
the field rte_device.devargs must not be considered as a full
representation of the rte_device, but only the latest probing args.
Anyway, the field rte_device.devargs is used only for probing.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Tested-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Thomas Monjalon [Tue, 25 Sep 2018 20:55:27 +0000 (22:55 +0200)]
eal: add function to query device status
The function rte_dev_is_probed() is added in order to improve semantic
and enforce proper check of the probing status of a device.
It will answer this rte_device query:
Is it already successfully probed or not?
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Thomas Monjalon [Tue, 25 Sep 2018 20:55:27 +0000 (22:55 +0200)]
drivers/bus: move driver assignment to end of probing
The PCI mapping requires to know the PCI driver to use,
even before the probing is done. That's why the PCI driver is
referenced early inside the PCI device structure. See
commit 1d20a073fa5e ("bus/pci: reference driver structure before mapping")
However the rte_driver does not need to be referenced in rte_device
before the device probing is done.
By moving back this assignment at the end of the device probing,
it becomes possible to make clear the status of a rte_device.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Tested-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Thomas Monjalon [Thu, 11 Oct 2018 12:58:49 +0000 (14:58 +0200)]
ethdev: rename memzones allocated for DMA
The helper rte_eth_dma_zone_reserve() is called by PMDs
when probing a new port.
It creates a new memzone with an unique name.
The name of this memzone was using the name of the driver
doing the probe.
In order to avoid assigning the driver before the end of the probing,
the driver name is removed from these memzone names.
The ethdev name (data->name) is not used because it may be too long
and may be not set at this stage of probing.
Syntax of old name: <driver>_<ring>_<port>_<queue>
Syntax of new name: eth_p<port>_q<queue>_<ring>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Thomas Monjalon [Sun, 14 Oct 2018 13:06:54 +0000 (15:06 +0200)]
net/mlx5: remove useless driver name comparison
The function mlx5_dev_to_port_id() is returning all the ports
associated to a rte_device.
It was comparing driver names while already comparing rte_device pointers.
If two devices are the same, they will have the same driver.
So the useless driver name comparison is removed.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Qi Zhang [Tue, 16 Oct 2018 00:16:32 +0000 (08:16 +0800)]
examples/multi_process: add hotplug sample
The sample code demonstrates device (ethdev only) management
at a multi-process environment. The user can attach/detach a
device on primary process and see it is synced on secondary
process automatically.
How to start?
./hotplug_mp --proc-type=auto
Command Line Example:
>help
>list
/* attach a pci device */
> attach 0000:81:00.0
/* detach the pci device */
> detach 0000:81:00.0
/* attach a vdev af_packet device */
> attach net_af_packet,iface=eth0
/* detach the vdev af_packet device */
> detach net_af_packet
Qi Zhang [Tue, 16 Oct 2018 00:16:31 +0000 (08:16 +0800)]
drivers/net: enable device detach on secondary process
With the enabling for hotplug on multi-process,
rte_eth_dev_pci_generic_remove can be used to detach the device from
a secondary process also. But we need to take care of the uninit callback
parameter to make sure it handles the secondary case correctly.
Qi Zhang [Tue, 16 Oct 2018 00:16:30 +0000 (08:16 +0800)]
drivers/net: enable hotplug on secondary process
Attach port from secondary should ignore devargs since the private
device is not necessary to support. Also previously, detach port on
a secondary process will mess primary process and cause the same
device can't be attached back again. A secondary process should use
rte_eth_dev_release_port_secondary to release a port.
Qi Zhang [Tue, 16 Oct 2018 00:16:29 +0000 (08:16 +0800)]
eal: support attach/detach shared device from secondary
This patch cover the multi-process hotplug case when a device
attach/detach request be issued from a secondary process
device attach on secondary:
a) secondary send sync request to the primary.
b) primary receive the request and attach the new device if
failed goto i).
c) primary forward attach sync request to all secondary.
d) secondary receive the request and attach the device and send a reply.
e) primary check the reply if all success goes to j).
f) primary send attach rollback sync request to all secondary.
g) secondary receive the request and detach the device and send a reply.
h) primary receive the reply and detach device as rollback action.
i) send attach fail to secondary as a reply of step a), goto k).
j) send attach success to secondary as a reply of step a).
k) secondary receive reply and return.
device detach on secondary:
a) secondary send sync request to the primary.
b) primary send detach sync request to all secondary.
c) secondary detach the device and send a reply.
d) primary check the reply if all success goes to g).
e) primary send detach rollback sync request to all secondary.
f) secondary receive the request and attach back device. goto h).
g) primary detach the device if success goto i), else goto e).
h) primary send detach fail to secondary as a reply of step a), goto j).
i) primary send detach success to secondary as a reply of step a).
j) secondary receive reply and return.
Qi Zhang [Tue, 16 Oct 2018 00:16:28 +0000 (08:16 +0800)]
eal: enable hotplug on multi-process
We are going to introduce the solution to handle hotplug in
multi-process, it includes the below scenario:
1. Attach a device from the primary
2. Detach a device from the primary
3. Attach a device from a secondary
4. Detach a device from a secondary
In the primary-secondary process model, we assume devices are shared
by default. that means attaches or detaches a device on any process
will broadcast to all other processes through mp channel then device
information will be synchronized on all processes.
Any failure during attaching/detaching process will cause inconsistent
status between processes, so proper rollback action should be considered.
This patch covers the implementation of case 1,2.
Case 3,4 will be implemented on a separate patch.
IPC scenario for Case 1, 2:
attach a device
a) primary attach the new device if failed goto h).
b) primary send attach sync request to all secondary.
c) secondary receive request and attach the device and send a reply.
d) primary check the reply if all success goes to i).
e) primary send attach rollback sync request to all secondary.
f) secondary receive the request and detach the device and send a reply.
g) primary receive the reply and detach device as rollback action.
h) attach fail
i) attach success
detach a device
a) primary send detach sync request to all secondary
b) secondary detach the device and send reply
c) primary check the reply if all success goes to f).
d) primary send detach rollback sync request to all secondary.
e) secondary receive the request and attach back device. goto g)
f) primary detach the device if success goto g), else goto d)
g) detach fail.
h) detach success.
Qi Zhang [Tue, 16 Oct 2018 00:16:27 +0000 (08:16 +0800)]
ethdev: add function to release port in secondary process
Add driver API rte_eth_release_port_secondary to support the
case when an ethdev need to be detached on a secondary process.
Local state is set to unused and shared data will not be reset
so the primary process can still use it.
However, Except the first file, the change missed to include
<rte_vfio.h> where HAVE_VFIO_DEV_REQ_INTERFACE defined.
This creates runtime following error on vfio-pci mode and
kernel >= 4.0.0 combination.
EAL: [rte_intr_enable] Unknown handle type of fd 95
EAL: [pci_vfio_enable_notifier]Fail to enable req notifier.
EAL: Fail to unregister req notifier handler.
EAL: Error setting up notifier!
EAL: Requested device 0000:07:00.1 cannot be used
Fixes: cda94419964f ("vfio: fix build with Linux < 4.0") Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Hemant Agrawal [Fri, 12 Oct 2018 10:04:24 +0000 (15:34 +0530)]
net/dpaa2: enhance queue memory cleanup
Earlier the tx queue data was getting cleaned up in close
while rest of the functionality was in un-init.
Now a new func is created to free queue memory.
Shreyansh Jain [Fri, 12 Oct 2018 10:04:21 +0000 (15:34 +0530)]
net/dpaa2: support statistics per queue
For now, only the packet count stats per queue is available. This is
part of xstats output (though, per queue stats are actually part of
rte_eth_stats basic stats).
Shreyansh Jain [Fri, 12 Oct 2018 10:04:20 +0000 (15:34 +0530)]
net/dpaa2: read hardware provided MAC for DPNI devices
Firmware would contain pre-configured devices for each DPMAC backing
a DPNI. This patch reads those MAC address when the device is
initialized and sets it. THereafter, it can be changed through API or
commands from testpmd.
Shreyansh Jain [Mon, 15 Oct 2018 12:01:56 +0000 (17:31 +0530)]
fslmc: enable dpaax library
With this patch, fslmc bus and ethernet devices on this bus
would start using the physical-virtual library interfaces.
This patch impacts mempool/dpaa2, event/dpaa2, net/dpaa2,
raw/dpaa2_cmdif and raw/dpaa2_qdma as they are dependent
on the bus/fslmc and thus impact linkage of libraries.
Shreyansh Jain [Mon, 15 Oct 2018 12:01:54 +0000 (17:31 +0530)]
common/dpaax: add library for PA/VA translation table
A common library, valid for dpaaX drivers, which is used to maintain
a local copy of PA->VA translations.
In case of physical addressing mode (one of the option for FSLMC, and
only option for DPAA bus), the addresses of descriptors Rx'd are
physical. These need to be converted into equivalent VA for rte_mbuf
and other similar calls.
Using the rte_mem_virt2iova or rte_mem_virt2phy is expensive. This
library is an attempt to reduce the overall cost associated with
this translation.
A small table is maintained, containing continuous entries
representing a continguous physical range. Each of these entries
stores the equivalent VA, which is fed during mempool creation, or
memory allocation/deallocation callbacks.
Jeff Guo [Tue, 16 Oct 2018 11:42:33 +0000 (19:42 +0800)]
vfio: fix build with Linux < 4.0
Since the older kernel version do not implement the device request
interface for vfio, so when build on the kernel < v4.0.0, which is
the version begin to add the device request interface, it will
throw the error to show “VFIO_PCI_REQ_IRQ_INDEX” is undeclared.
This patch aim to fix this compile issue by add the macro
“HAVE_VFIO_DEV_REQ_INTERFACE” after checking the kernel version.
Jeff Guo [Thu, 4 Oct 2018 06:44:43 +0000 (14:44 +0800)]
vfio: handle hotplug request notifier
When device is be hot-unplugged, the vfio kernel module will sent req
notifier to request user space to release the allocated resources at
first. After that, vfio kernel module will detect the device disappear,
and then delete the device in kernel.
This patch aim to add req notifier processing to enable hotplug for vfio.
By enable the req notifier monitoring and register the notifier callback,
when device be hot-unplugged, the hot-unplug handler will be called to
process hotplug for vfio.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Jeff Guo [Thu, 4 Oct 2018 06:44:42 +0000 (14:44 +0800)]
bus/pci: add VFIO request interrupt handle to device
There are some extended interrupt types in vfio pci device except from the
existing interrupts, such as err and req notifier, they could be useful for
device error monitoring. And these corresponding interrupt handler is
different from the other interrupt handler that register in PMDs, so a new
interrupt handler should be added. This patch will add specific req handler
in generic pci device.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Jeff Guo [Thu, 4 Oct 2018 06:44:41 +0000 (14:44 +0800)]
eal: modify device event process function
This patch modify the device event callback process function name to be
more explicit, change the variable to be const. And more, because not only
eal device helper will use the callback, but also vfio bus will use the
callback to handle hot-unplug, so exposure the API out from private eal.
The bus drivers and eal device would directly use this API to process
device event callback.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Jeff Guo [Mon, 15 Oct 2018 11:27:27 +0000 (19:27 +0800)]
app/testpmd: use hotplug failure handler
This patch use testpmd for example, to show how an app smoothly handle
failure when device be hot-unplug. Except that app should enabled the
device event monitor and register the hotplug event’s callback, it also
need enable hotplug handle mechanism before running. Once app detect the
removal event, the hot-unplug callback would be called. It will first stop
the packet forwarding, then stop the port, close the port, and finally
detach the port to clean the device and release the resources.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Jeff Guo [Mon, 15 Oct 2018 11:27:26 +0000 (19:27 +0800)]
eal: add failure handling for hot-unplug
The mechanism can initially register the sigbus handler after the device
event monitor is enabled. When a sigbus event is captured, it will check
the failure address and accordingly handle the memory failure of the
corresponding device by invoke the hot-unplug handler. It could prevent
the application from crashing when a device is hot-unplugged.
By this patch, users could call below new added APIs to enable/disable
the device hotplug handle mechanism. Note that it just implement the
hot-unplug handler in these functions, the other handler of hotplug, such
as handler for hotplug binding, could be add in the future if need:
- rte_dev_hotplug_handle_enable
- rte_dev_hotplug_handle_disable
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Jeff Guo [Mon, 15 Oct 2018 11:27:24 +0000 (19:27 +0800)]
bus/pci: support sigbus handler
This patch implements the ops for the PCI bus sigbus handler. It finds the
PCI device that is being hot-unplugged and calls the relevant ops of the
hot-unplug handler to handle the hot-unplug failure of the device.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Shaopeng He <shaopeng.he@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Jeff Guo [Mon, 15 Oct 2018 11:27:23 +0000 (19:27 +0800)]
bus: add sigbus handler
When a device is hot-unplugged, a sigbus error will occur of the datapath
can still read/write to the device. A handler is required here to capture
the sigbus signal and handle it appropriately.
This patch introduces a bus ops to handle sigbus errors. Each bus can
implement its own case-dependent logic to handle the sigbus errors.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Shaopeng He <shaopeng.he@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Jeff Guo [Mon, 15 Oct 2018 11:27:22 +0000 (19:27 +0800)]
bus/pci: support hot-unplug handler
This patch implements the ops to handle hot-unplug on the PCI bus.
For UIO PCI, it could avoids BARs read/write errors by creating a
new dummy memory to remap the memory where the failure is. For VFIO
or other kernel driver, it could specific implement function to handle
hot-unplug case by case.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Shaopeng He <shaopeng.he@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Jeff Guo [Mon, 15 Oct 2018 11:27:21 +0000 (19:27 +0800)]
bus: add hot-unplug handler
A hot-unplug failure and app crash can be caused, when a device is
hot-unplugged but the application still try to access the device
by reading or writing from the BARs, which is already invalid but
still not timely be unmap or released.
This patch introduces bus ops to handle hot-unplug failures. Each
bus can implement its own case-dependent logic to handle the failures.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This patch introduces a new table action for packet decapsulation
which removes n bytes from the start of the input packet. The n
is read from the current table entry. The following mbuf fields
are updated by the action: data_off, data_len, pkt_len.
This patch introduces the packet tag table action which attaches
a 32-bit value (the tag) to the current input packet. The tag is
read from the current table entry. The tag is written into the
mbuf->hash.fdir.hi and the flags PKT_RX_FDIR and PKT_RX_FDIR_ID
are set into mbuf->ol_flags.
Fan Zhang [Fri, 28 Sep 2018 12:26:09 +0000 (13:26 +0100)]
pipeline: add symmetric crypto table action
This patch adds the symmetric crypto action support to pipeline
library. The symmetric crypto action works as the shim layer
between pipeline and DPDK cryptodev and is able to interact with
cryptodev with the control path requests such as session
creation/deletion and data path work to assemble the crypto
operations for received packets.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Fan Zhang [Mon, 1 Oct 2018 10:02:23 +0000 (11:02 +0100)]
port: add symmetric crypto
This patch adds the symmetric crypto support to port library.
The crypto port acts as a shim layer to DPDK cryptodev library and
supports in-place crypto workload processing.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>