public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [RFC] batman-adv: dirty hack to recompute mac_len in the rx path
Date: Tue, 2 Oct 2012 11:37:13 +0200	[thread overview]
Message-ID: <20121002093712.GA18558@pandem0nium> (raw)
In-Reply-To: <201210021316.40830.lindner_marek@yahoo.de>

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

Hello Marek,

On Tue, Oct 02, 2012 at 01:16:40PM +0800, Marek Lindner wrote:
> On Tuesday, October 02, 2012 04:53:28 Simon Wunderlich wrote:
> > +#define skb_share_check(skb, b) \
> > +       skb_share_check(skb, b); \
> > +       if (skb) \
> > +               skb_reset_mac_len(skb)
> > +
> > +#endif /* < KERNEL_VERSION(3, 8, 0) */
> 
> Has this patch been tested ? Our skb_share_check() call is this:
> skb = skb_share_check(skb, GFP_ATOMIC);
> 
> Now we replace this function call with 2 function calls and 2 return values ?

I have not tested in a real machine, but only the first function will
return the skb. The second part is a separate statement. I've checked
it with gcc -E (preprocessor only), these lines in main.c will expand to:

 hard_iface = ({ const typeof( ((struct batadv_hard_iface *)0)->batman_adv_ptype ) *__mptr = (ptype); (struct batadv_hard_iface *)( (char *)__mptr - __builtin_offsetof(struct batadv_hard_iface,batman_adv_ptype) );})
                       ;
 skb = skb_share_check(skb, ((( gfp_t)0x20u))); if (skb) skb_reset_mac_len(skb);


 if (!skb)
  goto err_out;

As you can see, the skb = skb_share_check() statement stays at it is, and
the reset_mac_len() is done afterwards.

Cheers,
	Simon


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-10-02  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-15 12:34 [B.A.T.M.A.N.] [PATCH] batman-adv: recompute mac_len at the beginning of the rx path Antonio Quartulli
2012-09-29 11:27 ` Antonio Quartulli
2012-10-01 20:56   ` Simon Wunderlich
2012-10-01 20:53 ` [B.A.T.M.A.N.] [RFC] batman-adv: dirty hack to recompute mac_len in " Simon Wunderlich
2012-10-02  5:16   ` Marek Lindner
2012-10-02  9:37     ` Simon Wunderlich [this message]
2012-10-06 16:45   ` Sven Eckelmann
2012-10-14 12:46     ` [B.A.T.M.A.N.] [PATCH] " Simon Wunderlich
2012-10-14 18:53       ` Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121002093712.GA18558@pandem0nium \
    --to=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox