[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170120200323.GA30186@oracle.com>
Date: Fri, 20 Jan 2017 15:03:23 -0500
From: Sowmini Varadhan <sowmini.varadhan@...cle.com>
To: David Miller <davem@...emloft.net>
Cc: Paul.Durrant@...rix.com, konrad.wilk@...cle.com,
wei.liu2@...rix.com, netdev@...r.kernel.org,
xen-devel@...ts.xenproject.org
Subject: Re: [Xen-devel] xennet_start_xmit assumptions
On (01/20/17 14:30), David Miller wrote:
>
> CAP_SYS_RAWIO or not, the contract we have with the device is that
> there will be at least enough bytes to cover a link layer header.
I see. If that's the case (for all the kernel-driver interfaces),
then the xen_netfront driver is probably not required to check for
variants of sk_buffs like pure-non-linear etc.
> This probably requires a little bit of an adjustment to the calling
> convention. Perhaps:
>
> int dev_validate_header(const struct net_device *dev,
> char *ll_header, int len);
>
> So then you can go:
>
> new_len = dev_validate_header(dev, skb->data, len);
> if (new_len < 0)
> goto out_cleanup_err;
> if (new_len > len)
> __skb_put(skb, new_len - len);
>
> Or something like that.
ok let me work with that and get back (hopefully with an
RFC patch).
--Sowmini
Powered by blists - more mailing lists