Commit Graph

41 Commits

Author SHA1 Message Date
Jan Blunck
5d2aa461cb vdev: use generic vdev struct for probe and remove
This is a preparation to embed the generic rte_device into the rte_eth_dev
also for virtual devices.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-04-14 15:41:50 +02:00
Ferruh Yigit
1e846151cf event/sw: fix build for gcc 4.5.1
build error:
.../event/sw/sw_evdev_worker.c: In function ‘sw_event_release’:
.../event/sw/sw_evdev_worker.c:52:3: error: unknown field ‘op’ specified
in initializer

Fixed by updating struct initialization.

Fixes: 656af91800 ("event/sw: add worker core functions")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-06 20:40:31 +02:00
Ferruh Yigit
1daa21de5b event/octeontx: fix build for gcc < 4.6
-Ofast option supported from gcc4.6 [1], for older versions using
"-O3 -ffast-math" instead.

[1] build error:
cc1: error: invalid option argument ‘-Ofast’

Also struct initialization build error [2] fixed.

[2] build error:
.../event/octeontx/ssovf_mbox.c: In function ‘mbox_send_request’:
.../event/octeontx/ssovf_mbox.c:95:9: error: unknown field ‘u64’
specified in initializer

Fixes: 32ff26393b ("event/octeontx: add SSO HW device operations")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-06 20:40:31 +02:00
Ferruh Yigit
fa865c012b event/sw: fix build with icc
build error:
.../drivers/event/sw/sw_evdev_scheduler.c(379):
error #300: const variable "dummy_rob" requires an initializer
        static const struct reorder_buffer_entry dummy_rob;
                                                          ^

Variable "dummy_rob" defined as const but already cast to another
pointer and its content updated. Remove const qualifier from variable.

Fixes: 617995dfc5 ("event/sw: add scheduling logic")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-04-05 18:20:42 +02:00
Ferruh Yigit
a175e38f2e event/octeontx: fix build with icc
build error:
.../drivers/event/octeontx/ssovf_worker.c(212):
error #592: variable "get_work0" is used before its value is set
        RTE_SET_USED(get_work0);
        ^

.../drivers/event/octeontx/ssovf_worker.c(213):
error #592: variable "get_work1" is used before its value is set
        RTE_SET_USED(get_work1);
        ^
For x86 these variables set but not used, move macros below
where values assigned.

Fixes: f61808eaa9 ("event/octeontx: add start function")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-04-05 18:20:42 +02:00
Jerin Jacob
619d54c634 event/octeontx: add stop and close functions
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
f61808eaa9 event/octeontx: add start function
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
d80f50e829 event/octeontx: support worker dequeue
If device is configured with RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT
configuration then use different fast path dequeue handler to wait till
requested amount of nanosecond if the event is not available.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
f10d322eff event/octeontx: support worker enqueue
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
32ff26393b event/octeontx: add SSO HW device operations
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
558413c004 event/octeontx: add dump function for easier debugging
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
613c702771 event/octeontx: support dequeue timeout tick conversion
SSO co-processor runs at a different frequency than core clock.
Request PF to convert the ns to SSO get_work timeout period.
On dequeue, If device is configured with
RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT configuration then
use different fast path dequeue handler to wait till requested
amount of nanosecond if the event is not available.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
35a228ac50 event/octeontx: support linking queues to ports
queues to port link and unlink establishment is through
setting/resetting the queue/group membership in
SSOW_VHWS_GRPMSK_CHGX

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
708bac973a event/octeontx: support event ports
Add in the data-structures for the ports used by workers
to sent events to/from the HW scheduler. Also add a
function to release the resource allocated in setup

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
d44a26ff0c event/octeontx: support event queues
Pretty much everything done in HW. Need to configure
the priority associated with event queue aka sso group
through a mailbox request to PF

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
f14b5ac23a event/octeontx: add configure function
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
8b3808cac6 event/octeontx: add device capabilities function
Add the info_get function to return details on the queues, flow,
prioritization capabilities, etc. which this device has.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
34498de600 event/octeontx: add octeontx eventdev driver
This adds the minimal changes to allow a octeontx eventdev
implementation to be compiled, linked and created at run time.
The eventdev does nothing, but can be created via vdev
on command line, e.g.

