From patchwork Tue Apr 24 13:19:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 903439 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MHJ5WV/K"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40VkTC4GQyz9s1j for ; Tue, 24 Apr 2018 23:19:59 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 85A2741C; Tue, 24 Apr 2018 13:19:57 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A74D2412 for ; Tue, 24 Apr 2018 13:19:56 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2709567E for ; Tue, 24 Apr 2018 13:19:56 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id b21so823071wme.4 for ; Tue, 24 Apr 2018 06:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YfSo/tihjzXYo0qLUR1cAIr86sIAWYfz3+cNy3GVKgs=; b=MHJ5WV/KEwG3QzmIfeKm6C+7b5q0Zr6Z0cy4wVa7wgFFOl03Aq2lHWUbJ8fZP+u0bT XiGHRLbHzCDW7AygDoVgihzepbpCdKm5LGf6C+LvGdgliPXSLsIp9kH6V3smoQRMbVMA pxfD8XS5GkzfCH+Ig5GCaav4SH+FeHsK0zUxhJaR2cFhW0g2Z+ThEpnr+bgIxVK3zSkq t5BINiKTdWX4au4kWT+yVzROFPaq7RF1mwyGADW60I34nNT77Fk7UaO47MdF7Z5DURWQ uDRbFt9K1yHvdsXhgJbVS6xANx7yTWB2ptXU4MqYFI0X49WGXbXoPxCe31kANlVZEayW wTXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YfSo/tihjzXYo0qLUR1cAIr86sIAWYfz3+cNy3GVKgs=; b=oLc3Zd5Po8mIpTqOyw/Wmh0HezGuOsYQ0DdzIzc3A51NRg1plC+lE8mNPfSnKt9xHL QVKQgFJEWCy31UVyq5rsOPmYJMG0cmqYirZ4NodWx1RUqDnwU8Ipr4OHwaifS/rOHt0h 7/2EQa6UPcvE6nZPNJLJgk5bpEwYz+PqPHZawI8O9Uweudf4vv6+YF3E+N2nhVyZb40r QiaxnmHpIm3riTgRyhOvZALQgj6k6ynmnQOaQlVUKcdOj8TVCGgxYIPn/6Rcp83qHpS2 IKiOt9rOQHH6m27kpGx+ergxkx6GGCGwL6S+XxrfXz2D4gXI+7PR1phapI/5elurSVLL 4JIw== X-Gm-Message-State: ALQs6tB1ImIa+1ZxBaio4NUdV5TE1ogzBLcPfX4HbrzyppxW8UC5mQmJ hfZPIY42aOwIvihfFShkI5sCbbIKigQ= X-Google-Smtp-Source: AIpwx4+C2wDSP+36+Vx4G4clzrsXal17zCG1SeJtB7eg4FBqeEzDzWVB/ER1BqEvvaDk+pmj8HAPJA== X-Received: by 10.80.148.75 with SMTP id q11mr33625562eda.70.1524575994865; Tue, 24 Apr 2018 06:19:54 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:40e7:cd00:5113:f351:d61c:108c]) by smtp.gmail.com with ESMTPSA id j2sm4607805edp.22.2018.04.24.06.19.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 06:19:54 -0700 (PDT) From: Luc Van Oostenryck To: linux-kernel@vger.kernel.org Date: Tue, 24 Apr 2018 15:19:53 +0200 Message-Id: <20180424131953.6474-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.17.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: dev@openvswitch.org, netdev@vger.kernel.org, "David S. Miller" , Luc Van Oostenryck Subject: [ovs-dev] [PATCH] openvswitch: make vport_ops:send()'s return type consistent X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org The method struct vport_ops:send() is defined as returning an 'netdev_tx_t', which is defined as a typedef for a bitwise type and otherwise used for the start_xmit() methods. However, most openvswitch drivers use for this method dev_queue_xmit() which returns an 'int' and the return value of vport_ops:send() is in fact never used. Make things typewise consistent and use 'int' for vport_ops:send() as well for internal_dev_recv() (which is the only proper send method) as using 'netdev_tx_t' doesn't offer any advantages and in fact seems, if not wrong at least, inadequate. Signed-off-by: Luc Van Oostenryck Reviewed-by: Greg Rose --- net/openvswitch/vport-internal_dev.c | 6 +++--- net/openvswitch/vport.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 3ea55618e..2fd68c2fb 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c @@ -231,7 +231,7 @@ static void internal_dev_destroy(struct vport *vport) rtnl_unlock(); } -static netdev_tx_t internal_dev_recv(struct sk_buff *skb) +static int internal_dev_recv(struct sk_buff *skb) { struct net_device *netdev = skb->dev; struct pcpu_sw_netstats *stats; @@ -239,7 +239,7 @@ static netdev_tx_t internal_dev_recv(struct sk_buff *skb) if (unlikely(!(netdev->flags & IFF_UP))) { kfree_skb(skb); netdev->stats.rx_dropped++; - return NETDEV_TX_OK; + return 0; } skb_dst_drop(skb); @@ -257,7 +257,7 @@ static netdev_tx_t internal_dev_recv(struct sk_buff *skb) u64_stats_update_end(&stats->syncp); netif_rx(skb); - return NETDEV_TX_OK; + return 0; } static struct vport_ops ovs_internal_vport_ops = { diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index cda66c26a..8dcb48fe8 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -141,7 +141,7 @@ struct vport_ops { int (*set_options)(struct vport *, struct nlattr *); int (*get_options)(const struct vport *, struct sk_buff *); - netdev_tx_t (*send) (struct sk_buff *skb); + int (*send) (struct sk_buff *skb); struct module *owner; struct list_head list; };