From patchwork Mon Jun 20 17:54:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16389 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 9AF1381D6E; Mon, 20 Jun 2016 19:55:08 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=SDkrdqXy; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 82A2F81D76 for ; Mon, 20 Jun 2016 19:54:58 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C047F90000000000002E16.dip0.t-ipconnect.de [IPv6:2003:c5:93c0:47f9::2e16]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id F30C5110119; Mon, 20 Jun 2016 19:54:57 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1466445298; bh=DXkNjcaT6rGoG+HRDnYJ/9pkmtzmF4RBA5+LDLRKfKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SDkrdqXyai8SwgCJQCFp/B9vIAsWDEf+BvmWP0gA6RMIXuSZvrETWrgIbScV5IQR2 fthouJ6Nz+9j03skqa6+VtmnVr8/50AUPsVg5QV+AuemSowv6zSf0saZnbOKcJ11zO DRZOMrI2b/gWPXK5lHUe3MXQBkNGvzlQi9BQxitM= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 20 Jun 2016 19:54:49 +0200 Message-Id: <1466445289-17840-2-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1466445210-17616-1-git-send-email-sven@narfation.org> References: <1466445210-17616-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH next v2 4/4] batman-adv: Remove unnecessary call to dev_xmit_complete X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The dev_xmit_complete function is only necessary to check the return value for *_hard_xmit functions. But batman-adv only uses dev_queue_xmit to send data via the interface queue. From the kerneldoc of __dev_queue_xmit: Regardless of the return value, the skb is consumed, so it is currently difficult to retry a send to this method. (You can bump the ref count before sending to hold a reference for retry if you are careful.) Fixes: e3b8acbff9c8 ("batman-adv: return netdev status in the TX path") Signed-off-by: Sven Eckelmann --- v2: - added this patch net/batman-adv/routing.c | 10 ++++------ net/batman-adv/send.c | 2 +- net/batman-adv/tvlv.c | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 2bc9645..af8e119 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -274,8 +274,7 @@ static int batadv_recv_my_icmp_packet(struct batadv_priv *bat_priv, if (res == -1) goto out; - if (dev_xmit_complete(res)) - ret = NET_RX_SUCCESS; + ret = NET_RX_SUCCESS; break; case BATADV_TP: @@ -335,7 +334,7 @@ static int batadv_recv_icmp_ttl_exceeded(struct batadv_priv *bat_priv, icmp_packet->ttl = BATADV_TTL; res = batadv_send_skb_to_orig(skb, orig_node, NULL); - if (res != -1 && dev_xmit_complete(res)) + if (res != -1) ret = NET_RX_SUCCESS; out: @@ -423,7 +422,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, /* route it */ res = batadv_send_skb_to_orig(skb, orig_node, recv_if); - if (res != -1 && dev_xmit_complete(res)) + if (res != -1) ret = NET_RX_SUCCESS; out: @@ -671,8 +670,7 @@ static int batadv_route_unicast_packet(struct sk_buff *skb, len + ETH_HLEN); } - if (dev_xmit_complete(res)) - ret = NET_RX_SUCCESS; + ret = NET_RX_SUCCESS; out: if (orig_node) diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 80208f1..3a10d87 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@ -366,7 +366,7 @@ int batadv_send_skb_unicast(struct batadv_priv *bat_priv, unicast_packet->ttvn = unicast_packet->ttvn - 1; res = batadv_send_skb_to_orig(skb, orig_node, NULL); - if (res != -1 && dev_xmit_complete(res)) + if (res != -1) ret = NET_XMIT_SUCCESS; out: diff --git a/net/batman-adv/tvlv.c b/net/batman-adv/tvlv.c index 8c59420..3d1cf0f 100644 --- a/net/batman-adv/tvlv.c +++ b/net/batman-adv/tvlv.c @@ -625,7 +625,7 @@ void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src, memcpy(tvlv_buff, tvlv_value, tvlv_value_len); res = batadv_send_skb_to_orig(skb, orig_node, NULL); - if (!(res != -1 && dev_xmit_complete(res))) + if (res == -1) kfree_skb(skb); out: batadv_orig_node_put(orig_node);