All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@meshcoding.com>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Simon Wunderlich <simon@open-mesh.com>
Subject: Re: [B.A.T.M.A.N.] [RFCv2 4/6] batman-adv: add WiFi penalty
Date: Wed, 25 Sep 2013 22:18:32 +0200	[thread overview]
Message-ID: <20130925201832.GW3911@neomailbox.net> (raw)
In-Reply-To: <1378312060-30922-5-git-send-email-siwu@hrz.tu-chemnitz.de>

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

On Wed, Sep 04, 2013 at 06:27:38PM +0200, Simon Wunderlich wrote:
> diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
> index d32b2f2..efddadf 100644
> --- a/bat_iv_ogm.c
> +++ b/bat_iv_ogm.c
> @@ -1085,6 +1085,7 @@ static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node,
>  	uint8_t orig_eq_count, neigh_rq_count, neigh_rq_inv, tq_own;
>  	unsigned int neigh_rq_inv_cube, neigh_rq_max_cube;
>  	int tq_asym_penalty, inv_asym_penalty, if_num, ret = 0;
> +	int tq_iface_penalty;
>  	unsigned int combined_tq;

please, add the new variable at the end (line length sorting).

>  
>  	/* find corresponding one hop neighbor */
> @@ -1169,15 +1170,33 @@ static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node,
>  	inv_asym_penalty /= neigh_rq_max_cube;
>  	tq_asym_penalty = BATADV_TQ_MAX_VALUE - inv_asym_penalty;
>  
> -	combined_tq = batadv_ogm_packet->tq * tq_own * tq_asym_penalty;
> -	combined_tq /= BATADV_TQ_MAX_VALUE * BATADV_TQ_MAX_VALUE;
> +	/* penalize if the OGM is forwarded on the same interface. WiFi
> +	 * interfaces and other half duplex devices suffer from throughput
> +	 * drops as they can't send and receive at the same time.
> +	 */
> +	tq_iface_penalty = BATADV_TQ_MAX_VALUE;
> +	if (if_outgoing && (if_incoming == if_outgoing) &&
> +	    batadv_is_wifi_netdev(if_outgoing->net_dev))
> +		tq_iface_penalty = batadv_hop_penalty(BATADV_TQ_MAX_VALUE,
> +						      bat_priv);
> +
> +	combined_tq = batadv_ogm_packet->tq *
> +		      tq_own *
> +		      tq_asym_penalty *
> +		      tq_iface_penalty;
> +	combined_tq /= BATADV_TQ_MAX_VALUE *
> +		       BATADV_TQ_MAX_VALUE *
> +		       BATADV_TQ_MAX_VALUE;

Mh..I am not sure about the style of these assignments...but we can live with
those for now.

>  	batadv_ogm_packet->tq = combined_tq;
>  
>  	batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
> -		   "bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i\n",
> +		   "bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, iface_penalty: %3i, total tq: %3i, if_incoming = %s, if_outgoing = %s\n",
>  		   orig_node->orig, orig_neigh_node->orig, total_count,
>  		   neigh_rq_count, tq_own,
> -		   tq_asym_penalty, batadv_ogm_packet->tq);
> +		   tq_asym_penalty, tq_iface_penalty,
> +		   batadv_ogm_packet->tq,

this one can go on the line above..

> +		   if_incoming ? if_incoming->net_dev->name : "NULL",
> +		   if_outgoing ? if_outgoing->net_dev->name : "NULL");
>  
>  	/* if link has the minimum required transmission quality
>  	 * consider it bidirectional

Cheers,


-- 
Antonio Quartulli

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

  reply	other threads:[~2013-09-25 20:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 16:27 [B.A.T.M.A.N.] [RFCv2 0/6] add network wide multi interface optimization Simon Wunderlich
2013-09-04 16:27 ` [B.A.T.M.A.N.] [RFCv2 1/6] batman-adv: remove bonding and interface alternating Simon Wunderlich
2013-09-04 16:27 ` [B.A.T.M.A.N.] [RFCv2 2/6] batman-adv: split tq information in neigh_node struct Simon Wunderlich
2013-09-13 13:23   ` Antonio Quartulli
2013-10-03 20:39     ` Simon Wunderlich
2013-09-04 16:27 ` [B.A.T.M.A.N.] [RFCv2 3/6] batman-adv: split out router from orig_node Simon Wunderlich
2013-09-22 20:47   ` Antonio Quartulli
2013-09-04 16:27 ` [B.A.T.M.A.N.] [RFCv2 4/6] batman-adv: add WiFi penalty Simon Wunderlich
2013-09-25 20:18   ` Antonio Quartulli [this message]
2013-09-04 16:27 ` [B.A.T.M.A.N.] [RFCv2 5/6] batman-adv: consider outgoing interface in OGM sending Simon Wunderlich
2013-10-01  9:00   ` Antonio Quartulli
2013-10-03 22:11     ` Simon Wunderlich
2013-09-04 16:27 ` [B.A.T.M.A.N.] [RFCv2 6/6] batman-adv: add bonding again Simon Wunderlich
2013-10-01  9:24   ` Antonio Quartulli
2013-10-03 22:53     ` Simon Wunderlich

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=20130925201832.GW3911@neomailbox.net \
    --to=antonio@meshcoding.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=simon@open-mesh.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.