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: 903440 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MHJ5WV/K"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40VkTh6BGjz9s02 for ; Tue, 24 Apr 2018 23:20:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758086AbeDXNUB (ORCPT ); Tue, 24 Apr 2018 09:20:01 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:56145 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758069AbeDXNT4 (ORCPT ); Tue, 24 Apr 2018 09:19:56 -0400 Received: by mail-wm0-f65.google.com with SMTP id a8so927246wmg.5; Tue, 24 Apr 2018 06:19:55 -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=CdFfcwKYGhI7WVqgMlMY08PLrmWj5wVYvdUJIhFe+v0PXgSOXtOQyuCae69VPkImpf ealyy8mavr0LXA11fs+FSPui1L+HAZLsx/mQ/6WqyCesgXMmBA8LCpHCksb6Bt3q/R2V VL9h6VefdKQH6TWUP+UkFELPTGu6KVB6bjEiJZbMEx0sYk6CYQWqmHqUrKa51WLYu/YI edIa//AR+Oc4APwjXtGQ4T5mfCUDBRHnmM/9ofjHrG+fwxaTE8wVMFQxMAcSBP0H+Bad rrQ66L+9OseZB1zseaVuRq5fOi4+u0OCvY37/4ZqayOoWfw7bbB+sgJ9w0x5dOXcv4pi +8Og== X-Gm-Message-State: ALQs6tDRhD3DtgzLyeiKHLL9H2UTpXD3LxYEcOhHEnpMbLVoHNp8BQiG Ofl0NzNGFGkxBk4JLyibotp+dR+VoEw= 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 Cc: Luc Van Oostenryck , Pravin B Shelar , "David S. Miller" , netdev@vger.kernel.org, dev@openvswitch.org Subject: [PATCH] openvswitch: make vport_ops:send()'s return type consistent 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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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; };