Commit Graph

48 Commits

Author SHA1 Message Date
Jiawen Wu
abea8974c7 net/ngbe: support link down/up
Add support to set device link down/up.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-09-21 13:46:58 +02:00
Jiawen Wu
7fa2495bdd net/ngbe: fix YT PHY mixed mode link
Add to read link status register of UTP mode, to ensure link status of
mixed mode, for YT PHY.

Fixes: 1c44384fce ("net/ngbe: support custom PHY interfaces")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-09-21 13:46:58 +02:00
Jiawen Wu
d5774f0c82 net/ngbe: fix maximum frame size
Remain the same max frame size after the device restarts.

Fixes: 07baabb6a5 ("net/ngbe: support MTU set")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-09-21 13:46:58 +02:00
Jiawen Wu
c18385220f net/ngbe: remove semaphore between SW/FW
Since firmware does not use the semaphore between software and firmware.
Remove useless unilateral semaphore setting.

Fixes: f501a195bd ("net/ngbe: initialize and validate EEPROM")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-09-21 13:46:58 +02:00
Jiawen Wu
fee9350f1d net/ngbe: rename some extended statistics
Rename rx_oversize_errors to rx_oversize_cnt since it depends on giant
packet size limit instead of MTU, by hardware design.
Rename rx_drop_packets and tx_drop_packets to rx_dma_drop and tx_dma_drop
to indicate the drop location.
And add tx_dma_drop to extended statistics.

Fixes: 8b433d04ad ("net/ngbe: support device xstats")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-09-21 13:46:58 +02:00
David Marchand
1f37cb2bb4 bus/pci: make driver-only headers private
The pci bus interface is for drivers only.
Mark as internal and move the header in the driver headers list.

While at it, cleanup the code:
- fix indentation,
- remove unneeded reference to bus specific singleton object,
- remove unneeded list head structure type,
- reorder the definitions and macro manipulating the bus singleton object,
- remove inclusion of rte_bus.h and fix the code that relied on implicit
  inclusion,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2022-09-23 16:14:34 +02:00
Jiawen Wu
69033e3b84 net/ngbe: support YT PHY SGMII to RGMII mode
Add SGMII to RGMII mode for yt8521s and yt8531s PHY.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-06-22 12:32:41 +02:00
Jiawen Wu
f126836940 net/ngbe: support autoneg on/off for external PHY SFI mode
Add support for external PHY to switch autoneg on/off on their SFI mode.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-06-22 12:32:41 +02:00
Jiawen Wu
00f9e5c712 net/ngbe: fix YT PHY UTP mode to link up
Fix to read and write the correct register fields for yt8521s and
yt8531s PHY, since mode check was added.

Fixes: 1c44384fce ("net/ngbe: support custom PHY interfaces")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-06-22 12:32:41 +02:00
Jiawen Wu
240422edbf net/ngbe: support OEM subsystem vendor ID
Add support for OEM subsystem vendor ID.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-06-22 12:32:41 +02:00
Jiawen Wu
696a821178 net/ngbe: redesign internal PHY init flow
Add to read efuse values from flash, and disable EEE to improve signal
quality. Remove PHY semaphore to access PHY registers faster. And remove
unnecessary page selection where quick access is required.

When rte_eth_link_get_nowait() is called frequently with LSC disabled by
self-developed applications, eventually the PHY status register will be
accessed frequently. It will cause internal PHY init failure, if they
are done simultaneously. So there is a protection added for internal PHY
init.

Fixes: 3518df5774 ("net/ngbe: support device start/stop")
Fixes: 91bc12c522 ("net/ngbe: optimize PHY initialization process")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-05-31 09:42:16 +02:00
Jiawen Wu
0aeb133c58 net/ngbe: fix PCIe related operations with bus API
When using mailbox to request firmware to enable or disable PCIe bus
master, there is a small probability that mailbox cannot respond.
Change to use rte_pci_read_config() and rte_pci_write_config(), to
avoid this problem.

Fixes: ac6c5e9af5 ("net/ngbe: fix Tx hang on queue disable")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-05-31 09:42:16 +02:00
Jiawen Wu
6dcfb19f60 net/ngbe: fix reading M88E1512 PHY mode
For M88E1512 PHY mixed mode, PXE driver overrides PHY mode at load
time. To workaround this problem, change to read PHY mode from flash
instead of register.

Fixes: 1c44384fce ("net/ngbe: support custom PHY interfaces")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-05-31 09:42:16 +02:00
Jiawen Wu
708ebe7d03 net/ngbe: fix external PHY power down
External PHY cannot power down after LAN reset, so need to manually
power down when device stopped.

Fixes: 3d0af70667 ("net/ngbe: setup PHY link")
Fixes: 1c44384fce ("net/ngbe: support custom PHY interfaces")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-05-31 09:42:16 +02:00
Jiawen Wu
abe02c6c4c net/ngbe: fix reading PHY ID
Change to check low ID register to determine the valid PHY address,
for yt8521s PHY with high ID register value 0. And fix polling
register when expect value is 0, to complete MDIO read.

Fixes: 44e97550ca ("net/ngbe: identify and reset PHY")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-05-31 09:42:16 +02:00
Jiawen Wu
5eade8a363 net/ngbe: support yt8531s PHY
Add support for yt8531s PHY.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-05-31 09:42:16 +02:00
Jiawen Wu
c811e6a492 net/ngbe: fix debug logs
Remove 'DEBUGFUNC' due to too many invalid debug log prints, unify the
DEBUG level macros.

