v2: update commit log of the patch to include comments on 32 bit
alignment; include second patch moving the structs out of uapi.
Rasmus Villemoes (2):
net: mrp: fix definitions of MRP test packets
net: mrp: move struct definitions out of uapi
include/uapi/linux/mrp_bridge.h | 86 ---------------------------------
net/bridge/br_private_mrp.h | 29 +++++++++++
2 files changed, 29 insertions(+), 86 deletions(-)
--
2.23.0
Wireshark says that the MRP test packets cannot be decoded - and the
reason for that is that there's a two-byte hole filled with garbage
between the "transitions" and "timestamp" members.
So Wireshark decodes the two garbage bytes and the top two bytes of
the timestamp written by the kernel as the timestamp value (which thus
fluctuates wildly), and interprets the lower two bytes of the
timestamp as a new (type, length) pair, which is of course broken.
Even though this makes the timestamp field in the struct unaligned, it
actually makes it end up on a 32 bit boundary in the frame as mandated
by the standard, since it is preceded by a two byte TLV header.
The struct definitions live under include/uapi/, but they are not
really part of any kernel<->userspace API/ABI, so fixing the
definitions by adding the packed attribute should not cause any
compatibility issues.
Signed-off-by: Rasmus Villemoes <redacted>
---
include/uapi/linux/mrp_bridge.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
None of these are actually used in the kernel/userspace interface -
there's a userspace component of implementing MRP, and userspace will
need to construct certain frames to put on the wire, but there's no
reason the kernel should provide the relevant definitions in a UAPI
header.
In fact, most of these structs are unused in the kernel, so only keep
the few that are actually referenced in the kernel code, and move them
to the br_private_mrp.h header.
Signed-off-by: Rasmus Villemoes <redacted>
---
include/uapi/linux/mrp_bridge.h | 86 ---------------------------------
net/bridge/br_private_mrp.h | 29 +++++++++++
2 files changed, 29 insertions(+), 86 deletions(-)
The 01/21/2021 21:40, Rasmus Villemoes wrote:
It seems that is missing a Fixes tag, other than that it looks fine.
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
quoted hunk
Wireshark says that the MRP test packets cannot be decoded - and the
reason for that is that there's a two-byte hole filled with garbage
between the "transitions" and "timestamp" members.
So Wireshark decodes the two garbage bytes and the top two bytes of
the timestamp written by the kernel as the timestamp value (which thus
fluctuates wildly), and interprets the lower two bytes of the
timestamp as a new (type, length) pair, which is of course broken.
Even though this makes the timestamp field in the struct unaligned, it
actually makes it end up on a 32 bit boundary in the frame as mandated
by the standard, since it is preceded by a two byte TLV header.
The struct definitions live under include/uapi/, but they are not
really part of any kernel<->userspace API/ABI, so fixing the
definitions by adding the packed attribute should not cause any
compatibility issues.
Signed-off-by: Rasmus Villemoes <redacted>
---
include/uapi/linux/mrp_bridge.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The 01/21/2021 21:40, Rasmus Villemoes wrote:
It seems that is missing a Fixes tag, other than that it looks fine.
That would be these two I guess:
Fixes: 2801758391ba ("bridge: uapi: mrp: Extend MRP attributes for MRP
interconnect")
Fixes: 4714d13791f8 ("bridge: uapi: mrp: Add mrp attributes.")