net: stmmac: selftests: Make it work in Synopsys AXS101 boards
Synopsys AXS101 boards do not support unaligned memory loads or stores.
Change the selftests mechanism to explicity:
- Not add extra alignment in TX SKB
- Use the unaligned version of ether_addr_equal()
Fixes: 091810dbde
("net: stmmac: Introduce selftests support")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ddf4203905
commit
0b9f932edc
|
@ -80,7 +80,7 @@ static struct sk_buff *stmmac_test_get_udp_skb(struct stmmac_priv *priv,
|
||||||
if (attr->max_size && (attr->max_size > size))
|
if (attr->max_size && (attr->max_size > size))
|
||||||
size = attr->max_size;
|
size = attr->max_size;
|
||||||
|
|
||||||
skb = netdev_alloc_skb_ip_align(priv->dev, size);
|
skb = netdev_alloc_skb(priv->dev, size);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -244,6 +244,8 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb,
|
||||||
struct net_device *orig_ndev)
|
struct net_device *orig_ndev)
|
||||||
{
|
{
|
||||||
struct stmmac_test_priv *tpriv = pt->af_packet_priv;
|
struct stmmac_test_priv *tpriv = pt->af_packet_priv;
|
||||||
|
unsigned char *src = tpriv->packet->src;
|
||||||
|
unsigned char *dst = tpriv->packet->dst;
|
||||||
struct stmmachdr *shdr;
|
struct stmmachdr *shdr;
|
||||||
struct ethhdr *ehdr;
|
struct ethhdr *ehdr;
|
||||||
struct udphdr *uhdr;
|
struct udphdr *uhdr;
|
||||||
|
@ -260,15 +262,15 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
||||||
if (tpriv->packet->dst) {
|
if (dst) {
|
||||||
if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
|
if (!ether_addr_equal_unaligned(ehdr->h_dest, dst))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (tpriv->packet->sarc) {
|
if (tpriv->packet->sarc) {
|
||||||
if (!ether_addr_equal(ehdr->h_source, ehdr->h_dest))
|
if (!ether_addr_equal_unaligned(ehdr->h_source, ehdr->h_dest))
|
||||||
goto out;
|
goto out;
|
||||||
} else if (tpriv->packet->src) {
|
} else if (src) {
|
||||||
if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src))
|
if (!ether_addr_equal_unaligned(ehdr->h_source, src))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -714,7 +716,7 @@ static int stmmac_test_flowctrl_validate(struct sk_buff *skb,
|
||||||
struct ethhdr *ehdr;
|
struct ethhdr *ehdr;
|
||||||
|
|
||||||
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
||||||
if (!ether_addr_equal(ehdr->h_source, orig_ndev->dev_addr))
|
if (!ether_addr_equal_unaligned(ehdr->h_source, orig_ndev->dev_addr))
|
||||||
goto out;
|
goto out;
|
||||||
if (ehdr->h_proto != htons(ETH_P_PAUSE))
|
if (ehdr->h_proto != htons(ETH_P_PAUSE))
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -856,7 +858,7 @@ static int stmmac_test_vlan_validate(struct sk_buff *skb,
|
||||||
}
|
}
|
||||||
|
|
||||||
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
||||||
if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
|
if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ihdr = ip_hdr(skb);
|
ihdr = ip_hdr(skb);
|
||||||
|
@ -1586,7 +1588,7 @@ static int stmmac_test_arp_validate(struct sk_buff *skb,
|
||||||
struct arphdr *ahdr;
|
struct arphdr *ahdr;
|
||||||
|
|
||||||
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
ehdr = (struct ethhdr *)skb_mac_header(skb);
|
||||||
if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->src))
|
if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ahdr = arp_hdr(skb);
|
ahdr = arp_hdr(skb);
|
||||||
|
|
Loading…
Reference in New Issue