On Thu, 2016-03-24 at 17:15 -0700, Cong Wang wrote: > My understanding is that bh_lock_sock() prevents concurrent > access to sock struct. Since this is in softirq context, multiple > CPU's could call this function concurrently, the whole pmtu > update needs to be done atomically. > > UDP, on the other hand, doesn't do this logic, it just looks up > for dst and save it in sk_dst_cache.
Two ICMP messages processed on two different cpus can still get two different sockets pointing to the same dst. I do not see how dst pmtu update could be protected by a lock on each socket. It would require a dst lock , or some simple memory writes that do not require special synchro.