Commit Graph

101 Commits

Author SHA1 Message Date
Junfeng Guo
4c7a41ae6b net/iavf: support flow director GTPU outer IPv4/IPv6
Add FDir support for MAC_IPV4_GTPU and MAC_IPV6_GTPU type with outer
IPv4/IPv6 address, teid and qfi fields matching. Note that outer IPv4
and IPv6 matching fields here include both SRC & DST of both IPv4 &
IPv6.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-11 06:18:52 +02:00
Jeff Guo
60f1d9f640 net/iavf: enable additional hash flow
Some new hash flow will be supported to expend the flow hash
capability, the input set are the session id for NAT-T ESP protocol,
the l3 src/dst and the teid for GTPU_IP protocol.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-07 23:38:28 +02:00
Jeff Guo
dbb4ac5607 net/iavf: enable 5 tuple RSS hash
Previous iavf not support 5 tuple hash, this patch aims to enable it
for regular ip pattern and also GTPU inner ip pattern, the 5 tuple
involves ip src and ip dst, tcp sport and tcp dport, udp sport and
udp dport and protocol id.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-07 23:38:28 +02:00
Jeff Guo
215a247b5f net/iavf: refactor hash flow
Refactor hash flow by change the process of the pattern parser and the
action parser, and refine the lookup table for regular IP and GTPU_EH,
ETH, and also VLAN.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-07 23:38:28 +02:00
Junyu Jiang
1feb8e3f4e net/iavf: fix RSS RETA after restart
This patch moved the RSS initialization from dev start to
dev configure, to fix the issue that RSS redirection table
can not be kept after restarting port.

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

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-07-07 23:38:26 +02:00
Ferruh Yigit
ca5e39f853 net/iavf: fix uninitialized variable
This is observed with experimental gcc 11, although the older gcc
versions don't complain about it, issue seems a valid one.
gcc version 11.0.0 20200621 (experimental) (GCC)

Build error
.../drivers/net/iavf/iavf_ethdev.c: In function ‘iavf_dev_link_update’:
.../drivers/net/iavf/iavf_ethdev.c:641:6:
    error: ‘new_link’ is used uninitialized [-Werror=uninitialized]
  641 |  if (rte_atomic64_cmpset((uint64_t *)&dev->data->dev_link,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  642 |     *(uint64_t *)&dev->data->dev_link,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  643 |     *(uint64_t *)&new_link) == 0)
      |     ~~~~~~~~~~~~~~~~~~~~~~~
.../drivers/net/iavf/iavf_ethdev.c:596:22:
    note: ‘new_link’ declared here
  596 |  struct rte_eth_link new_link;
      |                      ^~~~~~~~
cc1: all warnings being treated as error

All fields of the 'new_link' struct is already set in function, so the
'uninitialized' warning is hard to get. This is because the combination
of aligning and bitfield usage of the struct

The definition of the struct is:
struct rte_eth_link {
        uint32_t link_speed;        /**< ETH_SPEED_NUM_ */
        uint16_t link_duplex  : 1;  /**< ETH_LINK_[HALF/FULL]_DUPLEX */
        uint16_t link_autoneg : 1;  /**< ETH_LINK_[AUTONEG/FIXED] */
        uint16_t link_status  : 1;  /**< ETH_LINK_[DOWN/UP] */
} __rte_aligned(8);      /**< aligned for atomic64 read/write */

Overall the size of the 'struct rte_eth_link' is 64 bits, but function
only sets the 35 bits of it, because only 3 bits of 16 bits variable are
used.
When the struct cast to 'uint64_t' because of the 'rte_atomic64_cmpset'
the upper 29 bits are used without initialization.

To fix the uninitialized usage, memset the variable 'new_link' before
using it.

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>
2020-07-07 23:38:26 +02:00
Jerin Jacob
9c99878aa1 log: introduce logtype register macro
Introduce the RTE_LOG_REGISTER macro to avoid the code duplication
in the logtype registration process.

It is a wrapper macro for declaring the logtype, registering it and
setting its level in the constructor context.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-03 15:52:51 +02:00
Jeff Guo
1051b8db94 net/iavf: fix flow uninit
When closing VF device, the process of shutdown adminq should be after
the process of uninit the flow, since the VF might still need to use the
adminq to uninit flow.

