Commit Graph

35 Commits

Author SHA1 Message Date
Beilei Xing
98ff88b3c4 net/avf: remove keeping CRC configuration
Remove keeping CRC configuration as it's not supported by AVF.

Fixes: 5ce4c2be1a ("net/avf: fix offload capabilities")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-28 01:41:03 +02:00
Luca Boccassi
bfabd06000 net/avf: support meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-28 01:41:02 +02:00
Bruce Richardson
bfd38e4d70 net/avf: fix missing compiler error flags
The AVF driver was missing $(WERROR_FLAGS) in it's cflags, which means
that a number of compilation errors were getting missed. This patch adds
in the flag and fixes most of the errors, just disabling the
strict-aliasing ones.

Fixes: 22b123a36d ("net/avf: initialize PMD")
Fixes: 69dd4c3d08 ("net/avf: enable queue and device")
Fixes: a2b29a7733 ("net/avf: enable basic Rx Tx")
Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")

CC: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-09-28 01:41:02 +02:00
Bruce Richardson
584798f8e8 net/avf: fix unused variables and label
Compiling with all warnings turned on causes errors about unused variables
and an unused label. Remove these to allow building without having to
disable those warnings.

Fixes: 69dd4c3d08 ("net/avf: enable queue and device")
Fixes: 3fd7a3719c ("net/avf: enable ops for MTU setting")
Fixes: d6bde6b5ea ("net/avf: enable Rx interrupt")
Fixes: 22b123a36d ("net/avf: initialize PMD")
Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")
Fixes: a2b29a7733 ("net/avf: enable basic Rx Tx")
Fixes: 1060591ead ("net/avf: enable bulk allocate Rx")

CC: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2018-09-28 01:41:02 +02:00
Ferruh Yigit
323e7b667f ethdev: make default behavior CRC strip on Rx
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag.
Without any specific Rx offload flag, default behavior by PMDs is to
strip CRC.

PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC
Rx offload capability.

Applications that require keeping CRC should check PMD capability first
and if it is supported can enable this feature by setting
DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure()

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Jan Remes <remes@netcope.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-09-14 20:08:41 +02:00
Xiaoyun Li
5ce4c2be1a net/avf: fix offload capabilities
There are several tx/rx offload capabilities missing in AVF.
Add them in this patch since AVF supports them.

Fixes: 69dd4c3d08 ("net/avf: enable queue and device")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-08-02 04:19:50 +02:00
Thomas Monjalon
f8e9989606 remove useless constructor headers
A constructor is usually declared with RTE_INIT* macros.
As it is a static function, no need to declare before its definition.
The macro is used directly in the function definition.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-07-12 00:00:35 +02:00
Xiaoyun Li
f59917c840 net/avf: fix traffic blocked on reset
When resetting ports, traffic will be blocked. There is a mistake when
getting hw info at avf_dev_stop. This causes the device stop without
stopping queues. This patch fixes this issue.

Fixes: 69dd4c3d08 ("net/avf: enable queue and device")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2018-05-17 19:06:29 +02:00
Jingjing Wu
efe73c0d1d net/avf: fix Rx interrupt mapping
Vector used for rx mapping is different if WB_ON_ITR
is supported. The mapping table need to be updated.

Fixes: d6bde6b5ea ("net/avf: enable Rx interrupt")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Cc: stable@dpdk.org
2018-05-14 22:32:23 +01:00
Wei Dai
a4996bd89c ethdev: new Rx/Tx offloads API
This patch check if a input requested offloading is valid or not.
Any reuqested offloading must be supported in the device capabilities.
Any offloading is disabled by default if it is not set in the parameter
dev_conf->[rt]xmode.offloads to rte_eth_dev_configure() and
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If any offloading is enabled in rte_eth_dev_configure() by application,
it is enabled on all queues no matter whether it is per-queue or
per-port type and no matter whether it is set or cleared in
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If a per-queue offloading hasn't be enabled in rte_eth_dev_configure(),
it can be enabled or disabled for individual queue in
ret_eth_[rt]x_queue_setup().
A new added offloading is the one which hasn't been enabled in
rte_eth_dev_configure() and is reuqested to be enabled in
rte_eth_[rt]x_queue_setup(), it must be per-queue type,
otherwise trigger an error log.
The underlying PMD must be aware that the requested offloadings
to PMD specific queue_setup() function only carries those
new added offloadings of per-queue type.

This patch can make above such checking in a common way in rte_ethdev
layer to avoid same checking in underlying PMD.

This patch assumes that all PMDs in 18.05-rc2 have already
converted to offload API defined in 17.11 . It also assumes
that all PMDs can return correct offloading capabilities
in rte_eth_dev_infos_get().

In the beginning of [rt]x_queue_setup() of underlying PMD,
add offloads = [rt]xconf->offloads |
dev->data->dev_conf.[rt]xmode.offloads; to keep same as offload API
defined in 17.11 to avoid upper application broken due to offload
API change.
PMD can use the info that input [rt]xconf->offloads only carry
the new added per-queue offloads to do some optimization or some
code change on base of this patch.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2018-05-14 22:31:51 +01:00
Olivier Matz
caccf8b318 ethdev: return diagnostic when setting MAC address
Change the prototype and the behavior of dev_ops->eth_mac_addr_set(): a
return code is added to notify the caller (librte_ether) if an error
occurred in the PMD.

