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: 1896181 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8EA93DF215 for ; Wed, 19 Dec 2012 17:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755663Ab2LSRR1 (ORCPT ); Wed, 19 Dec 2012 12:17:27 -0500 Received: from na3sys010aog107.obsmtp.com ([74.125.245.82]:60997 "HELO na3sys010aog107.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753465Ab2LSRR0 (ORCPT ); Wed, 19 Dec 2012 12:17:26 -0500 Received: from mail-da0-f70.google.com ([209.85.210.70]) (using TLSv1) by na3sys010aob107.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-f70.google.com with SMTP id t11so1866190daj.5 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=Hqst9Vtq1FLSrHEiQhNO9I4pCgmNElKW0wumqWQfXB7MdJYoB3MRv4xaPLTF5OS8af Zpf19HfM8wgumqP1vkk/DrM2dOY3/hI7zMEZmE2A5MkyNUDOlHOFn0/xuv6P9kqBwz7/ rVC82pud+UTs4iwM4eIucr57DXUHKtAiPD27M= 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=H3bwfMe+ipIj2kG8CkbERUNEIIwjXYw/miycX0BKlNX2n/aRAMz+OzKpl5U8flmEQa VfAu6CKkxlMAR71ANVM0zfMwnLTxld4EzZqxLk422vrR4nWE/bpSwL1HnilTDyfvFjoJ IKGDNq14Qhtv21X2JmH+svAZlBnaymHwHwJcdtSca4ZaNtzacsr9LmTiCMwBeEMWLz8S 4nPeCILnXl/lk2Mprg9GZ6map+4fx446w9O2HnZuKQvWheHs+K2+9CVH8/o1y3bLi9Vl s6iujn5x8C3B6F/Zj3Eiy5UCSsawEQpBVya6I8ei7Z0zB6RIMoFdb15tH2oFRx8Pj7tL 8rqA== X-Received: by 10.68.253.102 with SMTP id zz6mr20433335pbc.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: ALoCoQkf1k3v0ocPbnPhBUSOOn9u8zthzbnnzzPkU1fYvlbPvGilQnN0pESEy6zitCliFUC4TCcukSCwspnFjJ7w/zG2u/NH5Jvr+X0uHjQZ9lwdyCavGK7pYlwT2ASo1V4dLaBgbRv1PJAoYCJbJjzi1Is9Fls/d7pVWPYRtsiMhQrYQ7aVDqw= Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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))