Re: [PATCH net-next v9 1/3] net: sfp: initialize i2c_block_size at adapter configure time

From: Jonas Jelonek

Date: Fri Jun 12 2026 - 10:14:26 EST


Hi Jakub,

sorry for the noise.

On 04.06.26 03:06, Jakub Kicinski wrote:
> In the meantime - AI seems to also be saying something the cap being
> potentially off by 1 in patch 2? We add 1 to the len? Maybe I'm
> misunderstanding..
>
> https://sashiko.dev/#/patchset/20260528205242.971410-2-jelonek.jonas@xxxxxxxxx

I had another look at that. The concern is theoretically valid, the I2C
write path prepends the length byte to the data buffer. This could exceed
the limit and would be rejected by I2C core/driver. But this is not a result
of my patch, it can also happen without. My patch probably just brought
that more into awareness.

However, this isn't triggerable right now IMO, thus has no practical
impact. In v8 I had a look at in-tree drivers with a potentially problematic
constellation of max_read_len and max_write_len [1]. And looking at the
SFP code, the biggest write being issued might end up with 3+1 bytes.
This doesn't reach any existing driver limit.

Given that, I'll send a v10.

Best,
Jonas

[1] https://lore.kernel.org/netdev/4a1b13f4-9c68-4f4c-a676-fd61e2aeeab0@xxxxxxxxx/