[v4,0/5] support fm10k switch management
mbox series

Message ID 1586413588-5759-1-git-send-email-xiaojun.liu@silicom.co.il
Headers show
Series
  • support fm10k switch management
Related show

Message

Xiaojun Liu April 9, 2020, 6:26 a.m. UTC
V4:
* Add I2C to control the inside LED and PHY.
* Add SBUS to communicate with spico.
* Add registers defination.
* Add switch management log API.
* Add switch management structures.
* Add epl serdes include loading spico,
  controlling pcsl, dma, dfe, ical.
* Add spico code.
* Add state machine for epl lane and port.
* Add external port management.
* Add ffu to support offload flow into HW.
  It supports forward, mirror, push VLAN, pop VLAN.
* Add config file to configure debug log, port speed,
  epl port mapping dpdk port, flowset.
* Add statistics includes epl port, ffu rule, dpdk port.
* Add flow interface to support offload flow into HW.
* Add switch management, includes initialization,
  port mapping, epl port link, LED controller, interrupt handler.
* Split dev_init to 2 parts in ethdev. First only register
  the port in switch management; second init hook will be
  called after all the pf are registered.
* Add switch interrupt support.
* Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
* Add fm10k_dev_filter_ctrl to support flow operation.
* Add dpdk port and pf mapping.
* 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

 config/common_linux                         |    5 +
 doc/guides/nics/fm10k.rst                   |    5 +
 doc/guides/rel_notes/release_20_05.rst      |    7 +
 drivers/net/fm10k/Makefile                  |   20 +
 drivers/net/fm10k/base/fm10k_type.h         |    1 +
 drivers/net/fm10k/fm10k_ethdev.c            |  555 ++++-
 drivers/net/fm10k/switch/fm10k_config.c     |  854 ++++++++
 drivers/net/fm10k/switch/fm10k_config.h     |  176 ++
 drivers/net/fm10k/switch/fm10k_debug.h      |   18 +
 drivers/net/fm10k/switch/fm10k_ext_port.c   |  837 ++++++++
 drivers/net/fm10k/switch/fm10k_ext_port.h   |  134 ++
 drivers/net/fm10k/switch/fm10k_ffu.c        | 1239 +++++++++++
 drivers/net/fm10k/switch/fm10k_ffu.h        |   30 +
 drivers/net/fm10k/switch/fm10k_flow.c       |  864 ++++++++
 drivers/net/fm10k/switch/fm10k_flow.h       |   26 +
 drivers/net/fm10k/switch/fm10k_i2c.c        |  309 +++
 drivers/net/fm10k/switch/fm10k_i2c.h        |   55 +
 drivers/net/fm10k/switch/fm10k_regs.h       | 2298 +++++++++++++++++++++
 drivers/net/fm10k/switch/fm10k_sbus.c       |  291 +++
 drivers/net/fm10k/switch/fm10k_sbus.h       |   38 +
 drivers/net/fm10k/switch/fm10k_serdes.c     | 1929 +++++++++++++++++
 drivers/net/fm10k/switch/fm10k_serdes.h     |   30 +
 drivers/net/fm10k/switch/fm10k_sm.c         |  188 ++
 drivers/net/fm10k/switch/fm10k_sm.h         |   79 +
 drivers/net/fm10k/switch/fm10k_spico_code.c | 2963 +++++++++++++++++++++++++++
 drivers/net/fm10k/switch/fm10k_spico_code.h |   21 +
 drivers/net/fm10k/switch/fm10k_stats.c      | 1226 +++++++++++
 drivers/net/fm10k/switch/fm10k_stats.h      |  253 +++
 drivers/net/fm10k/switch/fm10k_switch.c     | 2362 +++++++++++++++++++++
 drivers/net/fm10k/switch/fm10k_switch.h     |  465 +++++
 30 files changed, 17242 insertions(+), 36 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

Comments

Wang, Xiao W April 16, 2020, 8:33 a.m. UTC | #1
For the series, Reviewed-by: Xiao Wang <xiao.w.wang@intel.com>

Best Regards,
Xiao

> -----Original Message-----
> From: Xiaojun Liu <xiaojun.liu@silicom.co.il>
> Sent: Thursday, April 9, 2020 2:26 PM
> To: Wang, Xiao W <xiao.w.wang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Kwan, Ngai-mint <ngai-mint.kwan@intel.com>; Keller,
> Jacob E <jacob.e.keller@intel.com>
> Cc: dev@dpdk.org; Xiaojun Liu <xiaojun.liu@silicom.co.il>
> Subject: [PATCH v4 0/5] support fm10k switch management
> 
> V4:
> * Add I2C to control the inside LED and PHY.
> * Add SBUS to communicate with spico.
> * Add registers defination.
> * Add switch management log API.
> * Add switch management structures.
> * Add epl serdes include loading spico,
>   controlling pcsl, dma, dfe, ical.
> * Add spico code.
> * Add state machine for epl lane and port.
> * Add external port management.
> * Add ffu to support offload flow into HW.
>   It supports forward, mirror, push VLAN, pop VLAN.
> * Add config file to configure debug log, port speed,
>   epl port mapping dpdk port, flowset.
> * Add statistics includes epl port, ffu rule, dpdk port.
> * Add flow interface to support offload flow into HW.
> * Add switch management, includes initialization,
>   port mapping, epl port link, LED controller, interrupt handler.
> * Split dev_init to 2 parts in ethdev. First only register
>   the port in switch management; second init hook will be
>   called after all the pf are registered.
> * Add switch interrupt support.
> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
> * Add fm10k_dev_filter_ctrl to support flow operation.
> * Add dpdk port and pf mapping.
> * 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
> 
>  config/common_linux                         |    5 +
>  doc/guides/nics/fm10k.rst                   |    5 +
>  doc/guides/rel_notes/release_20_05.rst      |    7 +
>  drivers/net/fm10k/Makefile                  |   20 +
>  drivers/net/fm10k/base/fm10k_type.h         |    1 +
>  drivers/net/fm10k/fm10k_ethdev.c            |  555 ++++-
>  drivers/net/fm10k/switch/fm10k_config.c     |  854 ++++++++
>  drivers/net/fm10k/switch/fm10k_config.h     |  176 ++
>  drivers/net/fm10k/switch/fm10k_debug.h      |   18 +
>  drivers/net/fm10k/switch/fm10k_ext_port.c   |  837 ++++++++
>  drivers/net/fm10k/switch/fm10k_ext_port.h   |  134 ++
>  drivers/net/fm10k/switch/fm10k_ffu.c        | 1239 +++++++++++
>  drivers/net/fm10k/switch/fm10k_ffu.h        |   30 +
>  drivers/net/fm10k/switch/fm10k_flow.c       |  864 ++++++++
>  drivers/net/fm10k/switch/fm10k_flow.h       |   26 +
>  drivers/net/fm10k/switch/fm10k_i2c.c        |  309 +++
>  drivers/net/fm10k/switch/fm10k_i2c.h        |   55 +
>  drivers/net/fm10k/switch/fm10k_regs.h       | 2298 +++++++++++++++++++++
>  drivers/net/fm10k/switch/fm10k_sbus.c       |  291 +++
>  drivers/net/fm10k/switch/fm10k_sbus.h       |   38 +
>  drivers/net/fm10k/switch/fm10k_serdes.c     | 1929 +++++++++++++++++
>  drivers/net/fm10k/switch/fm10k_serdes.h     |   30 +
>  drivers/net/fm10k/switch/fm10k_sm.c         |  188 ++
>  drivers/net/fm10k/switch/fm10k_sm.h         |   79 +
>  drivers/net/fm10k/switch/fm10k_spico_code.c | 2963
> +++++++++++++++++++++++++++
>  drivers/net/fm10k/switch/fm10k_spico_code.h |   21 +
>  drivers/net/fm10k/switch/fm10k_stats.c      | 1226 +++++++++++
>  drivers/net/fm10k/switch/fm10k_stats.h      |  253 +++
>  drivers/net/fm10k/switch/fm10k_switch.c     | 2362 +++++++++++++++++++++
>  drivers/net/fm10k/switch/fm10k_switch.h     |  465 +++++
>  30 files changed, 17242 insertions(+), 36 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
Xiaolong Ye April 17, 2020, 4:02 a.m. UTC | #2
On 04/16, Wang, Xiao W wrote:
>For the series, Reviewed-by: Xiao Wang <xiao.w.wang@intel.com>
>
>Best Regards,
>Xiao
>
>> -----Original Message-----
>> From: Xiaojun Liu <xiaojun.liu@silicom.co.il>
>> Sent: Thursday, April 9, 2020 2:26 PM
>> To: Wang, Xiao W <xiao.w.wang@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>; Kwan, Ngai-mint <ngai-mint.kwan@intel.com>; Keller,
>> Jacob E <jacob.e.keller@intel.com>
>> Cc: dev@dpdk.org; Xiaojun Liu <xiaojun.liu@silicom.co.il>
>> Subject: [PATCH v4 0/5] support fm10k switch management
>>
>> V4:
>> * Add I2C to control the inside LED and PHY.
>> * Add SBUS to communicate with spico.
>> * Add registers defination.
>> * Add switch management log API.
>> * Add switch management structures.
>> * Add epl serdes include loading spico,
>>   controlling pcsl, dma, dfe, ical.
>> * Add spico code.
>> * Add state machine for epl lane and port.
>> * Add external port management.
>> * Add ffu to support offload flow into HW.
>>   It supports forward, mirror, push VLAN, pop VLAN.
>> * Add config file to configure debug log, port speed,
>>   epl port mapping dpdk port, flowset.
>> * Add statistics includes epl port, ffu rule, dpdk port.
>> * Add flow interface to support offload flow into HW.
>> * Add switch management, includes initialization,
>>   port mapping, epl port link, LED controller, interrupt handler.
>> * Split dev_init to 2 parts in ethdev. First only register
>>   the port in switch management; second init hook will be
>>   called after all the pf are registered.
>> * Add switch interrupt support.
>> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
>> * Add fm10k_dev_filter_ctrl to support flow operation.
>> * Add dpdk port and pf mapping.
>> * 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
>>
>>  config/common_linux                         |    5 +
>>  doc/guides/nics/fm10k.rst                   |    5 +
>>  doc/guides/rel_notes/release_20_05.rst      |    7 +
>>  drivers/net/fm10k/Makefile                  |   20 +
>>  drivers/net/fm10k/base/fm10k_type.h         |    1 +
>>  drivers/net/fm10k/fm10k_ethdev.c            |  555 ++++-
>>  drivers/net/fm10k/switch/fm10k_config.c     |  854 ++++++++
>>  drivers/net/fm10k/switch/fm10k_config.h     |  176 ++
>>  drivers/net/fm10k/switch/fm10k_debug.h      |   18 +
>>  drivers/net/fm10k/switch/fm10k_ext_port.c   |  837 ++++++++
>>  drivers/net/fm10k/switch/fm10k_ext_port.h   |  134 ++
>>  drivers/net/fm10k/switch/fm10k_ffu.c        | 1239 +++++++++++
>>  drivers/net/fm10k/switch/fm10k_ffu.h        |   30 +
>>  drivers/net/fm10k/switch/fm10k_flow.c       |  864 ++++++++
>>  drivers/net/fm10k/switch/fm10k_flow.h       |   26 +
>>  drivers/net/fm10k/switch/fm10k_i2c.c        |  309 +++
>>  drivers/net/fm10k/switch/fm10k_i2c.h        |   55 +
>>  drivers/net/fm10k/switch/fm10k_regs.h       | 2298 +++++++++++++++++++++
>>  drivers/net/fm10k/switch/fm10k_sbus.c       |  291 +++
>>  drivers/net/fm10k/switch/fm10k_sbus.h       |   38 +
>>  drivers/net/fm10k/switch/fm10k_serdes.c     | 1929 +++++++++++++++++
>>  drivers/net/fm10k/switch/fm10k_serdes.h     |   30 +
>>  drivers/net/fm10k/switch/fm10k_sm.c         |  188 ++
>>  drivers/net/fm10k/switch/fm10k_sm.h         |   79 +
>>  drivers/net/fm10k/switch/fm10k_spico_code.c | 2963
>> +++++++++++++++++++++++++++
>>  drivers/net/fm10k/switch/fm10k_spico_code.h |   21 +
>>  drivers/net/fm10k/switch/fm10k_stats.c      | 1226 +++++++++++
>>  drivers/net/fm10k/switch/fm10k_stats.h      |  253 +++
>>  drivers/net/fm10k/switch/fm10k_switch.c     | 2362 +++++++++++++++++++++
>>  drivers/net/fm10k/switch/fm10k_switch.h     |  465 +++++
>>  30 files changed, 17242 insertions(+), 36 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
>

Applied to dpdk-next-net-intel, Thanks.
Ferruh Yigit April 17, 2020, 2:18 p.m. UTC | #3
On 4/9/2020 7:26 AM, Xiaojun Liu wrote:
> V4:
> * Add I2C to control the inside LED and PHY.
> * Add SBUS to communicate with spico.
> * Add registers defination.
> * Add switch management log API.
> * Add switch management structures.
> * Add epl serdes include loading spico,
>   controlling pcsl, dma, dfe, ical.
> * Add spico code.
> * Add state machine for epl lane and port.
> * Add external port management.
> * Add ffu to support offload flow into HW.
>   It supports forward, mirror, push VLAN, pop VLAN.
> * Add config file to configure debug log, port speed,
>   epl port mapping dpdk port, flowset.
> * Add statistics includes epl port, ffu rule, dpdk port.
> * Add flow interface to support offload flow into HW.
> * Add switch management, includes initialization,
>   port mapping, epl port link, LED controller, interrupt handler.
> * Split dev_init to 2 parts in ethdev. First only register
>   the port in switch management; second init hook will be
>   called after all the pf are registered.
> * Add switch interrupt support.
> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
> * Add fm10k_dev_filter_ctrl to support flow operation.
> * Add dpdk port and pf mapping.
> * 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
> 

With 'CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y' I am getting following build errors,
can you please check them?

1) T=ppc_64-power8-linuxapp-gcc

.../drivers/net/fm10k/switch/fm10k_stats.c:758:26: error: ‘ts.tv_sec’ is used
uninitialized in this function [-Werror=uninitialized]
  counters->timestamp = ts.tv_sec * 1000000 + ts.tv_usec;
                        ~~^~~~~~~
.../drivers/net/fm10k/switch/fm10k_stats.c:758:48: error: ‘ts.tv_usec’ is used
uninitialized in this function [-Werror=uninitialized]
  counters->timestamp = ts.tv_sec * 1000000 + ts.tv_usec;
                                              ~~^~~~~~~~


2) T=arm64-armv8a-linuxapp-gcc

.../drivers/net/fm10k/switch/../base/fm10k_osdep.h:49:20: error: conflicting
types for ‘u64’...
 #define __le64     u64...
                    ^~~...
.../drivers/net/fm10k/switch/../base/fm10k_osdep.h:44:20: note: previous
declaration of ‘u64’ was here...
 typedef uint64_t   u64;...
                    ^~~...



3) T=x86_64-native-linuxapp-clang

.../drivers/net/fm10k/switch/fm10k_ffu.c:821:6: error: variable 'tcam_slice' is
used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (sglort_vid_tcam) {
            ^~~~~~~~~~~~~~~
.../drivers/net/fm10k/switch/fm10k_ffu.c:838:32: note: uninitialized use occurs here
        fm10k_ffu_always_mismatch(sw, tcam_slice + 1, rule_id);
                                      ^~~~~~~~~~
.../drivers/net/fm10k/switch/fm10k_ffu.c:821:2: note: remove the 'if' if its
condition is always true
        if (sglort_vid_tcam) {
        ^~~~~~~~~~~~~~~~~~~~~
.../drivers/net/fm10k/switch/fm10k_ffu.c:775:35: note: initialize the variable
'tcam_slice' to silence this warning
        uint16_t sram_idx = 0, tcam_slice, sram_slice, i;
                                         ^
                                          = 0
.../drivers/net/fm10k/switch/fm10k_ffu.c:906:6: error: variable 'tcam_slice' is
used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (sglort_vid_tcam) {
            ^~~~~~~~~~~~~~~
.../drivers/net/fm10k/switch/fm10k_ffu.c:923:32: note: uninitialized use occurs here
        fm10k_ffu_always_mismatch(sw, tcam_slice + 1, rule_id);
                                      ^~~~~~~~~~
.../drivers/net/fm10k/switch/fm10k_ffu.c:906:2: note: remove the 'if' if its
condition is always true
        if (sglort_vid_tcam) {
        ^~~~~~~~~~~~~~~~~~~~~
.../drivers/net/fm10k/switch/fm10k_ffu.c:869:35: note: initialize the variable
'tcam_slice' to silence this warning
        uint16_t sram_idx = 0, tcam_slice, sram_slice, i;
                                         ^
                                          = 0

.../drivers/net/fm10k/switch/fm10k_serdes.c:1922:9: error: taking the absolute
value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
        diff = abs(val2 - val1);
               ^
.../drivers/net/fm10k/switch/fm10k_serdes.c:1922:9: note: remove the call to
'abs' since unsigned values cannot be negative
        diff = abs(val2 - val1);
               ^~~



4) T=x86_64-native-linuxapp-gcc

.../drivers/net/fm10k/switch/fm10k_serdes.c: In function
‘fm10k_epl_serdes_get_ical_result’:
.../drivers/net/fm10k/switch/fm10k_serdes.c:1922:9: error: taking the absolute
value of unsigned type ‘uint32_t’ {aka ‘unsigned int’} has no effect
[-Werror=absolute-value]
 1922 |  diff = abs(val2 - val1);
      |         ^~~
cc1: all warnings being treated as errors
make[7]: *** [.../mk/internal/rte.compile-pre.mk:114: fm10k_serdes.o] Error 1
make[7]: *** Waiting for unfinished jobs....
.../drivers/net/fm10k/switch/fm10k_stats.c: In function ‘fm10k_get_port_counters’:
.../drivers/net/fm10k/switch/fm10k_stats.c:758:26: error: ‘ts.tv_sec’ is used
uninitialized in this function [-Werror=uninitialized]
  758 |  counters->timestamp = ts.tv_sec * 1000000 + ts.tv_usec;
      |                        ~~^~~~~~~
.../drivers/net/fm10k/switch/fm10k_stats.c:758:48: error: ‘ts.tv_usec’ is used
uninitialized in this function [-Werror=uninitialized]
  758 |  counters->timestamp = ts.tv_sec * 1000000 + ts.tv_usec;
      |                                              ~~^~~~~~~~
cc1: all warnings being treated as errors
Xiaolong Ye April 20, 2020, 4:55 a.m. UTC | #4
On 04/17, Ferruh Yigit wrote:
>On 4/9/2020 7:26 AM, Xiaojun Liu wrote:
>> V4:
>> * Add I2C to control the inside LED and PHY.
>> * Add SBUS to communicate with spico.
>> * Add registers defination.
>> * Add switch management log API.
>> * Add switch management structures.
>> * Add epl serdes include loading spico,
>>   controlling pcsl, dma, dfe, ical.
>> * Add spico code.
>> * Add state machine for epl lane and port.
>> * Add external port management.
>> * Add ffu to support offload flow into HW.
>>   It supports forward, mirror, push VLAN, pop VLAN.
>> * Add config file to configure debug log, port speed,
>>   epl port mapping dpdk port, flowset.
>> * Add statistics includes epl port, ffu rule, dpdk port.
>> * Add flow interface to support offload flow into HW.
>> * Add switch management, includes initialization,
>>   port mapping, epl port link, LED controller, interrupt handler.
>> * Split dev_init to 2 parts in ethdev. First only register
>>   the port in switch management; second init hook will be
>>   called after all the pf are registered.
>> * Add switch interrupt support.
>> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
>> * Add fm10k_dev_filter_ctrl to support flow operation.
>> * Add dpdk port and pf mapping.
>> * 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
>> 
>
>With 'CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y' I am getting following build errors,
>can you please check them?
>

Thanks Ferruh for catching the build error, forgot to build test with CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y 
when applying it :(

Thanks,
Xiaolong
Xiaojun Liu April 20, 2020, 6:37 a.m. UTC | #5
Hi Ferruh,

Thanks! I checked the building by "devtools/test-build.sh x86_64-native-linux-gcc+next+shared", I didn't see any error.
Could you tell me how do you build it and what's the error ?

Best regards,
Xiaojun

-----Original Message-----
From: Ye Xiaolong [mailto:xiaolong.ye@intel.com] 
Sent: Monday, April 20, 2020 12:56 PM
To: Ferruh Yigit
Cc: Xiaojun Liu; xiao.w.wang@intel.com; qi.z.zhang@intel.com; ngai-mint.kwan@intel.com; jacob.e.keller@intel.com; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v4 0/5] support fm10k switch management

On 04/17, Ferruh Yigit wrote:
>On 4/9/2020 7:26 AM, Xiaojun Liu wrote:
>> V4:
>> * Add I2C to control the inside LED and PHY.
>> * Add SBUS to communicate with spico.
>> * Add registers defination.
>> * Add switch management log API.
>> * Add switch management structures.
>> * Add epl serdes include loading spico,
>>   controlling pcsl, dma, dfe, ical.
>> * Add spico code.
>> * Add state machine for epl lane and port.
>> * Add external port management.
>> * Add ffu to support offload flow into HW.
>>   It supports forward, mirror, push VLAN, pop VLAN.
>> * Add config file to configure debug log, port speed,
>>   epl port mapping dpdk port, flowset.
>> * Add statistics includes epl port, ffu rule, dpdk port.
>> * Add flow interface to support offload flow into HW.
>> * Add switch management, includes initialization,
>>   port mapping, epl port link, LED controller, interrupt handler.
>> * Split dev_init to 2 parts in ethdev. First only register
>>   the port in switch management; second init hook will be
>>   called after all the pf are registered.
>> * Add switch interrupt support.
>> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
>> * Add fm10k_dev_filter_ctrl to support flow operation.
>> * Add dpdk port and pf mapping.
>> * 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
>> 
>
>With 'CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y' I am getting following build errors,
>can you please check them?
>

Thanks Ferruh for catching the build error, forgot to build test with CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y 
when applying it :(

Thanks,
Xiaolong
Xiaolong Ye April 20, 2020, 8:14 a.m. UTC | #6
On 04/20, Xiaojun Liu wrote:
>Hi Ferruh,
>
>Thanks! I checked the building by "devtools/test-build.sh x86_64-native-linux-gcc+next+shared", I didn't see any error.
>Could you tell me how do you build it and what's the error ?

Which gcc are you system using? I can reproduce the build error with gcc 7.5.0
via ./devtools/test-build.sh x86_64-native-linux-gcc+next+shared.


Thanks,
Xiaolong
 
>
>Best regards,
>Xiaojun
>
>-----Original Message-----
>From: Ye Xiaolong [mailto:xiaolong.ye@intel.com] 
>Sent: Monday, April 20, 2020 12:56 PM
>To: Ferruh Yigit
>Cc: Xiaojun Liu; xiao.w.wang@intel.com; qi.z.zhang@intel.com; ngai-mint.kwan@intel.com; jacob.e.keller@intel.com; dev@dpdk.org
>Subject: Re: [dpdk-dev] [PATCH v4 0/5] support fm10k switch management
>
>On 04/17, Ferruh Yigit wrote:
>>On 4/9/2020 7:26 AM, Xiaojun Liu wrote:
>>> V4:
>>> * Add I2C to control the inside LED and PHY.
>>> * Add SBUS to communicate with spico.
>>> * Add registers defination.
>>> * Add switch management log API.
>>> * Add switch management structures.
>>> * Add epl serdes include loading spico,
>>>   controlling pcsl, dma, dfe, ical.
>>> * Add spico code.
>>> * Add state machine for epl lane and port.
>>> * Add external port management.
>>> * Add ffu to support offload flow into HW.
>>>   It supports forward, mirror, push VLAN, pop VLAN.
>>> * Add config file to configure debug log, port speed,
>>>   epl port mapping dpdk port, flowset.
>>> * Add statistics includes epl port, ffu rule, dpdk port.
>>> * Add flow interface to support offload flow into HW.
>>> * Add switch management, includes initialization,
>>>   port mapping, epl port link, LED controller, interrupt handler.
>>> * Split dev_init to 2 parts in ethdev. First only register
>>>   the port in switch management; second init hook will be
>>>   called after all the pf are registered.
>>> * Add switch interrupt support.
>>> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
>>> * Add fm10k_dev_filter_ctrl to support flow operation.
>>> * Add dpdk port and pf mapping.
>>> * 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
>>> 
>>
>>With 'CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y' I am getting following build errors,
>>can you please check them?
>>
>
>Thanks Ferruh for catching the build error, forgot to build test with CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y 
>when applying it :(
>
>Thanks,
>Xiaolong
Xiaojun Liu April 20, 2020, 8:24 a.m. UTC | #7
Hi Xiaolong,

Thank you! My gcc version is 4.8.5. I will try 7.5.0.

Best regards,
Xiaojun

-----Original Message-----
From: Ye Xiaolong [mailto:xiaolong.ye@intel.com] 
Sent: Monday, April 20, 2020 4:15 PM
To: Xiaojun Liu
Cc: Ferruh Yigit; xiao.w.wang@intel.com; qi.z.zhang@intel.com; ngai-mint.kwan@intel.com; jacob.e.keller@intel.com; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v4 0/5] support fm10k switch management

On 04/20, Xiaojun Liu wrote:
>Hi Ferruh,
>
>Thanks! I checked the building by "devtools/test-build.sh x86_64-native-linux-gcc+next+shared", I didn't see any error.
>Could you tell me how do you build it and what's the error ?

Which gcc are you system using? I can reproduce the build error with gcc 7.5.0
via ./devtools/test-build.sh x86_64-native-linux-gcc+next+shared.


Thanks,
Xiaolong
 
>
>Best regards,
>Xiaojun
>
>-----Original Message-----
>From: Ye Xiaolong [mailto:xiaolong.ye@intel.com] 
>Sent: Monday, April 20, 2020 12:56 PM
>To: Ferruh Yigit
>Cc: Xiaojun Liu; xiao.w.wang@intel.com; qi.z.zhang@intel.com; ngai-mint.kwan@intel.com; jacob.e.keller@intel.com; dev@dpdk.org
>Subject: Re: [dpdk-dev] [PATCH v4 0/5] support fm10k switch management
>
>On 04/17, Ferruh Yigit wrote:
>>On 4/9/2020 7:26 AM, Xiaojun Liu wrote:
>>> V4:
>>> * Add I2C to control the inside LED and PHY.
>>> * Add SBUS to communicate with spico.
>>> * Add registers defination.
>>> * Add switch management log API.
>>> * Add switch management structures.
>>> * Add epl serdes include loading spico,
>>>   controlling pcsl, dma, dfe, ical.
>>> * Add spico code.
>>> * Add state machine for epl lane and port.
>>> * Add external port management.
>>> * Add ffu to support offload flow into HW.
>>>   It supports forward, mirror, push VLAN, pop VLAN.
>>> * Add config file to configure debug log, port speed,
>>>   epl port mapping dpdk port, flowset.
>>> * Add statistics includes epl port, ffu rule, dpdk port.
>>> * Add flow interface to support offload flow into HW.
>>> * Add switch management, includes initialization,
>>>   port mapping, epl port link, LED controller, interrupt handler.
>>> * Split dev_init to 2 parts in ethdev. First only register
>>>   the port in switch management; second init hook will be
>>>   called after all the pf are registered.
>>> * Add switch interrupt support.
>>> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
>>> * Add fm10k_dev_filter_ctrl to support flow operation.
>>> * Add dpdk port and pf mapping.
>>> * 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
>>> 
>>
>>With 'CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y' I am getting following build errors,
>>can you please check them?
>>
>
>Thanks Ferruh for catching the build error, forgot to build test with CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y 
>when applying it :(
>
>Thanks,
>Xiaolong
Ferruh Yigit April 20, 2020, 1:05 p.m. UTC | #8
On 4/20/2020 9:24 AM, Xiaojun Liu wrote:
> Hi Xiaolong,
> 
> Thank you! My gcc version is 4.8.5. I will try 7.5.0.

The compiler versions I am using:
- gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
- clang version 9.0.1 (Fedora 9.0.1-2.fc31)
- aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2018.08-git-00807-g0184fa3)
8.2.0
- powerpc64le-linux-gnu-gcc (GCC) 6.2.1 20160822 (Advance-Toolchain-at10.0) IBM
AT 10 branch, based on subversion id 239677.
- icc (ICC) 19.1.0.166 20191121

> 
> Best regards,
> Xiaojun
> 
> -----Original Message-----
> From: Ye Xiaolong [mailto:xiaolong.ye@intel.com] 
> Sent: Monday, April 20, 2020 4:15 PM
> To: Xiaojun Liu
> Cc: Ferruh Yigit; xiao.w.wang@intel.com; qi.z.zhang@intel.com; ngai-mint.kwan@intel.com; jacob.e.keller@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4 0/5] support fm10k switch management
> 
> On 04/20, Xiaojun Liu wrote:
>> Hi Ferruh,
>>
>> Thanks! I checked the building by "devtools/test-build.sh x86_64-native-linux-gcc+next+shared", I didn't see any error.
>> Could you tell me how do you build it and what's the error ?
> 
> Which gcc are you system using? I can reproduce the build error with gcc 7.5.0
> via ./devtools/test-build.sh x86_64-native-linux-gcc+next+shared.
> 
> 
> Thanks,
> Xiaolong
>  
>>
>> Best regards,
>> Xiaojun
>>
>> -----Original Message-----
>> From: Ye Xiaolong [mailto:xiaolong.ye@intel.com] 
>> Sent: Monday, April 20, 2020 12:56 PM
>> To: Ferruh Yigit
>> Cc: Xiaojun Liu; xiao.w.wang@intel.com; qi.z.zhang@intel.com; ngai-mint.kwan@intel.com; jacob.e.keller@intel.com; dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v4 0/5] support fm10k switch management
>>
>> On 04/17, Ferruh Yigit wrote:
>>> On 4/9/2020 7:26 AM, Xiaojun Liu wrote:
>>>> V4:
>>>> * Add I2C to control the inside LED and PHY.
>>>> * Add SBUS to communicate with spico.
>>>> * Add registers defination.
>>>> * Add switch management log API.
>>>> * Add switch management structures.
>>>> * Add epl serdes include loading spico,
>>>>   controlling pcsl, dma, dfe, ical.
>>>> * Add spico code.
>>>> * Add state machine for epl lane and port.
>>>> * Add external port management.
>>>> * Add ffu to support offload flow into HW.
>>>>   It supports forward, mirror, push VLAN, pop VLAN.
>>>> * Add config file to configure debug log, port speed,
>>>>   epl port mapping dpdk port, flowset.
>>>> * Add statistics includes epl port, ffu rule, dpdk port.
>>>> * Add flow interface to support offload flow into HW.
>>>> * Add switch management, includes initialization,
>>>>   port mapping, epl port link, LED controller, interrupt handler.
>>>> * Split dev_init to 2 parts in ethdev. First only register
>>>>   the port in switch management; second init hook will be
>>>>   called after all the pf are registered.
>>>> * Add switch interrupt support.
>>>> * Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset.
>>>> * Add fm10k_dev_filter_ctrl to support flow operation.
>>>> * Add dpdk port and pf mapping.
>>>> * 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
>>>>
>>>
>>> With 'CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y' I am getting following build errors,
>>> can you please check them?
>>>
>>
>> Thanks Ferruh for catching the build error, forgot to build test with CONFIG_RTE_FM10K_SWITCH_MANAGEMENT=y 
>> when applying it :(
>>
>> Thanks,
>> Xiaolong