Fixes: cc934df178 ("net/ngbe: add log and error types")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-02-23 14:58:22 +01:00
Jiawen Wu
fbd5ceb0ef net/ngbe: support OEM customized LED
Support to get OEM customized LED configuration information from firmware.
And driver needs to adjust the process of PHY setup link, based on this
LED configuration.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-02-11 13:49:12 +01:00
Jiawen Wu
1c44384fce net/ngbe: support custom PHY interfaces
Support sub_device ID 61/62/64 for YT8521S SFP, and 51/52 for M88E1512
PHY.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-02-11 13:49:12 +01:00
Jiawen Wu
91bc12c522 net/ngbe: optimize PHY initialization process
Reduce the probability of PHY init failure, And add its error return.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-02-11 13:49:12 +01:00
Jiawen Wu
5c305e4058 net/ngbe: fix packet statistics
Fix specific length packet statistics caused by wrong register addresses.

Fixes: ed5f3bd337 ("net/ngbe: define registers")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-02-11 13:49:12 +01:00
Jiawen Wu
ac6c5e9af5 net/ngbe: fix Tx hang on queue disable
Add commands requesting firmware to enable or disable PCIe bus master.
Disable PCIe master access to clear BME when stop hardware, and verify
there are no pending requests.

Move disabling Tx queue after disabling PCIe bus master, to ensure that
there are no packets left to cause Tx hang.

Fixes: 78710873c2 ("net/ngbe: add HW initialization")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-02-11 13:49:12 +01:00
Jiawen Wu
ccdeca8e98 net/ngbe: fix Rx by initializing packet buffer early
Initialize Rx packet buffer before starting RxTx, ensure to receive
packets.

Fixes: 62fc35e63d ("net/ngbe: support Rx queue start/stop")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2022-02-11 13:49:12 +01:00
Jiawen Wu
71aec12796 net/ngbe: support register dump
Support to dump registers.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
9459ea29d1 net/ngbe: support EEPROM dump
Support to get and set device EEPROM data.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
4db3db296a net/ngbe: support device LED on/off
Support device LED on and off.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
f40e9f0e22 net/ngbe: support flow control
Support to get and set flow control.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
e2a289a788 net/ngbe: add mailbox process operations
Add check operation for vf function level reset,
mailbox messages and ack from vf.
Waiting to process the messages.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
60229dcfc4 net/ngbe: support SR-IOV
Initialize and configure PF module to support SRIOV.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
dee93977a6 net/ngbe: support MAC filters
Add MAC addresses to filter incoming packets, support to set
multicast addresses to filter. And support to set unicast table array.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
506abd4a8b net/ngbe: support FW version query
Add firmware version get operation.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
07baabb6a5 net/ngbe: support MTU set
Support updating port MTU.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
fdb1e85197 net/ngbe: support basic statistics
Support to read and clear basic statistics.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jiawen Wu
59b46438fd net/ngbe: support VLAN offload and VLAN filter
Support to set VLAN and QinQ offload, and filter of a VLAN tag
identifier.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-10-30 00:53:19 +02:00
Jerin Jacob
1539acc20a drivers: remove warning with Meson 0.59
Since meson 0.59.0 version, the extract_all_objects() API
need to pass explicit boolean value.

To remove the following warning[1], added explicit `true` for
extract_all_objects() use in codebase whever there is
no argument.

[1]
WARNING: extract_all_objects called without setting recursive
keyword argument. Meson currently defaults to
non-recursive to maintain backward compatibility but
the default will be changed in the future.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-08-27 15:51:34 +02:00
Jiawen Wu
62fc35e63d net/ngbe: support Rx queue start/stop
Initializes receive unit, support to start and stop receive unit for
specified queues.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:22 +02:00
Jiawen Wu
001c782330 net/ngbe: support Tx queue start/stop
Initializes transmit unit, support to start and stop transmit unit for
specified queues.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:22 +02:00
Jiawen Wu
3518df5774 net/ngbe: support device start/stop
Setup MSI-X interrupt, complete PHY configuration and set device link
speed to start device. Disable interrupt, stop hardware and clear queues
to stop device.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:22 +02:00
Jiawen Wu
3d0af70667 net/ngbe: setup PHY link
Setup PHY, determine link and speed status from PHY.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
b9246b8fa2 net/ngbe: support link update
Register to handle device interrupt.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
539d55dab6 net/ngbe: store MAC address
Store MAC addresses and init receive address filters.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
44e97550ca net/ngbe: identify and reset PHY
Identify PHY to get the PHY type, and perform a PHY reset.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
78710873c2 net/ngbe: add HW initialization
Initialize the hardware by resetting the hardware in base code.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
f501a195bd net/ngbe: initialize and validate EEPROM
Reset swfw lock before NVM access, init EEPROM and validate the
checksum.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
68eb13a1ef net/ngbe: set MAC type and LAN ID with initialization
Add basic init and uninit function.
Map device IDs and subsystem IDs to single ID for easy operation.
Then initialize the shared code.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
ed5f3bd337 net/ngbe: define registers
Define all registers that will be used.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
cc934df178 net/ngbe: add log and error types
Add log type and error type to trace functions.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00
Jiawen Wu
6ee7e574cd net/ngbe: support probe and remove
Add device IDs for Wangxun 1Gb NICs, map device IDs to register ngbe
PMD. Add basic PCIe ethdev probe and remove.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-12 17:55:21 +02:00