Commit Graph

11970 Commits

Author SHA1 Message Date
Vamsi Attunuru
fab634eb87 crypto/octeontx2: support security session data path
This patch adds lookaside IPsec enqueue and dequeue routines.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:03 +02:00
Vamsi Attunuru
465f7e5804 crypto/octeontx2: support security session create
This patch creates session for lookaside IPsec.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:03 +02:00
Vamsi Attunuru
53bac0028f crypto/octeontx2: add security misc callbacks
This patch adds lookaside IPsec callback functions.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:02 +02:00
Tejasree Kondoj
ae9000ada9 crypto/octeontx2: add security capabilities
This patch adds lookaside IPsec capabilities for
rte_security

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:02 +02:00
Tejasree Kondoj
b9765e96c2 crypto/octeontx2: register security operations
This patch registers security operations with cryptodev.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:02 +02:00
Tejasree Kondoj
e6c1223dd5 crypto/octeontx2: add lookaside SA context definitions
This patch adds lookaside IPsec SA context definitions.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:02 +02:00
Tejasree Kondoj
858797bbcd net/octeontx2: move security session struct to crypto PMD
This patch moves otx2_sec_session structure to otx2_security.h
to make it common for inline and lookaside protocol modes of
rte_security

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:02 +02:00
Tejasree Kondoj
0136dd3727 crypto/octeontx2: move capabilities init into probe
This patch moves capabilities initialization into probe.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:02 +02:00
Adam Dybkowski
cb440babbd compress/qat: revert change in GEN3 marketing name
The patch reverts the commit that updated Intel QuickAssist GEN3
marketing name. The change was not backported and has to be withdrawn.

This reverts commit 9cd9d3e702

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-07-18 23:09:02 +02:00
Arek Kusztal
dde9cc6f6c compress/qat: fix lacking memzone lookup
Because capability memzone of compression does not have lookup
call, second and subsequent devices cannot be created.

Fixes: 7788dceccb ("common/qat: add multi-process handling of capabilities")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
2020-07-18 23:09:01 +02:00
Konstantin Ananyev
8b6c9aee90 crypto/scheduler: use ring peek API
scheduler PMD uses its own hand-made peek functions
that directly access rte_ring internals.
As now rte_ring has an API for that type of functionality -
change scheduler PMD to use API provided by rte_ring.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2020-07-18 23:09:00 +02:00
Kalesh AP
87520e59fb net/bnxt: fix freeing filters on flow creation failure
This patch does following things:
1. Added a wrapper function bnxt_clear_one_vnic_filter()
   for destroying the filters in hw. This will avoid duplicate
   code in many places.
2. When flow create fails due to an already existing mark id
   for the new flow id created, fixed to destroy the hw
   filter created.
3. Re-arranged code to move a log and list update to right place.

Fixes: 9db66782bd ("net/bnxt: fix supporting zero mark ID with RSS action")
Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-07-11 06:18:54 +02:00
Kalesh AP
87aefef133 net/bnxt: fix flow error on filter creation
If set_em_filter/set_ntuple_filter cmds fails for some reason,
driver is not filling the "rte_flow_error" string buffer.
Same is the case when flow create fails due to an already
existing mark id for the new flow id created.
This leads to a crash in testpmd while trying to print the
error message.

Fixes: 5c1171c972 ("net/bnxt: refactor filter/flow")
Fixes: 9db66782bd ("net/bnxt: fix supporting zero mark ID with RSS action")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-07-11 06:18:54 +02:00
Kalesh AP
f456684ac2 net/bnxt: fix unnecessary HWRM command
During probe, driver issues HWRM_CFA_ADV_FLOW_MGNT_QCAPS command.
But it is not using the command response anywhere which makes the
fw call redundant.

Remove the unnecessary HWRM_CFA_ADV_FLOW_MGNT_QCAPS call to fw.
Remove the redundant flow_flags in bnxt struct.

Fixes: afef822b2e ("net/bnxt: support creating SMAC and inner DMAC filters")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-07-11 06:18:54 +02:00
Kalesh AP
df3a6666cb net/bnxt: remove unused enum declaration
"enum bnxt_hw_context" is defined in the header file, but is not
used anywhere.

Fixes: 9738793f28 ("net/bnxt: add VNIC functions and structs")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-07-11 06:18:54 +02:00
Kalesh AP
d4d5a04114 net/bnxt: fix unnecessary memory allocation
VFs are not privileged to issue HWRM_PORT_LED_QCFG/CFG.
There is no need to allocate "bp->leds" memory.

