From patchwork Wed Dec 7 07:30:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhouyi Zhou X-Patchwork-Id: 9464113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9D4A26022E for ; Wed, 7 Dec 2016 07:30:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E5AC284B4 for ; Wed, 7 Dec 2016 07:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 837DD284BD; Wed, 7 Dec 2016 07:30:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FB51284B4 for ; Wed, 7 Dec 2016 07:30:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814AbcLGHa1 (ORCPT ); Wed, 7 Dec 2016 02:30:27 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33064 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbcLGHaY (ORCPT ); Wed, 7 Dec 2016 02:30:24 -0500 Received: by mail-pg0-f68.google.com with SMTP id 3so22627072pgd.0; Tue, 06 Dec 2016 23:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=GHckzUhSE6y/mO95Lais2eir84qQHY0d+Bg53JkuFag=; b=jH2SufrsIW4Qs4XUfCKVzevUTnRfVQ0VRA7B7HZBbRxBPpImWCuogiZchaN0tv86Nr 3H7QLANW3id6MmNVbLLuKiE744L6aUK2Xjv6FFPUkGnZFfaEXmzoN+vUjrN+M7Q2iYCx BXdjcHiClCpcqR1IYAcxz4O086Oy7S/+PaUjIBEVD016Mo1DfTjkZDj5An5eA8N5tLl7 ts7OjNEaJiFvvB8xemlB+fNYbvuH5spQnrjozamx1/XBJ9IKY7iBTFNnNOv3Y/PtQZ3C T93UdKF6F9a0z7dscSdHRhLVzr7ovIY7VNOKUrc9RKqNHKsup63Pc9/f9qr9euv5DiM/ HcIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GHckzUhSE6y/mO95Lais2eir84qQHY0d+Bg53JkuFag=; b=i0sYxlv/Uw3Z3Y2dlVGkVE11gS1y2PuoKgyajmMDkuMF2UEbNakUmmGi/0Z8RBbVSY BNdKxZMZ+LaPVxJchqg9v6/6ts4CsBTrHEXhpp9UXFyeeWj1StSCG2NBkljNtHrRsENb PbU8rLOsySyq483u8QtIWRYZFFQgMx6y/r8q15R98ESzXA6b1RF5K+3tIo5ztvRX7nKP yC6WEprFZeD/DrIWDTtvlDKyxyCE++ChAfg7bsVoT7bys/SrFXVCtyX+Y2xregVdtvyt VZdI3940hQV8CD9Su/+4nz6TxnQtCcfUKlWjv2xDNy7xEH6akHE0bkU5yi0fctWSS8x1 D/Tg== X-Gm-Message-State: AKaTC018IaqhMH+7NV3NmrdOy5EPRVV63KoxZJBxViPYv/LWtQoeG5+uW0n00GhLUAN5QQ== X-Received: by 10.99.113.87 with SMTP id b23mr1472043pgn.41.1481095824109; Tue, 06 Dec 2016 23:30:24 -0800 (PST) Received: from localhost.localdomain ([124.16.128.66]) by smtp.gmail.com with ESMTPSA id 24sm39796599pfh.41.2016.12.06.23.30.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Dec 2016 23:30:23 -0800 (PST) From: Zhouyi Zhou To: , , , , , , Cc: Zhouyi Zhou , Zhouyi Zhou Subject: [PATCH 1/1] infiniband: nes: return value of skb_linearize should be handled Date: Wed, 7 Dec 2016 15:30:05 +0800 Message-Id: <1481095805-25010-1-git-send-email-zhouzhouyi@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Return value of skb_linearize should be handled in function nes_netdev_start_xmit. Compiled in x86_64 Signed-off-by: Zhouyi Zhou Reviewed-by: Yuval Shaia Reviewed-by: Eric Dumazet --- drivers/infiniband/hw/nes/nes_nic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 2b27d13..dfd1f57 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c @@ -662,10 +662,14 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) nesnic->sq_head &= nesnic->sq_size-1; } } else { - nesvnic->linearized_skbs++; hoffset = skb_transport_header(skb) - skb->data; nhoffset = skb_network_header(skb) - skb->data; - skb_linearize(skb); + if (skb_linearize(skb)) { + nesvnic->tx_sw_dropped++; + kfree_skb(skb); + return NETDEV_TX_OK; + } + nesvnic->linearized_skbs++; skb_set_transport_header(skb, hoffset); skb_set_network_header(skb, nhoffset); if (!nes_nic_send(skb, netdev))