# Need Advice on P4 Tofino Setup – Platform Detection, Custom Controller, and IDS Project

**URL:** <https://forum.p4.org/t/need-advice-on-p4-tofino-setup-platform-detection-custom-controller-and-ids-project/1315>\
**Category:** P4 Dev\
**Created:** [May 20, 2025, 2:49pm UTC](https://forum.p4.org/t/need-advice-on-p4-tofino-setup-platform-detection-custom-controller-and-ids-project/1315 "2025-05-20T14:49:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AL-OTU](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@AL-OTU](https://forum.p4.org/u/AL-OTU)\
**Post date:** [May 20, 2025, 2:49pm UTC](https://forum.p4.org/t/need-advice-on-p4-tofino-setup-platform-detection-custom-controller-and-ids-project/1315/1 "2025-05-20T14:49:26Z")

</div>

Hey everyone,

I’m working on a project using a Tofino-based switch (UfiSpace S9180-32X) and the Intel P4 SDE (version 9.13.1). I’m building a simple IDS (Intrusion Detection System) as part of a summer Project, and so far, I’ve made decent progress but I could use some advice.

### Setup Details:

- **Switch:** UfiSpace S9180-32X
- **SDE:** bf-sde-9.13.1 (with full pkgsrc + BSP)
- **Kernel:** Ubuntu 20.04 running `5.4.0-216-generic`
- **Controller:** Custom Python-based controller using `p4runtime` and gRPC
- **Pipeline Format:** `basic.p4` compiled to `.p4info.bin` and `tofino.bin`
- **Development environment:** WSL2 (Ubuntu) on the host, controller runs locally

### What I’ve Done So Far:

- Compiled and pushed P4 pipeline using `p4c-barefoot`
- Wrote and tested a custom Python controller (based on the P4Runtime API)
- Recompiled `bf_kdrv.ko` manually for my current kernel (since the default was built for 5.4.0-192)
- Got `/dev/bf0` created and `bf_switchd` starting
- `bfshell` runs and gRPC server starts on `0.0.0.0:50052`
- Fixed SSH + networking between the PC and the switch
- Installed the BSP and loaded `eeprom_mb` and `optoe` modules
- Ran the provided `i2c_utils_std.sh i2c_init` — I2C appears active
- Tried binding `24c64` manually to devices on `i2c-50`, but still no `/sys/bus/i2c/.../eeprom`

### What’s Blocking Me:

Even though the switch starts up and the pipeline compiles fine, `bf_switchd` exits unless I skip platform detection. The `i2c_cpu_eeprom_get` script shows “EEPROM not detected”, and I don’t see any valid eeprom devices under `/sys/bus/i2c/devices/`.

I know I can just disable the platform check with `platform-check-disable=1`, and I plan to — since the IDS doesn’t really need fan/LED/BMC access — but I’m still curious:

- Has anyone successfully enabled platform detection on this board?
- Is there a more reliable way to scan/detect the EEPROM (e.g. alternate bus/channel)?
- Am I overthinking this and should just move on with platform check disabled?

Appreciate any advice or just hearing from others who’ve worked on similar setups!

Thanks in advance

---

<div class="post-metadata">

**Author:** ![p4prof](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/p4prof/32/251_2.png) [@p4prof](https://forum.p4.org/u/p4prof)\
**Post date:** [May 21, 2025, 5:13am UTC](https://forum.p4.org/t/need-advice-on-p4-tofino-setup-platform-detection-custom-controller-and-ids-project/1315/2 "2025-05-21T05:13:56Z")

</div>

Hello @AL-OTU – welcome to the forum!

Unfortunately, I do not have experience working with that platform. My only recommendation would be to reach out directly to the vendor or to their representative, e.g. STORDIS.

Happy hacking,  
Vladimir
