public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Marek Lindner <lindner_marek@yahoo.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.] [PATCH 09/12] batman-adv: Adding redundant bonding mode transmission
Date: Thu, 3 Mar 2011 14:48:37 +0100	[thread overview]
Message-ID: <201103031448.38450.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1299086321-25116-10-git-send-email-linus.luessing@ascom.ch>

On Wednesday 02 March 2011 18:18:38 Linus Lüssing wrote:
> diff --git a/main.h b/main.h
> index a0059dd..c6d4848 100644
> --- a/main.h
> +++ b/main.h
> @@ -97,6 +97,11 @@
>   *  Vis
>   */
>  
> +/* Bonding modes */
> +#define THROUGHPUT_BONDING     1
> +#define REDUNDANT_BONDING      2

Here you go into the right direction but ...


> @@ -347,6 +346,7 @@ void frag_packet_list(struct bat_priv *bat_priv,
> +       bonding_mode = atomic_read(&bat_priv->bonding) <<
> +                       atomic_read(&bat_priv->red_bonding);

here you resort to some magic. I believe that can be simplified (see my sysfs 
reply).


> +static int unicast_to_unicast_safe(struct sk_buff *skb,
> +                                  struct bat_priv *bat_priv)
> [..]
> +       unicast_packet_safe->header = unicast_packet.header;
> +       memcpy(unicast_packet_safe->dest, unicast_packet.dest, ETH_ALEN);
> +       unicast_packet_safe->header.packet_type = BAT_UNICAST_SAFE;

I don't think "unicast_packet_safe->header = unicast_packet.header;" does what 
you want it to do.


> +static void red_bonding_copy(struct sk_buff *skb, struct list_head
> [..]
> +       list_for_each_entry_rcu(neigh_node, bond_list, bonding_list) {
> +               entry = kmalloc(sizeof(struct packet_list_entry),
> GFP_ATOMIC);
> +               if (!entry) {
> +                       kfree_skb(skb);
> +                       return;
> +               }
> +               if (!num_entries)
> +                       entry->skb = skb;
> +               else {
> +                       entry->skb = skb_copy(skb, GFP_ATOMIC);
> +                       if (!entry->skb) {
> +                               kfree_skb(skb);
> +                               kfree(entry);
> +                               return;
> +                       }
> +               }

Yet another malloc() followed by an skb_copy() ? Seems to be unnecessary 
ballast. 

Cheers,
Marek


  reply	other threads:[~2011-03-03 13:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 17:18 [B.A.T.M.A.N.] Redundancy bonding mode patches, v2 Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 01/12] batman-adv: Remove unused hdr_size variable in route_unicast_packet() Linus Lüssing
2011-03-02 17:36   ` Marek Lindner
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 02/12] batman-adv: Add explicit batman header structure Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 03/12] batman-adv: Unify TTL handling Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 04/12] batman-adv: Make route_unicast_packet() packet_type independent Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 05/12] batman-adv: Use route_unicast_packet() for sending own unicast packets Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 06/12] batman-adv: Avoid redundant hash_find() call for " Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 07/12] batman-adv: Use packet lists for unicast packet sending Linus Lüssing
2011-03-03 13:17   ` Marek Lindner
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 08/12] batman-adv: Add sysfs option for enabling redundant bonding mode Linus Lüssing
2011-03-03  2:01   ` Marek Lindner
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 09/12] batman-adv: Adding redundant bonding mode transmission Linus Lüssing
2011-03-03 13:48   ` Marek Lindner [this message]
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 10/12] batman-adv: Adding unicast_safe packet reception Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 11/12] batman-adv: Generic sequence number checking for data packets Linus Lüssing
2011-03-02 17:18 ` [B.A.T.M.A.N.] [PATCH 12/12] batman-adv: Add sequence number and duplicate checks for unicasts_safe Linus Lüssing

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=201103031448.38450.lindner_marek@yahoo.de \
    --to=lindner_marek@yahoo.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