DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wang, Xiao W" <xiao.w.wang@intel.com>
To: Xiaojun Liu <xiaojun.liu@silicom.co.il>,
	"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" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1 1/5] net/fm10k: add basic functions for switch management
Date: Mon, 16 Mar 2020 06:37:50 +0000
Message-ID: <BN6PR11MB1473F1F88F126EF7C6FE4652B8F90@BN6PR11MB1473.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1582879102-17977-2-git-send-email-xiaojun.liu@silicom.co.il>

Hi Xiaojun,

Comments inline.

Best Regards,
Xiao

> -----Original Message-----
> From: Xiaojun Liu <xiaojun.liu@silicom.co.il>
> Sent: Friday, February 28, 2020 4:38 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 v1 1/5] net/fm10k: add basic functions for switch management

For new version patch, the version number should increment from previous one. Otherwise, it confuses reviewer. 

> 
> 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. Add CONFIG_RTE_FM10K_MANAGEMENT=n
> in config/common_linux.
> 
> To enable the switch management, you need add
> CONFIG_RTE_FM10K_MANAGEMENT=y in
> config/common_linux when building.
> 
> Signed-off-by: Xiaojun Liu <xiaojun.liu@silicom.co.il>
> ---
>  config/common_linux                     |    7 +
>  drivers/net/fm10k/Makefile              |   14 +
>  drivers/net/fm10k/switch/fm10k_debug.h  |   19 +
>  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_switch.h |  335 +++++
>  9 files changed, 3373 insertions(+)
>  create mode 100644 drivers/net/fm10k/switch/fm10k_debug.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_switch.h
> 
> diff --git a/config/common_linux b/config/common_linux
> index 8168106..75a4fa8 100644
> --- a/config/common_linux
> +++ b/config/common_linux
> @@ -66,3 +66,10 @@ CONFIG_RTE_LIBRTE_HINIC_PMD=y
>  # Hisilicon HNS3 PMD driver
>  #
>  CONFIG_RTE_LIBRTE_HNS3_PMD=y
> +
> +#
> +# FM10K switch management
> +#
> +CONFIG_RTE_FM10K_MANAGEMENT=n

CONFIG_RTE_FM10K_SWITCH_MANAGEMENT is more appropriate.

> +
> +

Do not add extra empty lines.

> diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
> index 29e659d..15ea187 100644
> --- a/drivers/net/fm10k/Makefile
> +++ b/drivers/net/fm10k/Makefile
> @@ -11,6 +11,9 @@ LIB = librte_pmd_fm10k.a
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
>  CFLAGS += -DALLOW_EXPERIMENTAL_API
> +ifeq ($(CONFIG_RTE_FM10K_MANAGEMENT),y)
> +CFLAGS += -DENABLE_FM10K_MANAGEMENT
> +endif

As I commented previously, no need to add another new MACRO. Just use RTE_FM10K_MANAGEMENT

> 
>  EXPORT_MAP := rte_pmd_fm10k_version.map
> 
> @@ -49,6 +52,9 @@ endif
>  LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
>  LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_hash
>  LDLIBS += -lrte_bus_pci
> +ifeq ($(CONFIG_RTE_FM10K_MANAGEMENT),y)
> +LDLIBS += -lpthread
> +endif
> 
>  #
>  # Add extra flags for base driver source files to disable warnings in them
> @@ -58,6 +64,10 @@ $(foreach obj, $(BASE_DRIVER_OBJS), $(eval
> CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))
> 
>  VPATH += $(SRCDIR)/base
> 
> +ifeq ($(CONFIG_RTE_FM10K_MANAGEMENT),y)
> +VPATH += $(SRCDIR)/switch
> +endif
> +
>  #
>  # all source are stored in SRCS-y
>  # base driver is based on the package of cid-fm10k.2017.01.24.tar.gz
> @@ -71,6 +81,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) +=
> fm10k_common.c
>  SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_mbx.c
>  SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_vf.c
>  SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_api.c
> +ifeq ($(CONFIG_RTE_FM10K_MANAGEMENT),y)
> +SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_i2c.c
> +SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_sbus.c
> +endif
>  ifeq ($(CONFIG_RTE_ARCH_X86), y)
>  SRCS-$(CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR) += fm10k_rxtx_vec.c
>  endif
> diff --git a/drivers/net/fm10k/switch/fm10k_debug.h
> b/drivers/net/fm10k/switch/fm10k_debug.h
> new file mode 100644
> index 0000000..f7b5c06
> --- /dev/null
> +++ b/drivers/net/fm10k/switch/fm10k_debug.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2019   Silicom Ltd. Connectivity Solutions
> + */
> +
> +#ifndef _FM10K_DEBUG_H_
> +#define _FM10K_DEBUG_H_
> +
> +
> +#define FM10K_SW_ERR(...)		PMD_INIT_LOG(ERR, __VA_ARGS__)
> +#define FM10K_SW_INFO(...)		PMD_INIT_LOG(INFO, __VA_ARGS__)
> +#define FM10K_SW_TRACE(...)		PMD_INIT_LOG(DEBUG, __VA_ARGS__)
> +
> +#define FM10K_SW_ASSERT(...)		do {} while (0)
> +
> +#define FM10K_SW_STATS_TRACE_ENABLE	1
> +#define FM10K_SW_FFU_CONF_TRACE_ENABLE	0
> +#define FM10K_SW_MIRROR_TRACE_ENABLE	0
> +
> +#endif /* _FM10K_DEBUG_H_ */
> diff --git a/drivers/net/fm10k/switch/fm10k_i2c.c
> b/drivers/net/fm10k/switch/fm10k_i2c.c
> new file mode 100644
> index 0000000..28b0c34
> --- /dev/null
> +++ b/drivers/net/fm10k/switch/fm10k_i2c.c
> @@ -0,0 +1,310 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2019   Silicom Ltd. Connectivity Solutions
> + */
> +
> +#include <rte_malloc.h>
> +

