From patchwork Sun May 9 04:00:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: FUJITA Tomonori X-Patchwork-Id: 51983 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 55B67B7D62 for ; Sun, 9 May 2010 14:01:13 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750795Ab0EIEBH (ORCPT ); Sun, 9 May 2010 00:01:07 -0400 Received: from sh.osrg.net ([192.16.179.4]:55498 "EHLO sh.osrg.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759Ab0EIEBG (ORCPT ); Sun, 9 May 2010 00:01:06 -0400 Received: from localhost (rose.osrg.net [10.76.0.1]) by sh.osrg.net (8.14.3/8.14.3/OSRG-NET) with ESMTP id o4940nau016194; Sun, 9 May 2010 13:00:49 +0900 Date: Sun, 9 May 2010 13:00:49 +0900 To: akpm@linux-foundation.org, davem@davemloft.net Cc: randy.dunlap@oracle.com, netdev@vger.kernel.org Subject: [PATCH -mm] Documentation: add networking driver's mapping error handling to DMA-API-HOWTO From: FUJITA Tomonori Mime-Version: 1.0 Message-Id: <20100509130439D.fujita.tomonori@lab.ntt.co.jp> Lines: 40 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Sun, 09 May 2010 13:00:50 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96 at sh X-Virus-Status: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I think that it's a good idea to add what drivers should to do exactly in the DMA mapping failure case. Seems some networking drivers call dev_kfree_skb() and return NETDEV_TX_OK, however, some return NETDEV_TX_BUSY without freeing the skb. (and many don't even check the failure, which we need to fix). What networking drivers are supposed to do in the case? = From: FUJITA Tomonori Subject: [PATCH -mm] Documentation: add networking driver's mapping error handling to DMA-API-HOWTO Adds the concrete DMA mapping error handling for Networking drivers on the transmit path. Signed-off-by: FUJITA Tomonori Acked-by: David S. Miller --- Documentation/DMA-API-HOWTO.txt | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/Documentation/DMA-API-HOWTO.txt b/Documentation/DMA-API-HOWTO.txt index 52618ab..8c3235c 100644 --- a/Documentation/DMA-API-HOWTO.txt +++ b/Documentation/DMA-API-HOWTO.txt @@ -740,6 +740,11 @@ failure can be determined by: */ } +Networking drivers must call dev_kfree_skb to free the socket buffer +and return NETDEV_TX_OK if the DMA mapping fails on the transmit hook +(ndo_start_xmit). This means that the socket buffer is just dropped in +the failure case. + Closing This document, and the API itself, would not be in it's current