sudo ./build/app/test -c 0xff00 --vdev=event_octeontx
...
Initializing event_octeontx domain=4 max_queues=64 max_ports=32
RTE>>

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
6da9d24574 event/octeontx: add mailbox support
ssovf VF device has mailbox mechanism to communicate
with PF device. This patch adds support for a mbox API to
send the mailbox request to PF device.
The ssovf VF device will be used as the communication channel
to talk to PF devices of all the network accelerated
co-processors in Octeontx. Exposing as shared function to
use it from pool, crypto, network devices.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
a5d4742d15 event/octeontx: add vdev interface functions
ssovf and ssowvf PCIe VF devices are shared
between eventdev PMD and ethdev PMD. This patch
expose a set of interface API to get info
about probed ssovf and ssowvf VF resources to use
with eventdev and ethdev vdev devices latter.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
7a78125590 event/octeontx: probe ssowvf pcie devices
An event device consists of event queues and event ports.
On Octeontx HW, each event queues(sso group/ssovf) and
event ports(sso hws/ssowvf) are enumerated as separate
SRIOV VF PCIe device. In order to expose as an event device,
On PCIe probe, the driver stores the information associated
with the PCIe device and later with vdev infrastructure
creates event device with earlier probed PCIe VF devices.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
00e2be3b62 event/octeontx: probe ssovf pcie devices
An event device consists of event queues and event ports.
On Octeontx HW, each event queues(sso group/ssovf) and
event ports(sso hws/ssowvf) are enumerated as separate
SRIOV VF PCIe device. In order to expose as an event device,
On PCIe probe, the driver stores the information associated
with the PCIe device and later with vdev infrastructure
creates event device with earlier probed PCIe VF devices.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Jerin Jacob
8db0b7de88 event/octeontx: add build and log infrastructure
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:52 +02:00
Bruce Richardson
c1ad03df7a event/sw: support xstats
Add support for xstats to report out on the state of the eventdev.
Useful for debugging and for unit tests, as well as observability
at runtime and performance tuning of apps to work well with the
scheduler.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2017-04-04 19:19:52 +02:00
Bruce Richardson
c66baa68e4 event/sw: add dump function for easier debugging
Segfault issue resolved when only partially configured and
rte_event_dev_dump() is called before start(),

Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2017-04-04 19:19:52 +02:00
Bruce Richardson
374acbf7aa event/sw: add start stop and close functions
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:52 +02:00
Bruce Richardson
617995dfc5 event/sw: add scheduling logic
Add in the scheduling function which takes the events from the
producer queues and buffers them before scheduling them to consumer
queues. The scheduling logic includes support for atomic, reordered,
and parallel scheduling of flows.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
656af91800 event/sw: add worker core functions
add the event enqueue, dequeue and release functions to the eventdev.
These also include tracking of stats for observability in the load of
the scheduler.
Internally in the enqueue function, the various types of enqueue
operations, to forward an existing event, to send a new event, to
drop a previous event, are converted to a series of flags which will
be used by the scheduler code to perform the needed actions for that
event.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
371a688fc1 event/sw: support linking queues to ports
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
98dc055fd4 event/sw: support event ports
Add in the data-structures for the ports used by workers to send
packets to/from the scheduler. Also add in the functions to
create/destroy those ports.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
5ffb2f142d event/sw: support event queues
Add in the data structures for the event queues, and the eventdev
functions to create and destroy those queues.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
1a3a4531dc event/sw: return default port/queue config
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
1c6c0e4c31 event/sw: add configure function
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
b88e2b73c1 event/sw: add device capabilities function
Add in the info_get function to return details on the queues, flow,
prioritization capabilities, etc. that this device has.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Bruce Richardson
aaa4a221da event/sw: add new software-only eventdev driver
This adds the minimal changes to allow a SW eventdev implementation to
be compiled, linked and created at run time. The eventdev does nothing,
but can be created via vdev on commandline, e.g.

  sudo ./x86_64-native-linuxapp-gcc/app/test --vdev=event_sw0
  ...
  PMD: Creating eventdev sw device event_sw0, numa_node=0, sched_quanta=128
  RTE>>

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Harry van Haaren
361e733645 eventdev: remove default queue overriding
PMDs that only do a specific type of scheduling cannot provide
CFG_ALL_TYPES, so the Eventdev infrastructure should not demand
that every PMD supports CFG_ALL_TYPES.

By not overriding the default configuration of the queue as
suggested by the PMD, the eventdev_common unit tests can pass
on all PMDs, regardless of their capabilities.

RTE_EVENT_QUEUE_CFG_DEFAULT is no longer used by the eventdev layer
it can be removed now. Applications should use CFG_ALL_TYPES
if they require enqueue of all types a queue, or specify which
type of queue they require.

The CFG_DEFAULT value is changed to CFG_ALL_TYPES in event/skeleton,
to not break the compile.

A capability flag is added that indicates if the underlying PMD
supports creating queues of ALL_TYPES.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:19:51 +02:00
Jerin Jacob
836a9ddc3f eventdev: return code in dequeue timeout conversion
eventdev driver may return error on dequeue timeout tick conversion.
Change the pmd callback interface to address the same.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:17:39 +02:00
Nipun Gupta
c163219950 eventdev: use generic device holder
rte_device is a generic device which is available to the applications
and EAL. This patch replaces rte_pci_device in 'struct rte_eventdev'
and in 'struct rte_event_dev_info' with common rte_device.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-04-04 19:17:33 +02:00
Jerin Jacob
e3368ca998 event/skeleton: support vdev uninit
Removed global index based device name
generation as vdev uninit needs the exact driver
name used vdev init.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:17:26 +02:00
Nipun Gupta
d3e281a540 eventdev: update event port link and unlink callbacks
Added a pointer to the rte_eventdev type in the event port
link and unlink callbacks. This device shall be used by some
of the event drivers to fetch queue related information.

Also, update the skeleton eventdev driver with corresponding changes.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-04 19:12:00 +02:00
Jerin Jacob
bbbb929da5 event/skeleton: add skeleton eventdev driver
The skeleton driver facilitates, bootstrapping the new
eventdev driver and creates a platform to verify
the northbound eventdev common code.

The driver supports both VDEV and PCI based eventdev
devices.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-04 19:12:00 +02:00