[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 4/6] xen/netback: Always pull through PKT_PROT_LEN bytes into the linear part of an skb.
On Wed, 2010-02-24 at 08:28 +0000, Jan Beulich wrote: > Could you point out what problem this addresses? It ensures that at least the TCP/IP headers will be pulled into the linear part of the SKB. At least skb_checksum_setup relies on this and I think it is a more generic assumption in at least some parts of the network stack as well. The next patch increases PKT_PROT_LEN to include the TCP options as well since we have observed cases where Windows guests with PV drivers can generate a frame with a split at the point. In the common case the first fragment should already contain PKT_PROT_LEN bytes so I don't think it will trigger often. Ian. > > Thanks, Jan > > >>> Ian Campbell <ian.campbell@xxxxxxxxxx> 23.02.10 17:47 >>> > Previously PKT_PROT_LEN would only have an effect on the first fragment. > > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> > --- > drivers/xen/netback/netback.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/drivers/xen/netback/netback.c b/drivers/xen/netback/netback.c > index 7e1dfd1..e668704 100644 > --- a/drivers/xen/netback/netback.c > +++ b/drivers/xen/netback/netback.c > @@ -1346,6 +1346,16 @@ static void net_tx_submit(void) > > netbk_fill_frags(skb); > > + /* > + * If the initial fragment was < PKT_PROT_LEN then > + * pull through some bytes from the other fragments to > + * increase the linear region to PKT_PROT_LEN bytes. > + */ > + if (skb_headlen(skb) < PKT_PROT_LEN && skb_is_nonlinear(skb)) { > + int target = min_t(int, skb->len, PKT_PROT_LEN); > + __pskb_pull_tail(skb, target - skb_headlen(skb)); > + } > + > skb->dev = netif->dev; > skb->protocol = eth_type_trans(skb, skb->dev); > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |