On Thu, 19 Oct 2017 19:40:53 +0800, Yang, Yi wrote: > Actually mdtype can't be set, only push_nsh can set mdtype, so set_nsh > won't have mdtype flow key, we can't get it from flow_key in set_nsh, > only ttl, flags and path_hdr can be set in set_nsh as you can see in code. > I understand your concern is calling skb_ensure_writable twice, so > changing the first one to pskb_may_pull is more appropriate for set_nsh.
Isn't set_nsh called only after the packet was already dissected (i.e. parse_nsh called)? The dissected fields should be available in flow_key. Jiri