Remove this extra empty line, and please re-check other places for similar issues.

> +#include <rte_time.h>
> +#include <rte_kvargs.h>
> +#include <rte_hash.h>
> +#include <rte_flow.h>
> +#include <rte_flow_driver.h>
> +#include <rte_tm_driver.h>
> +
> +#include "fm10k_debug.h"
> +#include "fm10k_i2c.h"
> +#include "fm10k_regs.h"
> +#include "fm10k_switch.h"
> +
[...]

> diff --git a/drivers/net/fm10k/switch/fm10k_i2c.h
> b/drivers/net/fm10k/switch/fm10k_i2c.h
> new file mode 100644
> index 0000000..f835afe
> --- /dev/null
> +++ b/drivers/net/fm10k/switch/fm10k_i2c.h
> @@ -0,0 +1,54 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2019   Silicom Ltd. Connectivity Solutions
> + */
> +
> +#ifndef _FM10K_SW_I2C_H_
> +#define _FM10K_SW_I2C_H_
> +
> +#include <semaphore.h>
> +#include <pthread.h>

Add an empty line here to separate CLIB headers and local headers. Please check all other places.

> +#include "rte_spinlock.h"
> +#include "fm10k_debug.h"
> +

[...]
> diff --git a/drivers/net/fm10k/switch/fm10k_sbus.c
> b/drivers/net/fm10k/switch/fm10k_sbus.c
> new file mode 100644
> index 0000000..d7d656e
> --- /dev/null
> +++ b/drivers/net/fm10k/switch/fm10k_sbus.c
> @@ -0,0 +1,292 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2019   Silicom Ltd. Connectivity Solutions
> + */
> +
> +#include <rte_malloc.h>
> +
> +#include <rte_time.h>
> +#include <rte_kvargs.h>
> +#include <rte_hash.h>
> +#include <rte_flow.h>
> +#include <rte_flow_driver.h>
> +#include <rte_tm_driver.h>
> +
> +#include "fm10k_debug.h"
> +#include "fm10k_regs.h"
> +#include "fm10k_sbus.h"
> +#include "fm10k_switch.h"
> +
> +#define FM10K_SW_SBUS_COMMAND_WAIT_LOCK_US_MAX	4
> +#define FM10K_SW_SBUS_COMMAND_TIMEOUT_US		500000
> +#define FM10K_SW_SBUS_RING_DIVIDER				0x01

The above two lines are not aligned, though in outlook it may be. You can have a check here: http://patches.dpdk.org/patch/66130/
It's also not aligned in my "vim". Note: " set tabstop=8 " is recommended for dpdk.