Fixes: 9e03acd726 ("net/iavf: fix flow access")
Fixes: ff2d0c345c ("net/iavf: support generic flow API")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-28 17:57:07 +02:00
Jeff Guo
c9da9d4183 net/iavf: fix RSS protocol field selector
When VFs configure the rss rule by virtchnl, it need to set bit mask
into the field selector for the protocol, then PF got the configure
massage and parse the field selector to the corresponding protocol
field.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Zhiwei He <zhiwei.he@intel.com>
2020-05-28 17:57:07 +02:00
Jeff Guo
9e03acd726 net/iavf: fix flow access
Add invalid flow checking func in iavf generic flow to avoid the error
of "Cannot access memory at address 0xXXXXXX" occur.

When hash init, the default RSS rules would be added, while hash uninit,
the default RSS rules should be deleted. Add the missing part in the
hash uninit process.

Fixes: 5ea6142543 ("net/iavf: fix VF reset for RSS")
Fixes: ff2d0c345c ("net/iavf: support generic flow API")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2020-05-22 17:10:15 +02:00
Jeff Guo
2482a99f30 net/iavf: fix setting L2TAG
Base on HW, if a packet is split into multiple segments, the L2TAG
should only be valid on the last Rx descriptor. So fix it by setting
L2TAG into mbuf when processing the last split packet.

Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-22 17:10:15 +02:00
Leyi Rong
514d1c989d net/iavf: fix flow director after queue reconfigured
FDIR ID parsing will not be handled correctly after queue reconfigured,
enable FDIR ID parsing per Q regardless of fdir_ref_cnt to fix it.

Fixes: f71dbf852d ("net/iavf: add flow director enabled switch value")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-21 15:53:14 +02:00
Jeff Guo
5ea6142543 net/iavf: fix VF reset for RSS
Since there are some default rss configure in kernel PF/VF but not DPDK
IAVF, if these configurations be modified by VF and then VF reset, this
default rss configurations can not be reset to default by IAVF. So need
to add default rss set in IAVF hash initial process.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Zhiwei He <zhiwei.he@intel.com>
2020-05-19 17:12:17 +02:00
Ting Xu
632c7b6edc net/iavf: fix RXDID setting for Rx queue
CVL kernel PF configures all reserved queues for VF, including
Rx queue RXDID. The number of reserved queues is the maximum
between Tx and Rx queues. If the number of the enabled Rx queues
is less than that of reserved queues, required RXDID will only
be set for those enabled, but default value (0) is set for others.
However, RXDID 0 (legacy 16byte descriptor) is not supported now,
PF will return error when configuring those disabled VF queues.

In this patch, required RXDID is set for all reserved Rx queues,
no matter enabled or not. In this way, PF will configure Rx
queues correctly without reporting error.

Fixes: b8b4c54ef9 ("net/iavf: support flexible Rx descriptor in normal path")

Signed-off-by: Ting Xu <ting.xu@intel.com>
Tested-by: Xiaoxiao Zeng <xiaoxiaox.zeng@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-18 20:35:57 +02:00
Jeff Guo
aeef461fd6 net/iavf: fix RSS algorithm configuration
When configure RSS rule, the etherdev rss hash function type should be
mapped to the corresponding virtchnl rss algorithm type.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-18 20:35:57 +02:00
Leyi Rong
717ca21131 net/iavf: remove useless assignment in Rx
Fix coverity defects of unused value.

Coverity issue: 357745, 357769
Fixes: b8b4c54ef9 ("net/iavf: support flexible Rx descriptor in normal path")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-18 20:35:07 +02:00
Jeff Guo
ba37f7bf11 net/iavf: fix flow API error logs
When processing a rte flow, such as creating a parse engine, or
creating or destroying a RSS rule, if they are failed, they all
need to construct the flow error structure before return the error
message back to app. If not so, it will cause app crash when
app printing the message out of a flow error.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Fixes: ff2d0c345c ("net/iavf: support generic flow API")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Jeff Guo
bd8cf9c0b0 net/iavf: fix input set for RSS hash
Since some specific RSS hash type need to combine with the protocol
hash type when configure a RSS hash rule, so add the corresponding
input set to support these case for iavf hash.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Alvin Zhang
5330b04297 net/iavf: fix link speed
If the PF driver does not support the new speed reporting capabilities
then use link_event instead of link_event_adv to get the speed.

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

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-05-11 22:27:39 +02:00
Simei Su
ada64daa1a net/iavf: fix VF reset for flow director rule
After VF reset, FDIR rule still takes effect. To solve the issue,
this patch adds to flush all flows before flow uninit. VIRTCHNL
sends message to PF by Admin Queue, so flow flush should be implemented
before Admin Queue shut down.

