To avoid configuration for both kernel driver and userspace SDK outside DPDK, we add switch management in FM10K DPDK PMD driver.
Split dev init to 2 parts. First only register the port in switch management; second init hook will be called after all the pf are registered and switch initialization. It will finish dev init. Also add switch interrupt support. Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset to support mirror operation. Add fm10k_dev_filter_ctrl to support flow operation. Add dpdk port and pf mapping, so the dpdk port can map to a specific pf and 1 dpdk port can map to 2 pf to get total 100G throughput. Add flow interface to support offload flow into HW. It supports parse vlan and parse mpls, all these data will be transffered to ffu data. Add switch management, includes initialization, port mapping, epl port link, LED controller, interrupt handler. It create 3 threads. One for interrupt handler, one for LED controller, one for statistics. Add ffu to support offload flow into HW. It supports forward, mirror, push VLAN, pop VLAN. It also supports flowset for a group flow definition. The config file can configure debug log, port speed, epl port mapping dpdk port, flowset. All these configuration will be used by switch management. Statistics includes epl port, ffu rule, dpdk port, and error. All these statistics data are read from HW. Modify switch header file to support getting logical port and glort and device info. Add epl serdes include loading spico, controling pcsl, dma, dfe, ical. Add spico code. Add state machine for epl lane and port, it creates a pthread to handle the state changing event. Add external port management, which will use state machine to handle the event from lane and port. The lane state will change between DOWN, WAIT_PLL_LOCK, WAIT_SIGNAL_OK, WAIT_DFE_ICAL, WAIT_DFE_PCAL, UP. The port state will change between DOWN, WAIT_LANE_UP, UP. Add I2C to control the inside LED and PHY. All the operations of I2C are using fm10k I2C register. Add SBUS to communicate with spico(micro code in serdes) by using fm10k SBUS register. This is like I2C operations. Add registers defination, which include all the registers will be used in the driver. Add switch management log API. Add switch management structures. Modify Makefile to add new files building Xiaojun Liu (5): net/fm10k: add basic functions for switch management net/fm10k: add epl serdes and port control functions net/fm10k: add ffu and statistics and config file functions net/fm10k: add flow interface and switch management net/fm10k: add switch management support drivers/net/fm10k/Makefile | 25 + drivers/net/fm10k/fm10k_ethdev.c | 587 +++++- drivers/net/fm10k/switch/fm10k_config.c | 863 ++++++++ drivers/net/fm10k/switch/fm10k_config.h | 178 ++ drivers/net/fm10k/switch/fm10k_debug.h | 19 + drivers/net/fm10k/switch/fm10k_ext_port.c | 841 ++++++++ drivers/net/fm10k/switch/fm10k_ext_port.h | 136 ++ drivers/net/fm10k/switch/fm10k_ffu.c | 1253 +++++++++++ drivers/net/fm10k/switch/fm10k_ffu.h | 31 + drivers/net/fm10k/switch/fm10k_flow.c | 872 ++++++++ drivers/net/fm10k/switch/fm10k_flow.h | 26 + drivers/net/fm10k/switch/fm10k_i2c.c | 310 +++ drivers/net/fm10k/switch/fm10k_i2c.h | 54 + drivers/net/fm10k/switch/fm10k_regs.h | 2302 +++++++++++++++++++++ drivers/net/fm10k/switch/fm10k_sbus.c | 292 +++ drivers/net/fm10k/switch/fm10k_sbus.h | 40 + drivers/net/fm10k/switch/fm10k_serdes.c | 1936 +++++++++++++++++ drivers/net/fm10k/switch/fm10k_serdes.h | 32 + drivers/net/fm10k/switch/fm10k_sm.c | 190 ++ drivers/net/fm10k/switch/fm10k_sm.h | 81 + drivers/net/fm10k/switch/fm10k_spico_code.c | 2966 +++++++++++++++++++++++++++ drivers/net/fm10k/switch/fm10k_spico_code.h | 21 + drivers/net/fm10k/switch/fm10k_stats.c | 1242 +++++++++++ drivers/net/fm10k/switch/fm10k_stats.h | 257 +++ drivers/net/fm10k/switch/fm10k_switch.c | 2376 +++++++++++++++++++++ drivers/net/fm10k/switch/fm10k_switch.h | 475 +++++ 26 files changed, 17364 insertions(+), 41 deletions(-) create mode 100644 drivers/net/fm10k/switch/fm10k_config.c create mode 100644 drivers/net/fm10k/switch/fm10k_config.h create mode 100644 drivers/net/fm10k/switch/fm10k_debug.h create mode 100644 drivers/net/fm10k/switch/fm10k_ext_port.c create mode 100644 drivers/net/fm10k/switch/fm10k_ext_port.h create mode 100644 drivers/net/fm10k/switch/fm10k_ffu.c create mode 100644 drivers/net/fm10k/switch/fm10k_ffu.h create mode 100644 drivers/net/fm10k/switch/fm10k_flow.c create mode 100644 drivers/net/fm10k/switch/fm10k_flow.h create mode 100644 drivers/net/fm10k/switch/fm10k_i2c.c create mode 100644 drivers/net/fm10k/switch/fm10k_i2c.h create mode 100644 drivers/net/fm10k/switch/fm10k_regs.h create mode 100644 drivers/net/fm10k/switch/fm10k_sbus.c create mode 100644 drivers/net/fm10k/switch/fm10k_sbus.h create mode 100644 drivers/net/fm10k/switch/fm10k_serdes.c create mode 100644 drivers/net/fm10k/switch/fm10k_serdes.h create mode 100644 drivers/net/fm10k/switch/fm10k_sm.c create mode 100644 drivers/net/fm10k/switch/fm10k_sm.h create mode 100644 drivers/net/fm10k/switch/fm10k_spico_code.c create mode 100644 drivers/net/fm10k/switch/fm10k_spico_code.h create mode 100644 drivers/net/fm10k/switch/fm10k_stats.c create mode 100644 drivers/net/fm10k/switch/fm10k_stats.h create mode 100644 drivers/net/fm10k/switch/fm10k_switch.c create mode 100644 drivers/net/fm10k/switch/fm10k_switch.h -- 1.8.3.1