From patchwork Wed Jun 24 23:27:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexis Green X-Patchwork-Id: 6671121 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0AF679F39B for ; Wed, 24 Jun 2015 23:27:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2285C2052F for ; Wed, 24 Jun 2015 23:27:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DBAD201C8 for ; Wed, 24 Jun 2015 23:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751299AbbFXX1d (ORCPT ); Wed, 24 Jun 2015 19:27:33 -0400 Received: from mail-ie0-f181.google.com ([209.85.223.181]:33099 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbbFXX1b (ORCPT ); Wed, 24 Jun 2015 19:27:31 -0400 Received: by ieqy10 with SMTP id y10so43727874ieq.0 for ; Wed, 24 Jun 2015 16:27:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:content-type:content-transfer-encoding; bh=07b+XO5Mlk81HBTEbT1URW2986ElgBGYJALfxELFtxY=; b=R8HLgvRIOamwDyto6l1vOpDuEmsqNstNZjhOUZmPuYew7l1u+PGxbfXjedjTiUCrpI nYbaia2/nJVNDrnm4EJDEwr7aBOEmvyy6UNo2qZQM6KUH4n/kK5wEKibbHrJjVpcicx8 G1NRQabeN/o7QYucDMYmrO5bsm/qum88Un7QS8/GoIxQu8zM6j4mbBppIZpNKSlefUkg jwaUn3116Q9Z7uPKtLD2dy218qrOPeoKwxgvFxRMOTP1+1RAJ/8xJAuzuk1aDHSAuwEg Tw7tvajNstA0V6DKOpFyeHNFErO/+Z0nKC6KJFue2ywsH8nnHav/nHiB3nmxU8O7VwKV hFzw== X-Gm-Message-State: ALoCoQmLwiNBHhYWEL6ggeIRXNBZi7xG6jfiqXD/8XPd564xHp4LY+TJwfo4cVdNh4vEUKVeU/nd X-Received: by 10.107.11.169 with SMTP id 41mr2533392iol.8.1435188450920; Wed, 24 Jun 2015 16:27:30 -0700 (PDT) Received: from [10.4.0.237] ([67.137.71.162]) by mx.google.com with ESMTPSA id 140sm18355866ion.16.2015.06.24.16.27.30 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jun 2015 16:27:30 -0700 (PDT) Message-ID: <558B3CD9.8020106@cococorp.com> Date: Wed, 24 Jun 2015 16:27:21 -0700 From: Alexis Green Reply-To: agreen@cococorp.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Johannes Berg CC: linux-wireless@vger.kernel.org, Jesse Jones Subject: [PATCH] mac80211: mesh - always do every discovery retry Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jesse Jones Instead of stopping path discovery when a path is found continue attempting to find paths until we hit the dot11MeshHWMPmaxPREQretries limit. This is important because path messages are not reliable and it is relatively common to have a short bad path to the destination along with a longer but better path. With the original code rather often a path message along the long path would be lost so we would stick with the bad path. With this change we have a greater chance to get messages over the longer path allowing us to select the long path if it's better. The standard doesn't seem to address this issue. All it says (13.10.8.5) is that discovery should be limited to dot11MeshHWMPmaxPREQretries. Signed-off-by: Alexis Green --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index d80e0a4..3eec501 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -1179,16 +1179,20 @@ void mesh_path_timer(unsigned long data) return; spin_lock_bh(&mpath->state_lock); - if (mpath->flags & MESH_PATH_RESOLVED || - (!(mpath->flags & MESH_PATH_RESOLVING))) { - mpath->flags &= ~(MESH_PATH_RESOLVING | MESH_PATH_RESOLVED); - spin_unlock_bh(&mpath->state_lock); - } else if (mpath->discovery_retries < max_preq_retries(sdata)) { + + if (mpath->discovery_retries < max_preq_retries(sdata)) { ++mpath->discovery_retries; mpath->discovery_timeout *= 2; mpath->flags &= ~MESH_PATH_REQ_QUEUED; spin_unlock_bh(&mpath->state_lock); mesh_queue_preq(mpath, 0); + + } else if ( + mpath->flags & MESH_PATH_RESOLVED || + (!(mpath->flags & MESH_PATH_RESOLVING))) { + mpath->flags &= ~(MESH_PATH_RESOLVING | MESH_PATH_RESOLVED); + spin_unlock_bh(&mpath->state_lock); + } else { mpath->flags &= ~(MESH_PATH_RESOLVING | MESH_PATH_RESOLVED |