|
From: David W. <dw...@in...> - 2015-09-15 19:11:00
|
On Wed, 2013-09-04 at 21:41 +0100, David Woodhouse wrote:
> On Wed, 2013-09-04 at 14:30 -0400, David Miller wrote:
> > skb_realloc_headroom() should do everything you need.
>
> Great, thanks! Something like this then... ?
>
> diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
> index 32784d1..4492c0f 100644
> --- a/drivers/atm/solos-pci.c
> +++ b/drivers/atm/solos-pci.c
> @@ -1145,19 +1145,19 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
> > > > return 0;
> > > }
>
> -> > if (!skb_clone_writable(skb, sizeof(*header))) {
> -> > > int expand_by = 0;
> -> > > int ret;
> -
> -> > > if (skb_headroom(skb) < sizeof(*header))
> -> > > > expand_by = sizeof(*header) - skb_headroom(skb);
> -
> -> > > ret = pskb_expand_head(skb, expand_by, 0, GFP_ATOMIC);
> -> > > if (ret) {
> -> > > > dev_warn(&card->dev->dev, "pskb_expand_head failed.\n");
> -> > > > solos_pop(vcc, skb);
> -> > > > return ret;
> -> > > }
> +> > if (skb_headroom(skb) < sizeof(*header)) {
> +> > > struct sk_buff *nskb;
> +
> +> > > nskb = skb_realloc_headroom(skb, sizeof(*header));
> +> > > if (!nskb) {
> +> > > > solos_pop(vcc, skb);
> +> > > > return -ENOMEM;
> +> > > }
> +> > > if (skb->truesize != nskb->truesize)
> +> > > > atm_force_charge(vcc, nskb->truesize - skb->truesize);
> +
> +> > > dev_kfree_skb_any(skb);
> +> > > skb = nskb;
> > > }
>
> > > header = (void *)skb_push(skb, sizeof(*header));
Simon, did you ever test this?
Can you still (tell me how to) reproduce the original problem? I think
that sending on br2684 was necessary but not sufficient...?
--
David Woodhouse Open Source Technology Centre
Dav...@in... Intel Corporation
|