Thanks! Really helps to know I'm not alone
I'll set up a more family-friendly test bed than in the TV loop and experiment with your patch
EDIT: Done that now, and it looks good. I now see the IGMP packets coming out of the switch. I turned on the debug site you modified in rtl838x_decode_tag() and see for example:
[ 369.120000] rtl838x_decode_tag: Reason: 15 (cpu_tag 0000 04c8 0580 100f 120f 0000 0000 0000 0000 0000)
[ 369.310000] rtl838x_decode_tag: Reason: 15 (cpu_tag 0000 04c8 0580 10cb 120f 0000 0000 0000 0000 0000)
[ 369.390000] rtl838x_decode_tag: Reason: 5 (cpu_tag 0000 0408 0580 10cb 1205 0000 0000 0000 0000 0000)
[ 369.400000] rtl838x_decode_tag: Reason: 5 (cpu_tag 0000 0408 0580 10cb 1205 0000 0000 0000 0000 0000)
[ 369.480000] rtl838x_decode_tag: Reason: 15 (cpu_tag 0000 04c8 0580 1067 120f 0000 0000 0000 0000 0000)
[ 369.530000] rtl838x_decode_tag: Reason: 5 (cpu_tag 0000 0408 0580 10cb 1205 0000 0000 0000 0000 0000)
[ 369.550000] rtl838x_decode_tag: Reason: 5 (cpu_tag 0000 0408 0580 10cb 1205 0000 0000 0000 0000 0000)
[ 369.670000] rtl838x_decode_tag: Reason: 5 (cpu_tag 0000 0408 0580 10cb 1205 0000 0000 0000 0000 0000)
[ 369.680000] rtl838x_decode_tag: Reason: 5 (cpu_tag 0000 0408 0580 10cb 1205 0000 0000 0000 0000 0000)
[ 369.950000] rtl838x_decode_tag: Reason: 15 (cpu_tag 0000 0408 0580 100f 120f 0000 0000 0000 0000 0000)
[ 369.970000] rtl838x_decode_tag: Reason: 15 (cpu_tag 0000 0448 0580 1007 120f 0000 0000 0000 0000 0000)
[ 370.310000] rtl838x_decode_tag: Reason: 15 (cpu_tag 0000 0408 0580 100f 120f 0000 0000 0000 0000 0000)
[ 370.740000] rtl838x_decode_tag: Reason: 6 (cpu_tag 0000 04e8 0580 1067 1206 0000 0000 0000 0000 0000)
[ 370.920000] rtl838x_decode_tag: Reason: 5 (cpu_tag 0000 0408 0580 10cb 1205 0000 0000 0000 0000 0000)
where the "Reason: 6" matches an IGMP packet as expected from the patch.
IIUC your patch fixes two separate issues: off-by-one in the reason/queue decoding of the tag and disabling L2 offload of "NIC_RX_REASON_RMA" packets.
But it looks like only the first part is actually required for IGMP, is that correct? They are tagged as "NIC_RX_REASON_SPECIAL_TRAP", and should have been caught by the old code as well if the reason decode had been correct.
EDIT2: looking a bit more on that off-by-one thing. From sdk/system/include/drv/nic/r8380.h I see that the RX tag is supposed to look like this:
struct {
uint8 CPUTAGIF;
uint8 QID:3;
uint8 SPN:5;
uint16 MIR_HIT:4;
uint16 ACL_HIT:1;
uint16 ACL_IDX:11;
uint16 :2;
uint16 OTAGIF:1;
uint16 ITAGIF:1;
uint16 RVID:12;
uint8 :1;
uint8 MAC_CST:1;
uint8 ATK_HIT:1;
uint8 ATK_TYPE:5;
uint8 NEW_SA:1;
uint8 L2_PMV:1;
uint8 :2;
uint8 REASON:4;
uint8 RSV0;
uint8 RSV1;
} __attribute__ ((aligned(1), packed)) rx;
which does put the REASON in the 3rd 16bit word like the present code suggests. But the tag examples above shows that our cpu_tag array is already off-by-one compared to this struct. I believe the CPUTAGIF is supposed to by constant 4, which is identifid as "PROTO ID" on TX by the SDK. This puts the start of the tag struct at h->cpu_tag[1] and not h->cpu_tag[0].
We can also confirm this by looking at the RVID field. The IGMP packet is on VLAN 103 (0x67). The "my mac" (reason 5) packets are on VLAN 203 (0xcb). This field is obiously h->cpu_tag[3].
So the off-by-one is definitely there, and is the primary reason the IGMP packets fail.
But the original reason macthing is also off:
if (t->reason != 4) // NIC_RX_REASON_SPECIAL_TRAP
t->l2_offloaded = 1;
Which offloads everything but NIC_RX_REASON_INNER_OUTTER_CFI. This does not make any sense at all. I'm guessing someone happened to test IGMP on on a VLAN with VID & 0xf == 4, and this made it work...
The 838x reason table clearly shows that NIC_RX_REASON_SPECIAL_TRAP is 6, like your patch fixes it to:
static uint32 reasonTbl[][2] =
{
{0, 0, },
{NIC_RX_REASON_RLDP_RLPP, 0, },
{NIC_RX_REASON_RMA, 0, },
{NIC_RX_REASON_IGR_VLAN_FILTER, 0, },
{NIC_RX_REASON_INNER_OUTTER_CFI, 0, },
{NIC_RX_REASON_MY_MAC, 0, },
{NIC_RX_REASON_SPECIAL_TRAP, 0, },
{NIC_RX_REASON_SPECIAL_COPY, 0, },
{NIC_RX_REASON_ROUTING_EXCEPTION, 0, },
{NIC_RX_REASON_UNKWN_UCST_MCST, 0, },
{NIC_RX_REASON_MAC_CONSTRAINT_SYS, NIC_RX_REASON_MAC_CONSTRAINT, },
{NIC_RX_REASON_MAC_CONSTRAINT_VLAN, NIC_RX_REASON_MAC_CONSTRAINT, },
{NIC_RX_REASON_MAC_CONSTRAINT_PORT, NIC_RX_REASON_MAC_CONSTRAINT, },
{NIC_RX_REASON_CRC_ERROR, 0, },
{NIC_RX_REASON_IP6_UNKWN_EXT_HDR, 0, },
{NIC_RX_REASON_NORMAL_FWD, 0, },
};
EDIT3: I'lll stop up, I promise. But I just realised how this affects us with non-IGMP. It means that we clear l2_offloaded on every single packet received on VLANs 4, 20, 36, 52, etc... How does that affect performance if you use one of those VLANs?