aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/dst.h10
-rw-r--r--include/net/neighbour.h14
2 files changed, 16 insertions, 8 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index baf597890064..77f52f7dc823 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -396,11 +396,15 @@ static inline void dst_confirm(struct dst_entry *dst)
396static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n, 396static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n,
397 struct sk_buff *skb) 397 struct sk_buff *skb)
398{ 398{
399 struct hh_cache *hh; 399 const struct hh_cache *hh;
400
401 if (dst->pending_confirm) {
402 unsigned long now = jiffies;
400 403
401 if (unlikely(dst->pending_confirm)) {
402 n->confirmed = jiffies;
403 dst->pending_confirm = 0; 404 dst->pending_confirm = 0;
405 /* avoid dirtying neighbour */
406 if (n->confirmed != now)
407 n->confirmed = now;
404 } 408 }
405 409
406 hh = &n->hh; 410 hh = &n->hh;
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 344d8988842a..0dab173e27da 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -334,18 +334,22 @@ static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb)
334} 334}
335#endif 335#endif
336 336
337static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) 337static inline int neigh_hh_output(const struct hh_cache *hh, struct sk_buff *skb)
338{ 338{
339 unsigned int seq; 339 unsigned int seq;
340 int hh_len; 340 int hh_len;
341 341
342 do { 342 do {
343 int hh_alen;
344
345 seq = read_seqbegin(&hh->hh_lock); 343 seq = read_seqbegin(&hh->hh_lock);
346 hh_len = hh->hh_len; 344 hh_len = hh->hh_len;
347 hh_alen = HH_DATA_ALIGN(hh_len); 345 if (likely(hh_len <= HH_DATA_MOD)) {
348 memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); 346 /* this is inlined by gcc */
347 memcpy(skb->data - HH_DATA_MOD, hh->hh_data, HH_DATA_MOD);
348 } else {
349 int hh_alen = HH_DATA_ALIGN(hh_len);
350
351 memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
352 }
349 } while (read_seqretry(&hh->hh_lock, seq)); 353 } while (read_seqretry(&hh->hh_lock, seq));
350 354
351 skb_push(skb, hh_len); 355 skb_push(skb, hh_len);