The new default MAC address is now copied in dev->data->mac_addrs[0]
only if the operation is successful.

The patch also updates all the PMDs accordingly.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-14 00:43:30 +02:00
Ferruh Yigit
cd8c7c7ce2 ethdev: replace bus specific struct with generic dev
Public struct rte_eth_dev_info has a "struct rte_pci_device" field in it
although it is common for all ethdev in all buses.

Replacing pci specific struct with generic device struct and updating
places that are using pci device in a way to get this information from
generic device.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-14 00:41:44 +02:00
Wenzhuo Lu
605c6f9ca5 net/avf: convert to new Rx and Tx offload API
Ethdev Tx offloads API has changed since:
commit cba7f53b71 ("ethdev: introduce Tx queue offloads API")
This commit support the new Rx and Tx offloads API.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-04-14 00:40:21 +02:00
Anatoly Burakov
12899df9a4 net/avf: use contiguous allocation for DMA memory
All hardware drivers should allocate IOVA-contiguous
memzones for their hardware resources.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
2018-04-11 19:45:30 +02:00
Ferruh Yigit
c3482deb7c net/avf: fix link autoneg value
Intention of the logic is:
If ETH_LINK_SPEED_FIXED is set in dev_conf, set link_autoneg to
ETH_LINK_FIXED, else set it to ETH_LINK_AUTONEG

ETH_LINK_SPEED_FIXED value is 1, and ETH_LINK_FIXED is 0;

Current logic is broken, fix it according above values.

Fixes: 48de41ca11 ("net/avf: enable link status update")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-03-30 14:08:44 +02:00
Jingjing Wu
b853efa574 net/avf: fix uninitialized variables
This patch fixes the coverity UNINIT issue.

Coverity issue: 257016, 257036
Fixes: 69dd4c3d08 ("net/avf: enable queue and device")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-31 20:57:29 +01:00
Jingjing Wu
29bc629498 net/avf: fix unchecked return in link update
This patch fixes the coverity CHECKED_RETURN issue.

Coverity issue: 257045
Fixes: 48de41ca11 ("net/avf: enable link status update")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-31 20:57:29 +01:00
Harry van Haaren
88f6bf7c75 net/avf: align dynamic log names with standard
This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-31 09:28:06 +01:00
Wenzhuo Lu
492180e03a net/avf: fix VF Rx interrupt enabling
As UIO doesn't support multiple interrupt, and the interrupt
is occupied by the control plane. PMD should not try to enable
RX queue interrupt. Then APP can know the RX queue interrupt
is not enabled and only choose the polling mode.

Fixes: d6bde6b5ea ("net/avf: enable Rx interrupt")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.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
Wenzhuo Lu
7f3ef71bfd net/avf: fix makefile typo
A typo in makefile that makes the RX/TX vector code
not to be compiled.

Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-01-21 15:51:52 +01:00
Thomas Monjalon
cebe3d7b3d ethdev: remove useless parameter in callback process
The pointer to the user parameter of the callback registration is
automatically pass to the callback function.
There is no point to allow changing this user parameter by a caller.
That's why this parameter is always set to NULL by PMDs and set only
in ethdev layer before calling the callback function.

The history is that the user parameter was initially used
by the callback implementation to pass some information
between the application and the driver:
	c1ceaf3ad0 ("ethdev: add an argument to internal callback function")
Then a new parameter has been added to leave the user parameter
to its standard usage of context given at registration:
	d6af1a13d7 ("ethdev: add return values to callback process API")

The NULL parameter in the internal callback processing function
is now removed. It makes clear that the callback parameter is user
managed and opaque from a DPDK point of view.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
d6bde6b5ea net/avf: enable Rx interrupt
Update the doc for the AVF features either.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Wenzhuo Lu
1060591ead net/avf: enable bulk allocate Rx
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
319c421f38 net/avf: enable SSE Rx Tx
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
ca01bc1ab7 net/avf: enable ops to check queue info and status
- rxq_info_get
 - txq_info_get
 - rx_queue_count
 - rx_descriptor_status
 - tx_descriptor_status

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
3fd7a3719c net/avf: enable ops for MTU setting
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
5234785947 net/avf: enable ops for RSS setting
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
cb25d4323f net/avf: enable MAC VLAN and promisc ops
- promiscuous_enable
 - promiscuous_disable
 - allmulticast_enable
 - allmulticast_disable
 - mac_addr_add
 - mac_addr_remove
 - mac_addr_set
 - vlan_filter_set
 - vlan_offload_set

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
f4a41a6953 net/avf: support stats
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
48de41ca11 net/avf: enable link status update
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Wenzhuo Lu
a2b29a7733 net/avf: enable basic Rx Tx
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
69dd4c3d08 net/avf: enable queue and device
enable device and queue setup ops like:

 - dev_configure
 - dev_start
 - dev_stop
 - dev_close
 - dev_infos_get
 - rx_queue_start
 - rx_queue_stop
 - tx_queue_start
 - tx_queue_stop
 - rx_queue_setup
 - rx_queue_release
 - tx_queue_setup
 - tx_queue_release

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
22b123a36d net/avf: initialize PMD
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Jingjing Wu
e5b2a9e957 net/avf/base: add base code for avf PMD
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-01-16 18:47:49 +01:00