On Fri, Dec 13, 2019 at 8:14 AM Xiaojun Liu <xiaojun....@silicom.co.il> wrote: > > 1. FM10K is the i2c master, the PCA9545/PCA9505/PCA9538 are the slave. > 2. All the i2c slave connect on board to FM10K SoC. > 3. To control the PHY and LED
Yes. These are onboard devices, so it makes sense to segregate code for i2c master(in this case FM10K) and slave and bus API to reuse the logic. This to address the case where PCA9545 used by other i2c master or new board come up with a new i2c device instead of PCA9545 etc. And yes, DPDK is missing all these infrastructure code pieces. So it is good to add infrastructure first. I am leaving the decision to you and/or community. > > > -----Original Message----- > From: Jerin Jacob [mailto:jerinjac...@gmail.com] > Sent: Friday, December 13, 2019 1:12 AM > To: Xiaojun Liu > Cc: xiao.w.w...@intel.com; qi.z.zh...@intel.com; ngai-mint.k...@intel.com; > jakub.for...@intel.co; jacob.e.kel...@intel.com; dev@dpdk.org; Jeff Zheng; > Eyal Cohen > Subject: Re: [dpdk-dev] [PATCH v2 1/7] net/fm10k: add i2c sbus registers > definition > > On Thu, Dec 12, 2019 at 3:05 PM Xiaojun Liu <xiaojun....@silicom.co.il> wrote: > > > > This is not a generic i2c bus, but rather an indirect access to i2c devices > > through FM10k registers. It's only purpose is to support the fm10k chip. > > Also there's currently no i2c bus support framework in DPDK. > > To understand it better: > > # Who are the i2c master and i2c slave here? > # Is i2c slave connected on board or in-built to FM10K SoC? > # What is the purpose of the i2c API in the ethdev driver? > > > > > > > -----Original Message----- > > From: Jerin Jacob [mailto:jerinjac...@gmail.com] > > Sent: Wednesday, December 11, 2019 11:48 PM > > To: Xiaojun Liu > > Cc: xiao.w.w...@intel.com; qi.z.zh...@intel.com; ngai-mint.k...@intel.com; > > jakub.for...@intel.co; jacob.e.kel...@intel.com; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v2 1/7] net/fm10k: add i2c sbus registers > > definition > > > > On Wed, Dec 11, 2019 at 3:22 PM Xiaojun Liu <xiaojun....@silicom.co.il> > > wrote: > > > > > > To support switch management, add the following files: > > > Add fm10k/switch/fm10k_debug.h(define log Macros). > > > Add fm10k/switch/fm10k_regs.h(define all the registers). > > > Add fm10k/switch/fm10k_switch.h(define switch Macros and APIs). > > > Add fm10k/switch/fm10k_i2c.h(define I2C interfaces). > > > Add fm10k/switch/fm10k_i2c.c(support I2C access). > > > Add fm10k/switch/fm10k_sbus.h(define SBUS interface). > > > Add fm10k/switch/fm10k_sbus.c(support SBUS access). > > > and modify fm10k/Makefile(add ENABLE_FM10K_MANAGEMENT support, > > > add fm10k_i2c.c and fm10k_sbus.c). > > > > Integrating NIC with the integrated or onboard switches over i2c or > > sbus is a common problem. > > Instead of polluting ethdev driver with i2c and sbus _bus_ code, Why > > not add new i2c bus > > and move this code to driver/bus/i2c/xxxx/ > > > > > > > > To avoid configuration for both kernel driver > > > and userspace SDK outside DPDK, we add switch > > > management in FM10K DPDK PMD driver. > > > To enable switch management, you need add > > > CONFIG_RTE_FM10K_MANAGEMENT=y in > > > config/common_linux when building. > > > > > > Signed-off-by: Xiaojun Liu <xiaojun....@silicom.co.il>