]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: selftests: Mark as fail when received VLAN ID != expected
authorJose Abreu <Jose.Abreu@synopsys.com>
Tue, 14 Jan 2020 16:09:22 +0000 (17:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2020 22:11:18 +0000 (23:11 +0100)
When the VLAN ID does not match the expected one it means filter failed
in HW. Fix it.

Fixes: d0b419b76131 ("net: stmmac: selftests: Add selftest for VLAN TX Offload")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c

index 6516d65e84b8ba6bd0a91dc30769e290e9392f8b..7edee3c87ac9e1bb7945a27e46fd8b1e281dd5c3 100644 (file)
@@ -853,8 +853,12 @@ static int stmmac_test_vlan_validate(struct sk_buff *skb,
        if (tpriv->vlan_id) {
                if (skb->vlan_proto != htons(proto))
                        goto out;
-               if (skb->vlan_tci != tpriv->vlan_id)
+               if (skb->vlan_tci != tpriv->vlan_id) {
+                       /* Means filter did not work. */
+                       tpriv->ok = false;
+                       complete(&tpriv->comp);
                        goto out;
+               }
        }
 
        ehdr = (struct ethhdr *)skb_mac_header(skb);