Fixes: 205b742952 ("net/bnxt: fix allocation of LED config info")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-07-11 06:18:54 +02:00
Yicai Lu
a9cbca7430 net/bonding: fix LACP negotiation
When two host is connected directly without any devices like switch,
rx_machine_update would receiving partner LACP negotiation packets,
and partner's port mac is filled with zeros in this packet, which is
different with internal's mode4 mac. So in this situation, it would
never go rx_machine branch and then execute mac swap for negotiation!
Thus bond mode 4 will negotiation failed.

Fixes: 56cbc08173 ("net/bonding: fix LACP negotiation")
Cc: stable@dpdk.org

Signed-off-by: Yicai Lu <luyicai@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-07-11 06:18:54 +02:00
Renata Saiakhova
460d167958 drivers/net: delete HW rings while freeing queues
Delete memzones for HW rings in igb and ixgbe while freeing queues

Updated igb, ixgbe, i40e, ice & em drivers.

Signed-off-by: Renata Saiakhova <renata.saiakhova@ekinops.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-11 06:18:54 +02:00
Ferruh Yigit
61ede39537 drivers/net: fix exposing internal headers
Using '__rte_internal' tag in 'rte_ethdev_driver.h' causing build error
for applications and examples. Because they don't define
'ALLOW_INTERNAL_API' flag and '__rte_internal' causes the error.
This patch is preparation for future '__rte_internal' usage.

At first place, applications/examples should not include
'rte_ethdev_driver.h', this is happening because of PMD public header
files include 'rte_ethdev_driver.h' by mistake.

Updated PMD public header files to not include internal header files.

But for unit test application, 'app/test', enable accessing internal
APIs, since some unit tests need them.

Fixes: ffc905f3b8 ("ethdev: separate driver APIs")
Fixes: ec0dec44ec ("net/atlantic: enable MACsec configuration")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-11 06:18:54 +02:00
Heinrich Kuhn
198e745083 net/nfp: fix RSS hash configuration reporting
Prior to this fix the NFP PMD implementation of the .rss_hash_conf_get
callback did not propagate the current hardware state of rss_hf back up
to the caller. Users of the hash_conf_get callback would receive an
incorrect representation of what the RSS configuration currently is in
hardware.

Fixes: 934e4c60fb ("nfp: add RSS")
Cc: stable@dpdk.org

Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
2020-07-11 06:18:54 +02:00
Ivan Malov
5cf04fd15a net: use named constants for deprecated QinQ TPIDs
Add named constants for deprecated QinQ TPIDs.
Update drivers which have already been using existing
TPID named constants from librte_net to use the
new named constants rather than magic numbers.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-11 06:18:53 +02:00
Hyong Youb Kim
f011fa0a5f net/enic: support burst mode info
Add Rx/Tx burst mode getter handlers.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2020-07-11 06:18:53 +02:00
Junfeng Guo
de32fa2ba2 net/ice: support RSS for IPv6 prefix
RSS for IPv6 prefix fields are supported in this patch, so that we
can use prefixes instead of full IPv6 address for RSS. These prefixes
include the first 32, 48, 64 bits of both SRC and DST IPv6 address.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-11 06:18:53 +02:00
Xiaoyun Wang
3260064acc net/hinic/base: convert error value to ETIMEDOUT
Following commit updated the error codes:
commit 2ae8e130cf ("net/hinic/base: modify returned error values")

In that commit 'ETIME' errors are not used because it is not supported
by FreeBSD, instead in this patch converting relevant error codes to
'ETIMEDOUT'.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-11 06:18:53 +02:00
Wei Hu (Xavier)
50ce3e7aec ethdev: fix VLAN offloads set if no relative capabilities
Currently, there is a potential problem that calling the API function
rte_eth_dev_set_vlan_offload to start VLAN hardware offloads which the
driver does not support. If the PMD driver does not support certain VLAN
hardware offloads and does not check for it, the hardware setting will
not change, but the VLAN offloads in dev->data->dev_conf.rxmode.offloads
will be turned on.

It is supposed to check the hardware capabilities to decide whether the
relative callback needs to be called just like the behavior in the API
function named rte_eth_dev_configure. And it is also needed to cleanup
duplicated checks which are done in some PMDs. Also, note that it is
behaviour change for some PMDs which simply ignore (with error/warning
log message) unsupported VLAN offloads, but now it will fail.