[...]

  reply	other threads:[~2020-03-16  6:40 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  9:51 [dpdk-dev] [PATCH v2 0/7] support " Xiaojun Liu
2019-12-11  9:52 ` [dpdk-dev] [PATCH v2 1/7] net/fm10k: add i2c sbus registers definition Xiaojun Liu
2019-12-11 15:48   ` Jerin Jacob
2019-12-12  9:35     ` Xiaojun Liu
2019-12-12 17:12       ` Jerin Jacob
2019-12-13  2:44         ` Xiaojun Liu
2019-12-16  4:54           ` Jerin Jacob
2020-02-20 13:59   ` [dpdk-dev] [PATCH v2 0/5] support switch management Xiaojun Liu
2020-02-20 13:59     ` [dpdk-dev] [PATCH v2 1/5] net/fm10k: add basic functions for " Xiaojun Liu
2020-02-28  8:38       ` [dpdk-dev] [PATCH v1 0/5] support fm10k " Xiaojun Liu
2020-02-28  8:38         ` [dpdk-dev] [PATCH v1 1/5] net/fm10k: add basic functions for " Xiaojun Liu
2020-03-16  6:37           ` Wang, Xiao W [this message]
2020-02-28  8:38         ` [dpdk-dev] [PATCH v1 2/5] net/fm10k: add epl serdes and port control functions Xiaojun Liu
2020-03-16  6:48           ` Wang, Xiao W
2020-02-28  8:38         ` [dpdk-dev] [PATCH v1 3/5] net/fm10k: add ffu and statistics and config file functions Xiaojun Liu
2020-03-16  7:04           ` Wang, Xiao W
2020-02-28  8:38         ` [dpdk-dev] [PATCH v1 4/5] net/fm10k: add flow interface and switch management Xiaojun Liu
2020-02-28  8:38         ` [dpdk-dev] [PATCH v1 5/5] net/fm10k: add switch management support Xiaojun Liu
2020-03-16  7:34           ` Wang, Xiao W
2020-03-20  6:58           ` [dpdk-dev] [PATCH v3 0/5] support fm10k switch management Xiaojun Liu
2020-03-20  6:58             ` [dpdk-dev] [PATCH v3 1/5] net/fm10k: add basic functions for " Xiaojun Liu
2020-04-02  8:41               ` Wang, Xiao W
2020-04-08  3:25                 ` Xiaojun Liu
2020-03-20  6:58             ` [dpdk-dev] [PATCH v3 2/5] net/fm10k: add epl serdes and port control functions Xiaojun Liu
2020-03-20  6:58             ` [dpdk-dev] [PATCH v3 3/5] net/fm10k: add ffu and statistics and config file functions Xiaojun Liu
2020-03-20  6:58             ` [dpdk-dev] [PATCH v3 4/5] net/fm10k: add flow interface and switch management Xiaojun Liu
2020-04-02  8:55               ` Wang, Xiao W
2020-04-09  6:24                 ` Xiaojun Liu
2020-03-20  6:58             ` [dpdk-dev] [PATCH v3 5/5] net/fm10k: add switch management support Xiaojun Liu
2020-04-02  9:12               ` Wang, Xiao W
2020-04-09  6:32                 ` Xiaojun Liu
2020-02-20 13:59     ` [dpdk-dev] [PATCH v2 2/5] net/fm10k: add epl serdes and port control functions Xiaojun Liu
2020-02-20 13:59     ` [dpdk-dev] [PATCH v2 3/5] net/fm10k: add ffu and statistics and config file functions Xiaojun Liu
2020-02-20 13:59     ` [dpdk-dev] [PATCH v2 4/5] net/fm10k: add flow interface and switch management Xiaojun Liu
2020-02-20 13:59     ` [dpdk-dev] [PATCH v2 5/5] net/fm10k: add switch management support Xiaojun Liu
2020-02-25 11:28       ` Wang, Xiao W
2020-02-25 12:56         ` Xiaojun Liu
2020-03-05  1:23         ` Xiaojun Liu
2019-12-11  9:52 ` [dpdk-dev] [PATCH v2 2/7] net/fm10k: add some modules of port Xiaojun Liu
2019-12-11  9:52 ` [dpdk-dev] [PATCH v2 3/7] net/fm10k: add config ffu statistics support Xiaojun Liu
2019-12-11  9:52 ` [dpdk-dev] [PATCH v2 4/7] net/fm10k: add flow and switch management Xiaojun Liu
2019-12-11  9:52 ` [dpdk-dev] [PATCH v2 5/7] net/fm10k: add switch initialization Xiaojun Liu
2019-12-11  9:52 ` [dpdk-dev] [PATCH v2 6/7] net/fm10k: add mirror and filter ctrl Xiaojun Liu
2019-12-11  9:52 ` [dpdk-dev] [PATCH v2 7/7] net/fm10k: add dpdk port mapping Xiaojun Liu
2020-01-21  2:53 ` [dpdk-dev] [PATCH v2 0/7] support switch management Wang, Xiao W
2020-01-21  6:15   ` Xiaojun Liu
2020-02-11 10:31     ` Wang, Xiao W
2020-02-14  2:46       ` Xiaojun Liu
     [not found]       ` <ORIGINAL-RELEASE-1581835643311863404-DB7PR04MB5196A5418792DFB1F96DB8B7BD150@DB7PR04MB5196.eurprd04.prod.outlook.com>
2020-02-19  5:58         ` Xiaojun Liu
2020-02-19 10:56           ` Wang, Xiao W

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN6PR11MB1473F1F88F126EF7C6FE4652B8F90@BN6PR11MB1473.namprd11.prod.outlook.com \
    --to=xiao.w.wang@intel.com \
    --cc=dev@dpdk.org \
    --cc=jacob.e.keller@intel.com \
    --cc=ngai-mint.kwan@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=xiaojun.liu@silicom.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git