Received: by 10.192.165.148 with SMTP id m20csp3516610imm; Mon, 7 May 2018 13:45:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoHqqO+P/tO3LsmHc8KbuGlvQcqzFvREonrkE41yXtwyu1EqAhCRdHqJ3GtUcxVqebFvrl1 X-Received: by 2002:aca:5603:: with SMTP id k3-v6mr22883514oib.77.1525725934042; Mon, 07 May 2018 13:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525725934; cv=none; d=google.com; s=arc-20160816; b=TDQrCG8+zyiG7OGqafP5fbSqiTwtY5rNw03rA5mdAztdMahuaHACvoGnutZSyL5E9E zFyMKLaEFe2uuRM4uf2+JscdQqBsLRXzo4yQITeO4lA3/6s6uqOnl/MGTiVdPkrezBwR D9f0YDaZs76r2ptRM7Oh5upc91F0HryFE50dgkzGN+aBb4WiDEikEa0iV2iY5pF6nUyo lCVLPBg6dVcgLgopLn6S7uHo7VXHYHJW16Ey+EjFvJdbL90F9f81rI8cA6EEaULFCeAJ xgTqlxxsHD58kKD0ijd0mSkSkUnY4uq9nFH/zD03S2InZIIv0uuMAh6gzLngI8YMjbxz vP2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=S2bZuxQjJztaqaBF0Mm1THd/mCe1W9cRy5bcxHWR+n4=; b=Ief5Qj0hb+6Ya2jJgcCeVGiL9XX/Oe2vrXqIaNutY/lovLMhPeMoeVSrPb6f5DsMIk 1ioP3bnDDJwL3zeXpl9ZgJd2IkbqC4ijnWY+5kMT/q8rZ3boWNraXI+CXBbeU0xF773S wo/D7+eRqvJF+LcSAN9lh1k6oAEL75KgPab0NHxtPqysbrFyz6puKcuabmXOWplk5j0B hWER9CZ+75C6EjBnRF5CIqdCLI3iBshwR6oA2ykuXYki6MOd1cxi0zzEytoIFTdnxwfe 0i7BwBXt13+18motUofAfyRmQb8sf36Yn2YFfNAcynLOPtBCa2m5aUHdYLAjAsrceel3 PCvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fu1gN6xt; 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 r125-v6si4398081oif.374.2018.05.07.13.45.18; Mon, 07 May 2018 13:45:33 -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=fu1gN6xt; 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 S1753255AbeEGUo5 (ORCPT + 99 others); Mon, 7 May 2018 16:44:57 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33716 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752918AbeEGUoz (ORCPT ); Mon, 7 May 2018 16:44:55 -0400 Received: by mail-pl0-f67.google.com with SMTP id w12-v6so765792plp.0; Mon, 07 May 2018 13:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=S2bZuxQjJztaqaBF0Mm1THd/mCe1W9cRy5bcxHWR+n4=; b=fu1gN6xtN1oLYWfsrIcTLbw1KlOP+v1DK0qcRlVTa6Mpz4mCplSB78qc0unaaTITGU pPxgHHfQQ5TVpJX/nC6xL43Ar1qKgur2hP+7S+YsODnNqQFPdgjV6nU2ruTrK+tzH/FJ zbEYoKInPmroDK2Vp0CFoSxACvA7Edc+l6zYybf8BMhPyfkIjEuGqrS113c9rncKDF6S aXDywSDq+QqWPqdl80kS007l+zAUS8WXPHkXMZUMvtRGBMkXhjF08TP/U6kBPGgENlJf xC77CyjaMu/d398QlgUDNkdzAm5vZzX4C7hakgDBSrAFytGjjkPG/dAWAUEiSSfEbWXW axlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=S2bZuxQjJztaqaBF0Mm1THd/mCe1W9cRy5bcxHWR+n4=; b=JRiP2YR8jRyy0nAo8sOYE0eogB7xtniz/zgnMO+ShCx79A1T+Qb0rTqmsq+ZbpdtHo neTN4Ybn9dWB4iWvEmQ7ndRI731FGnxxb2LU4fnfzC/urf6BwDShSZ8qpuVFXYUNqH4J fz53XpW2LFAuYd5bInF5tDUzwkC0GFEaWUrmp2PRvllT9eI/wjBet+bS4LbxZ+6URUIF LW4rgT2j1jkUzLI/T/OUxrWSB6FP9GFDN0K6zzU9lOJC8vNqlIcv8Lz39ZBGztA3/Sbo uR9PxWAz7rIscA3PKe7XvekvVya6FCuesluouiGQmgJk+YF9HEDJpZW8kaIN4alA55A4 chWQ== X-Gm-Message-State: ALQs6tC/GSr0lGbfuA40c7mrFEB83vVBoXyYF85UCErnCMumoDRaCQTh HBMAGhMXRsG2DoILDIRKvCES3K/5 X-Received: by 2002:a65:4944:: with SMTP id q4-v6mr31281030pgs.424.1525725895057; Mon, 07 May 2018 13:44:55 -0700 (PDT) Received: from [192.168.0.16] (67-5-146-204.ptld.qwest.net. [67.5.146.204]) by smtp.gmail.com with ESMTPSA id l192-v6sm39949821pga.1.2018.05.07.13.44.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 May 2018 13:44:54 -0700 (PDT) Subject: Re: [ovs-dev] [PATCH] openvswitch: make vport_ops:send()'s return type consistent To: Luc Van Oostenryck , linux-kernel@vger.kernel.org Cc: dev@openvswitch.org, netdev@vger.kernel.org, "David S. Miller" References: <20180424131953.6474-1-luc.vanoostenryck@gmail.com> From: Gregory Rose Message-ID: Date: Mon, 7 May 2018 13:44:53 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180424131953.6474-1-luc.vanoostenryck@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/24/2018 6:19 AM, Luc Van Oostenryck wrote: > 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; > }; Yes, it does seem odd to use a tx return type for receive.  Nice fixup. Reviewed-by: Greg Rose