Fixes: a4996bd89c ("ethdev: new Rx/Tx offloads API")
Fixes: 0ebce6129b ("net/dpaa2: support new ethdev offload APIs")
Fixes: f9416bbafd ("net/enic: remove VLAN filter handler")
Fixes: 4f7d9e383e ("fm10k: update vlan offload features")
Fixes: fdba3bf15c ("net/hinic: add VLAN filter and offload")
Fixes: b96fb2f0d2 ("net/i40e: handle QinQ strip")
Fixes: d4a27a3b09 ("nfp: add basic features")
Fixes: 56139e85ab ("net/octeontx: support VLAN filter offload")
Fixes: ba1b3b081e ("net/octeontx2: support VLAN offloads")
Fixes: d87246a437 ("net/qede: enable and disable VLAN filtering")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-07-11 06:18:53 +02:00
Roman Kapl
bff6a98f74 net/dpaa2: avoid multiple IOVA conversions
Avoids recalculation of DPAA2_IOVA_TO_VADDR, since this is somewhat
costly function on no-IOMMU setups.

Brings about 0.5 Gbps improvement at 19 Gbps speeds on LX2160 with 512b
packets.

Signed-off-by: Roman Kapl <rka@sysgo.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:53 +02:00
Hyong Youb Kim
7cef1de920 net/enic: add more flow manager actions to dump
The following commit introduced several new actions. Make the dump
function to print those actions.

commit 6faf81f1d2 ("net/enic: update flow manager API")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2020-07-11 06:18:53 +02:00
Hyong Youb Kim
2bc398ccb9 net/enic: support VLAN push and pop flow actions
Flow manager API includes push/pop actions, so support corresponding
DPDK flow actions.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2020-07-11 06:18:53 +02:00
Viacheslav Ovsiienko
3590881b37 common/mlx5: fix physical port name pattern recognition
This patch makes the Infiniband device physical port name
recognition more strict. Currently mlx5 PMD might recognize
the names like "pf0sf0" erroneously as "pf0" and the wrong
device type (host PF representor) is reported.

The names like "pf0sf0" belong to PCI subfunctions which
is currently not supported by mlx5 PMD and this false
recognition must be eliminated.

Fixes: 420bbdae89 ("net/mlx5: fix host physical function representor naming")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-07-11 06:18:53 +02:00
Ali Alnubani
28c9a7d7b4 net/mlx5: add ConnectX-6 Lx device ID
This adds the ConnectX-6 Lx device id to the list of supported
Mellanox devices that run the MLX5 PMD.
The device is still in development stage.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Raslan Darawsheh <rasland@mellanox.com>
2020-07-11 06:18:53 +02:00
Junfeng Guo
642f201950 net/iavf: support RSS for IPv4 IPv6 mix of GTP
RSS for GTP with outer & inner ipv4 & ipv6 combination are supported
in this patch, so that we can process RSS based on inner 5 tuples or
3 tuples of all the cases below of GTP packets:
        1. ipv4 (outer) + ipv4 (inner)
        2. ipv4 (outer) + ipv6 (inner)
        3. ipv6 (outer) + ipv4 (inner)
        4. ipv6 (outer) + ipv6 (inner)

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-11 06:18:53 +02:00
Junfeng Guo
610bc231d0 net/ice: support RSS for IPv4 IPv6 mix of GTP
RSS for GTP with outer & inner ipv4 & ipv6 combination are supported
in this patch, so that we can process RSS based on inner 5 tuples or
3 tuples of all the cases below of GTP packets:
        1. ipv4 (outer) + ipv4 (inner)
        2. ipv4 (outer) + ipv6 (inner)
        3. ipv6 (outer) + ipv4 (inner)
        4. ipv6 (outer) + ipv6 (inner)

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-11 06:18:53 +02:00
Simei Su
8020b8123a net/ice: fix protocol header for PPPoE
When adding a RSS rule with pattern MAC_PPPOE_IPV4_UDP and input
set SRC/DST IPV4, because of incomplete protocol header fields,
the rule can't do hash with inner src/dst ipv4. PPPOE_IPV4_TCP/SCTP
and PPPOE_IPV6_UDP/TCP/SCTP also have similar issues. This patch
complements protocol header fields for PPPOE data packets.

Fixes: 0b952714e9 ("net/ice: refactor PF hash flow")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
ce1231cae7 net/ixgbe/base: update version
Update base code version in readme.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
db18e37090 net/ixgbe/base: check host interface return status
Writing to read-only fields returns a non-OK Return Status
for shadow RAM write command for X550.
This information was previously discarded.

