Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp569641imm; Wed, 26 Sep 2018 03:29:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV63H6Gp8oU6gohLZHPN/D67cWQfUdCamBjS3NmiJC30I7g2OkJ/UPDjavjofytB4r98QKg6K X-Received: by 2002:a62:8d16:: with SMTP id z22-v6mr5629904pfd.181.1537957787949; Wed, 26 Sep 2018 03:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537957787; cv=none; d=google.com; s=arc-20160816; b=tRgKTF8M3036gWNsPSTdAcfGbQcKFFUQQQFHz4hU4kTJGwReJ+iiCqikAhAdaAGKok LyRkRJOKRaAArJKkvnqBtwxhPljswkCp6B89Y5Xu7vs/uC6O7j0G+/z8aDrK+ZaDDRPq /8uScgoTdmuuyuZIplVRGzXSFLxI8iBEAaqF4qML7X0WjgSfHm+AjROjKiJX4P9uxEdu B/mta8pFsdVlIMFTtoQ9vdHxm8nUU0Jl+lbJeEVqy+B7oN7y18gqPLwGRNlVjFRRokzn MlzBqKcSRoy2UTTLtIBbMzu/FEkcY2SpjcD3rE8eLd8A4WGxQul1YorDyvLTYz6SvZS6 6hlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=G100t1WHq63uyCoxX0Z/Mz77x27lmobSVKI/slfoye8=; b=dJ4ZZBvifnyJ5uwIhssfXHRGvrkQv6u1P/HcblS00UqbByAYh+U8KOKpeM2C8eWcn/ +Qw4nWmYTXdcSyrzGPrkgnzjiXY+29hngCTmww2Om6MJb4WKWIuc31t2/ZGlgGuWw1+g fLeclD2IdhR0qXzProKexRqTe1vI2xrobkwuOqRaf0vmXtl4sAEyCTSw4n6tCEm+waSg Wfr2nDouOpRS2ecnWI6c7fLhA0+n3y9dxzutrs0J9hInJt1xMJ6cbPtxn+fDk7ePTwdA qBgldEOj2PeRhE2vNSu5b0UKok/0u8QdqeYxOYRhzhJ5HXRe0tlMdIzneLQ62kyYAMH2 bF8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m16-v6si4396684pfh.92.2018.09.26.03.29.32; Wed, 26 Sep 2018 03:29:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727451AbeIZQlg (ORCPT + 99 others); Wed, 26 Sep 2018 12:41:36 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:34821 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726802AbeIZQlg (ORCPT ); Wed, 26 Sep 2018 12:41:36 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C0231A78755B0; Wed, 26 Sep 2018 18:29:14 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Wed, 26 Sep 2018 18:29:08 +0800 From: YueHaibing To: , , , CC: , , , YueHaibing Subject: [PATCH net-next] hv_netvsc: fix return type of ndo_start_xmit function Date: Wed, 26 Sep 2018 18:25:10 +0800 Message-ID: <20180926102510.15696-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t. As suggestion from Haiyang Zhang , if netvsc_vf_xmit fails, We are not sure if the error can go away after retrying, returning NETDEV_TX_BUSY may cause infinite retry from the upper layer. so just return NETDEV_TX_OK at there. Found by coccinelle. Signed-off-by: YueHaibing --- drivers/net/hyperv/netvsc_drv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index ec69974..a1d44b4 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -511,7 +511,8 @@ static int netvsc_vf_xmit(struct net_device *net, struct net_device *vf_netdev, return rc; } -static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) +static netdev_tx_t +netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) { struct net_device_context *net_device_ctx = netdev_priv(net); struct hv_netvsc_packet *packet = NULL; @@ -528,8 +529,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) */ vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev); if (vf_netdev && netif_running(vf_netdev) && - !netpoll_tx_running(net)) - return netvsc_vf_xmit(net, vf_netdev, skb); + !netpoll_tx_running(net)) { + netvsc_vf_xmit(net, vf_netdev, skb); + return NETDEV_TX_OK; + } /* We will atmost need two pages to describe the rndis * header. We can only transmit MAX_PAGE_BUFFER_COUNT number -- 1.8.3.1