Re: [PATCH net-next 2/2] openvswitch: Use skb_zerocopy() to prepare skb for upcall
From: Jesse Gross <hidden>
Date: 2013-07-31 00:03:10
On Fri, Jul 26, 2013 at 3:15 AM, Thomas Graf [off-list ref] wrote:
On 07/25/13 at 06:39pm, Jesse Gross wrote:quoted
On Thu, Jul 25, 2013 at 5:43 AM, Thomas Graf [off-list ref] wrote:quoted
From: Thomas Graf <redacted>The question is, can we move checksum completion to user space? We only need to complete the checksum if the packet is sent to a controller at which point performance does not matter anymore. What do you think about a datapath flag indicating whether user space supports checksum completion and if so skipping the checksum completion in the fast path?
This seems like a premature optimization to me. In order for userspace to be able to either complete the checksums in cases where it needs it or allow the NIC to do it when packets are resent, we would have to also carry around offsets, etc. I would also consider the various hardware offloads to be internal kernel optimization which tend to be fairly platform specific and shouldn't really be exposed to userspace.
quoted
quoted
+ /* Fix alignment of .nlmsg_len, OVS user space enforces a strict + * total message size alignment. + */ + ((struct nlmsghdr *) user_skb->data)->nlmsg_len = NLA_ALIGN(user_skb->len);Do we still need to do this manually now that we are enforcing alignment of the payload above?We could use genlmsg_end() again if we also fix the skb-> pointer above. But we could drop the NLA_ALIGN() because user_skb->len is not always aligned.
Isn't the goal of the block above this to make user_skb->len aligned?