Fixes: ff2d0c345c ("net/iavf: support generic flow API")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-05 15:54:25 +02:00
Cheng Peng
fdfbfe7085 net/iavf: fix stats query error code
The iavf_dev_stats_get function should return ret instead of -eio.

Fixes: f4a41a6953 ("net/avf: support stats")
Cc: stable@dpdk.org

Signed-off-by: Cheng Peng <cheng.peng5@zte.com.cn>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-04-22 12:31:12 +02:00
Jeff Guo
7be10c3004 net/iavf: add RSS configuration for VF
The VF must be capable of configuring RSS. Add a virtchnl handler to
parse a specific RSS configuration, and process the configuration for
VFs, such as add or delete a RSS rule.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 18:03:26 +02:00
Simei Su
ece350b463 net/iavf: support flow director mark action
This patch enables mark action support and takes mark only case
into consideration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
6fb63b1a4d net/iavf: support flow director PFCP
This patch enables PFCP node and session packets with S_FIELD
for flow director filter.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
78dcaa91ea net/iavf: support flow director L2TPv3 and IPsec
This patch enables L2TPv3 with SESSION_ID, ESP/AH with SPI, NAT-T
with SPI and IP src/dst for flow director filter.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
26db935656 net/iavf: support flow director GTPU
This patch enables GTPU with TEID and QFI for flow director filter.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
d5eb3e600d net/iavf: support flow director basic rule
This patch adds FDIR create/destroy/validate function in AVF.
Common pattern and queue/qgroup/passthru/drop actions are supported.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
63660ea3ee net/iavf: add RSS hash parsing in SSE path
Support RSS hash parsing from Flex Rx
descriptor in SSE data path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
f978c1c9b3 net/iavf: add RSS hash parsing in AVX path
Support RSS hash parsing from Flex Rx
descriptor in AVX data path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
75c348b06a net/iavf: support flow mark in SSE path
Support Flow Director mark ID parsing from Flex
Rx descriptor in SSE path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
d35f115ed0 net/iavf: support flow mark in AVX path
Support Flow Director mark ID parsing from Flex
Rx descriptor in AVX path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
dd3432e3f7 net/iavf: support flow mark in normal data path
Support Flow Director mark ID parsing in normal path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
f71dbf852d net/iavf: add flow director enabled switch value
The commit adds fdir_enabled flag into iavf_rx_queue structure
to identify if fdir id is active. Rx data path can be benefit if
fdir id parsing is not needed, especially in vector path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
1162f5a0ef net/iavf: support flexible Rx descriptor in SSE path
Support flexible Rx descriptor format in SSE
path of iAVF PMD.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
5b6e885908 net/iavf: support flexible Rx descriptor in AVX path
Support flexible Rx descriptor format in AVX
path of iAVF PMD.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
b8b4c54ef9 net/iavf: support flexible Rx descriptor in normal path
Support flexible Rx descriptor format in normal
path of iAVF PMD.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
837c2ed86e net/iavf: return error if opcode is mismatched
Adds error return when the opcode of read message is
mismatched which is received from adminQ.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
63b5e32439 net/iavf: support flexible Rx descriptor definitions
Add definitions for flexible Rx descriptor structures and macros.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Xiao Zhang
5908712aa5 net/iavf: support more flow patterns
Add patterns support for AH/ESP/L2TPV3OIP/PFCP.
Added patterns are as follows:
/* GTPU */
    eth/ipv4/udp/gtpu
    eth/ipv4/udp/gtpu/gtp_psc
/* ESP */
    eth/ipv4/esp  eth/ipv4/udp/esp
    eth/ipv6/esp  eth/ipv6/udp/esp
/* AH */
    eth/ipv4/ah  eth/ipv6/ah
