From patchwork Wed Dec 19 17:17:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 207459 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8E51A2C0097 for ; Thu, 20 Dec 2012 04:17:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755688Ab2LSRRa (ORCPT ); Wed, 19 Dec 2012 12:17:30 -0500 Received: from na3sys010aog101.obsmtp.com ([74.125.245.70]:56090 "HELO na3sys010aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755535Ab2LSRR0 (ORCPT ); Wed, 19 Dec 2012 12:17:26 -0500 Received: from mail-da0-f72.google.com ([209.85.210.72]) (using TLSv1) by na3sys010aob101.postini.com ([74.125.244.12]) with SMTP ID DSNKUNH2pir6NtYlkKMhRQ+bFnWpf3qC3NZ1@postini.com; Wed, 19 Dec 2012 09:17:26 PST Received: by mail-da0-f72.google.com with SMTP id r28so1865786daj.7 for ; Wed, 19 Dec 2012 09:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=x-received:x-received:sender:from:to:cc:subject:date:message-id :x-mailer; bh=nM8y9/P+u9zz/3NN5hk/dWDpZgMpKzc9inQuGKhGwvI=; b=Gy6IS2eRVrJrOes6SmaQ50VYrdoEG0L361gfCpT9po31D5qQegIm0cwSC0dUt3QPU0 x78Sevpf4OjJIu/N2ODc3iN6SeVsEi4c875rfTDu6QZfTDc1K4ggibgsQNc54GHwfZcL 0sYlvx9N12b4XQ3Ur1us/GNrLL4+4JfmIRRFs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-received:sender:from:to:cc:subject:date:message-id :x-mailer:x-gm-message-state; bh=nM8y9/P+u9zz/3NN5hk/dWDpZgMpKzc9inQuGKhGwvI=; b=Cw4ymhrwxXbQePiQL8F+p4PV51BX13BFDkuiPXtwW+8WowuAI4DL7KvNamjdpOtdqJ DOx0iTQ0unz2gu4FPd3NSyEQcq1tYXWN0JvDbQYxxO0g/+PEw6bLf15+SgjENKcnRtlt 0ld6YbiZ1owkcZRJ7WP1QQ5v9NA1tsNtDRoGJSFMlETSRiFFFLPmf9OI7jwqLgQoBngL ZEXDLfbIhyfPBCCBHvauG96O5m45gHrL3mfXvNvChfGCo60Fyd67a1L3SK8v+4G7MT1D PAVLGJyIrErreGnmGj/639p4lLaK16A3sGIz3W2gXzHs+Qnr1Nu3AG1tL1Q1H8Wn3o4/ /DPQ== X-Received: by 10.68.253.102 with SMTP id zz6mr20433336pbc.99.1355937445705; Wed, 19 Dec 2012 09:17:25 -0800 (PST) X-Received: by 10.68.253.102 with SMTP id zz6mr20433323pbc.99.1355937445625; Wed, 19 Dec 2012 09:17:25 -0800 (PST) Received: from roland-t410s.purestorage.com ([216.200.155.2]) by mx.google.com with ESMTPS id d9sm3736463paw.33.2012.12.19.09.17.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Dec 2012 09:17:24 -0800 (PST) From: Roland Dreier To: linux-rdma@vger.kernel.org, netdev@vger.kernel.org Cc: Roland Dreier Subject: [PATCH] IPoIB: Call skb_dst_drop() once skb is enqueued for sending Date: Wed, 19 Dec 2012 09:17:19 -0800 Message-Id: <1355937439-6521-1-git-send-email-roland@kernel.org> X-Mailer: git-send-email 1.8.0 X-Gm-Message-State: ALoCoQlmn8gF4tFY8bP/Kj1V0erfvl2NQyfvQSeXbShDshKOjSPdodTUFYpHzLdGsse/SoYcCNGnMfGCDdUcI3PI/sJSLj8Hfr92+HvQ+Wu3yyg9B7T7yTRgvvKR6eV7gnBUGi+dPnQEDc3J7eYauYAkJ5D9Us1EeEup3qhbzsmMS3dpONHvItM= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Roland Dreier Currently, IPoIB delays collecting send completions for TX packets in order to batch work more efficiently. It does skb_orphan() right after queuing the packets so that destructors run early, to avoid problems like holding socket send buffers for too long (since we might not collect a send completion until a long time after the packet is actually sent). However, IPoIB clears IFF_XMIT_DST_RELEASE because it actually looks at skb_dst() to update the PMTU when it gets a too-long packet. This means that the packets sitting in the TX ring with uncollected send completions are holding a reference on the dst. We've seen this lead to pathological behavior with respect to route and neighbour GC. The easy fix for this is to call skb_dst_drop() when we call skb_orphan(). Also, give packets sent via connected mode (CM) the same skb_orphan() / skb_dst_drop() treatment that packets sent via datagram mode get. Signed-off-by: Roland Dreier --- Planning to merge this for 3.8 unless someone objects. drivers/infiniband/ulp/ipoib/ipoib_cm.c | 3 +++ drivers/infiniband/ulp/ipoib/ipoib_ib.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 72ae63f..03103d2 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -752,6 +752,9 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_ dev->trans_start = jiffies; ++tx->tx_head; + skb_orphan(skb); + skb_dst_drop(skb); + if (++priv->tx_outstanding == ipoib_sendq_size) { ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n", tx->qp->qp_num); diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index f10221f..a1bca70 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -615,8 +615,9 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, address->last_send = priv->tx_head; ++priv->tx_head; - skb_orphan(skb); + skb_orphan(skb); + skb_dst_drop(skb); } if (unlikely(priv->tx_outstanding > MAX_SEND_CQE))