Signed-off-by: Stanislaw Grzeszczak <stanislaw.a.grzeszczak@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
5becae1601 net/ixgbe/base: cleanup pre-processor tags
The codes has been exposed correctly, so remove pre-processor tags.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
13de244444 net/ixgbe/base: remove default advertising for x550 2.5G/5G
We are seeing interoperability issues with switches when 2.5G and 5G
in x550 are advertised by default, so default to off.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
21feefa2fc net/ixgbe/base: add IPv6 mask for flow director
Write FDIRIP6M register to allow flow director filter
to set ipv6 rules without setting ipv6 source/destination address.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
ab6ac48d48 net/ixgbe/base: improve log about autoneg being disabled
On ESXi OS, when user disables auto negotiation, the following log
appears: "(unsupported) Flow control autoneg is disabled".
It is true that auto negotiation is disabled but it is
not necessarily true that it is not supported.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
40543be537 net/ixgbe/base: initialize data field in struct buffer
While sending request using ixgbe_hic_unlocked() the data field in
buffer struct is not used. It is set when the struct is overwritten by
FW to deliver the response. To not pass random data to FW the whole
structure should be zeroed before use.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
658dfd345f net/ixgbe/base: remove log message FC autoneg
The function ixgbe_device_supports_autoneg_fc is checking whether
a particular device and medium configuration is supporting
Flow Control Autonegotiation. In case of non-support, the message
is always logged which is confusing.
The fix is removing unnecessary log entry.

Signed-off-by: Zalfresso-Jundzillo <marekx.zalfresso-jundzillo@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
4b0ee6529b net/ixgbe/base: remove unnecessary return value check
Remove unnecessary return value check.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
d8e52b2cf7 net/ixgbe/base: add typecast for type mismatch
Add typecast for type mismatch.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
664ea2614e net/ixgbe/base: create function to restart autoneg
This patch is for restarting auto negotiation on PHY.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
390445ec30 net/ixgbe/base: move increments after evaluations
The retry variable was being incremented before it was evaluated by the
subsequent conditional against the maximum retries to figure out which
message to print.  So we'll move the increment op to the end.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
40023f73c7 net/ixgbe/base: remove whitespace in function comments
Remove unnecessary extra whitespace on all function comments, replacing
' *  ' with ' * '.

This was done automatically via sed using the following transformation:

  sed 's/^ \*  / * /'

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
fc75eee320 net/ixgbe/base: cleanup spelling mistakes in comments
Several functions in the driver code have a weird function comment
formatting which uses two spaces instead of only one space for the main
function body.

This formatting will be mechanically fixed by sed in a future patch, but
doing so leads to some spelling warnings on that patch. Cleanup the
spelling mistakes that will be detected first. This way, it is easier to
verify the mechanical transformation done by sed in the following patch.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
4a6847d788 net/ixgbe/base: add register definitions for NVM update
Added additional register for X550 and above device family.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
2d04b9e856 net/ixgbe/base: fix infinite recursion on PCIe link down
In some corner cases the functions ixgbe_clear_rar_generic and
ixgbe_clear_vmdq_generic may call one another leading to infinite
recursion.

When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL
flag, it's going to clear MPSAR registers, and proceed to call
ixgbe_clear_rar_generic, which in turn will clear the RAR registers,
and recursively call back ixgbe_clear_vmdq_generic. Normally, the
latter would detect that MPSAR registers have already been cleared
and terminate the recursion.

However, when PCIe link is down, and before the driver has had the
opportunity to shut itself down, all register reads return 0xFFFFFFFF,
and all register writes fail silently. In such case, because
ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers
succeeded, it's going to always call ixgbe_clear_rar_generic, which
in turn will always call back ixgbe_clear_vmdq_generic, creating
infinite recursion.

This patch re-reads MPSAR register values after they had been cleared.
In case of PCIe link failure, the values read will be non-zero, which
will terminate the recursion. On the other hand, under normal
circumstances the value read from MPSAR registers is going to be equal
to the value previously written, so this patch is expected not to cause
any regressions.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
Guinan Sun
fb03b51da9 net/ixgbe/base: fix x550em 10G NIC link status
With the NVM image for x550em XFI will not report
the auto-negotiation feature correctly. The auto-negotiation
should be "No" for supports and advertised items.
At the same time update speed makes it support 1G and 10G.

Fixes: 833df43399 ("net/ixgbe/base: add SGMII link for X550")
Cc: stable@dpdk.org

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00