]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/ethernet/eth.c
net: add annotations on hh->hh_len lockless accesses
[mirror_ubuntu-bionic-kernel.git] / net / ethernet / eth.c
index eaeba9b99a737c424ab9e94279f87c4045ec03dc..7e0e5f2706ba26367cbb1ce5779f643dd876ad8b 100644 (file)
@@ -239,7 +239,12 @@ int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16
        eth->h_proto = type;
        memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
        memcpy(eth->h_dest, neigh->ha, ETH_ALEN);
-       hh->hh_len = ETH_HLEN;
+
+       /* Pairs with READ_ONCE() in neigh_resolve_output(),
+        * neigh_hh_output() and neigh_update_hhs().
+        */
+       smp_store_release(&hh->hh_len, ETH_HLEN);
+
        return 0;
 }
 EXPORT_SYMBOL(eth_header_cache);