Received: by 10.192.165.148 with SMTP id m20csp4651233imm; Tue, 24 Apr 2018 06:22:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx480a0MOqGDcxToqBPQ2/hhLBST3cJB3M5xTvLHuT+MHd+lkUFJO/7nG5mwp721yviQNjUq/ X-Received: by 10.98.180.2 with SMTP id h2mr23942363pfn.189.1524576120345; Tue, 24 Apr 2018 06:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524576120; cv=none; d=google.com; s=arc-20160816; b=prOefnmSUmIgMxPEneH6FE/ZdNZx+fvROf5DS76pjoBzP43srgXsiB6Ff87RSPUcHF PSQefoi4og8Hyl3PJzM540y7FJZH1hptKqmjCBl4hkLVPhbC2oE/SNAizH66uRirz5ge Brkv7yUfMv/ShLNDG3cOkhF/1aDFEqA51tsH3EpQslko7M4f62Ox5XtVVYpP2ZdMhUSb EjRiuOa536wbaIiWf7GdUQIa5uhN0ksjZPWcdh5UnUWamcm/OAXQq7/8tzYO1TxvOO3o WqlEroeLIhvN+i4dRlNRUeLv5VlopPNXYugckoyqXUasQd5AooZiPri4mIUePWKlWAEx 0CnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=YfSo/tihjzXYo0qLUR1cAIr86sIAWYfz3+cNy3GVKgs=; b=bRqgTwLuunLMP7jB+dsyhxRMqMIQGAYXwcfD3HVMfgawz9P6cjY40nGtXQdgZ3pscC 966/aS55i8v2nP18TuPHSFrfVPnaqDy76C+8q9KmQ7C67ULkH90LcE3USnPqVZUwwwQD Sq/bnCT3wwPaMR15r7FvQWWHJuFMk8RPo+Vd2U4euwnbKLgqlqiIzanliJt0jdVX3JSI YL1bNo/Kvmx1a5ptGomoPAgKeOQCtO+2FEte1yAsdU6SbX6ammIxOAn07nf+aohAQuh+ od4DQ5feSUXEq4x8dODT5gfV3Rj+NeX+JOXaq5KExxWinS3WAq35Ng5l320RrsAIHWKT +paw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MHJ5WV/K; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a98-v6si14152845pla.239.2018.04.24.06.21.45; Tue, 24 Apr 2018 06:22:00 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MHJ5WV/K; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758097AbeDXNUC (ORCPT + 99 others); Tue, 24 Apr 2018 09:20:02 -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-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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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; }; -- 2.17.0