/* L2TPV3 */
    eth/ipv4/l2tpv3oip  eth/ipv6/l2tpv3oip
/* PFCP */
    eth/ipv4/udp/pfcp  eth/ipv6/udp/pfcp

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:07 +02:00
Qiming Yang
ff2d0c345c net/iavf: support generic flow API
This patch added iavf_flow_create, iavf_flow_destroy,
iavf_flow_flush and iavf_flow_validate support,
these are used to handle all the generic filters.

This patch supported basic L2, L3, L4 and GTPU patterns.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:07 +02:00
Lunyuan Cui
e74e1bb628 net/iavf: enable port reset
This patch is intended to add iavf_dev_reset ops, enable iavf to support
"port reset all".

Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
Tested-by: Zhaoyan Chen <zhaoyan.chen@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-04-21 13:57:06 +02:00
Haiyue Wang
4cce7422dd net/iavf: stop PCI probe in DCF mode
A new DCF PMD will be introduced, which runs on Intel VF hardware, and
it is a pure software design to control the advance functionality (such
as switch, ACL) for rest of the VFs.

So if the DCF (Device Config Function) mode is specified by the devarg
'cap=dcf', then it will stop the PCI probe in the iavf PMD.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:05 +02:00
Shougang Wang
040b44551f net/iavf: unify Rx packet type table
This patch unified the Rx ptype table.

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2020-04-21 13:57:05 +02:00
Thomas Monjalon
ce6427ddca replace cold attributes
The new macro __rte_cold, for compiler hinting,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
2020-04-16 18:30:58 +02:00
Pavan Nikhilesh
acec04c4b2 build: disable experimental API check internally
Remove setting ALLOW_EXPERIMENTAL_API individually for each Makefile and
meson.build. Instead, enable ALLOW_EXPERIMENTAL_API flag across app, lib
and drivers.
This changes reduces the clutter across the project while still
maintaining the functionality of ALLOW_EXPERIMENTAL_API i.e. warning
external applications about experimental API usage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-04-14 16:22:34 +02:00
Haiyue Wang
3ca2214f1e net/iavf: unify bool type value
Replaces the redefined TRUE and FALSE values with standard ones to
match the 'bool' type definition.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-01-17 19:59:18 +01:00
Haiyue Wang
89214fe915 net/iavf/base: move to drivers common directory
Change the iavf base code as driver common library, it is used by iavf
PMD now, and it can be used by other Intel SR-IOV PMDs in the future.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-01-17 19:46:02 +01:00
Yahui Cao
be5466e4e9 net/iavf: fix virtual channel return
In iavf_handle_virtchnl_msg(), it is not appropriate for _clear_cmd()
to be used as a notification to foreground thread. So introduce
_notify_cmd() to fix this error. In addition, since _notify_cmd()
contains rte_wmb(), rte_compiler_barrier() is not necessary.

Sending msg from VF to PF is mainly by calling iavf_execute_vf_cmd(),
the whole virtchnl msg process is like,

iavf_execute_vf_cmd() will call iavf_aq_send_msg_to_pf() to send
msg and then polling the cmd done flag as "if (vf->pend_cmd ==
VIRTCHNL_OP_UNKNOWN)"

When reply msg is returned by pf, iavf_handle_virtchnl_msg() in
isr will read msg return value by "vf->cmd_retval = msg_ret" and
immediately set the cmd done flag by calling _clear_cmd() to
notify the iavf_execute_vf_cmd().

iavf_execute_vf_cmd() find the cmd done flag is set and then
check whether command return value vf->cmd_retval is success or
not.

However _clear_cmd() also resets the vf->cmd_retval to success,
overwriting the actual return value which is used for diagnosis.
So iavf_execute_vf_cmd() will always find vf->cmd_retval is
success and then return success.

Fixes: 22b123a36d ("net/avf: initialize PMD")
Cc: stable@dpdk.org

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-01-17 19:46:01 +01:00
Qi Zhang
53108e9530 net/iavf/base: update version info
Update base code version info in readme.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-01-17 19:46:01 +01:00
Qi Zhang
83fe5e8069 net/iavf: move device state flag
Move device state flag from ice_hw to ice_adapter since it should
not be a part of base code.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-01-17 19:46:01 +01:00