From patchwork Thu Aug 10 15:38:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 800240 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=) 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 3xSslM6YGCz9sNd for ; Fri, 11 Aug 2017 01:39:59 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B7B0097A; Thu, 10 Aug 2017 15:38:27 +0000 (UTC) X-Original-To: ovs-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 D967D904 for ; Thu, 10 Aug 2017 15:38:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 899F51E1 for ; Thu, 10 Aug 2017 15:38:26 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20170810153824euoutp01fddeeb6f33b5e777819b3286c1287f1f~ZhjL9_7QY0436604366euoutp01a; Thu, 10 Aug 2017 15:38:24 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170810153823eucas1p16ada5a6a20eca023097e1aff1c7b1ff9~ZhjLI6bC03033930339eucas1p1l; Thu, 10 Aug 2017 15:38:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 26.F2.12576.FED7C895; Thu, 10 Aug 2017 16:38:23 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170810153822eucas1p2e17983b30e269a227626205b46f9dac7~ZhjKezno70083300833eucas1p2v; Thu, 10 Aug 2017 15:38:22 +0000 (GMT) X-AuditID: cbfec7ef-f79ee6d000003120-5b-598c7def32ef Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B0.34.20118.EED7C895; Thu, 10 Aug 2017 16:38:22 +0100 (BST) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OUH005CN7FL8NB0@eusync4.samsung.com>; Thu, 10 Aug 2017 16:38:22 +0100 (BST) From: Ilya Maximets To: ovs-dev@openvswitch.org, Bhanuprakash Bodireddy Date: Thu, 10 Aug 2017 18:38:04 +0300 Message-id: <1502379486-1568-3-git-send-email-i.maximets@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1502379486-1568-1-git-send-email-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPIsWRmVeSWpSXmKPExsWy7djP87rva3siDT50s1us/sVpsfOZssWr yQ2MFi39M5ktnr9YyGxx58pPNotpn2+zW1xp/8lusfbQB3aLuZ+eMzpweSze85LJ49nN/4we z6/1sHi833eVzaNvyypGj3fz37IFsEVx2aSk5mSWpRbp2yVwZfz61c1acNGn4vCybYwNjC8s uxg5OSQETCTuvNvGBmGLSVy4tx7I5uIQEljGKLG5pwfK+cwocbH5EQtMx97P71jgqtpf72WF cJq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Mp4CYx cc9EsF4hoJqV5x4zTWDkXcDIsIpRJLW0ODc9t9hIrzgxt7g0L10vOT93EyMw6Lcd+7llB2PX u+BDjAIcjEo8vAmi3ZFCrIllxZW5hxglOJiVRHg7KnsihXhTEiurUovy44tKc1KLDzGaAh01 kVlKNDkfGJF5JfGGJobmloZGxhYW5kZGSuK86pebIoUE0hNLUrNTUwtSi2D6mDg4pRoYtZwW J/t62yq1LItdG7uPdbf6n6UK//68ON748SffwnJLtZ4lvJ+n+PpPKlFvYbm5cZHozNty5xkb lzvZGlU8DJUK1Nq72kN7zwz9kyqKSz5KLp5x+krU6tynPXNkGPNUxTa/ehmtuGSqa9yi0C9M 0x49cni8PGBPwtNpvFwdnvyz8h0WnueVUWIpzkg01GIuKk4EAEHiZgKQAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170810153822eucas1p2e17983b30e269a227626205b46f9dac7 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G+yCvOyEseyghOyekBtMZWFkaW5nIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G1NhbXN1bmcgRWxlY3Ryb25pY3MbTGVhZGluZyBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-CMS-RootMailID: 20170810153822eucas1p2e17983b30e269a227626205b46f9dac7 X-RootMTR: 20170810153822eucas1p2e17983b30e269a227626205b46f9dac7 References: <1502379486-1568-1-git-send-email-i.maximets@samsung.com> Cc: Heetae Ahn , Ilya Maximets Subject: [ovs-dev] [PATCH v3 2/4] netdev: Remove unused may_steal. 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 Not needed anymore because 'may_steal' already handled on dpif-netdev layer and always true; Signed-off-by: Ilya Maximets --- lib/dpif-netdev.c | 2 +- lib/netdev-bsd.c | 4 ++-- lib/netdev-dpdk.c | 25 +++++++++++-------------- lib/netdev-dummy.c | 4 ++-- lib/netdev-linux.c | 4 ++-- lib/netdev-provider.h | 7 +++---- lib/netdev.c | 12 ++++-------- lib/netdev.h | 2 +- 8 files changed, 26 insertions(+), 34 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index a2a25be..dcf55f3 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3121,7 +3121,7 @@ dp_netdev_pmd_flush_output_on_port(struct dp_netdev_pmd_thread *pmd, tx_qid = pmd->static_tx_qid; } - netdev_send(p->port->netdev, tx_qid, &p->output_pkts, true, dynamic_txqs); + netdev_send(p->port->netdev, tx_qid, &p->output_pkts, dynamic_txqs); dp_packet_batch_init(&p->output_pkts); } diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c index 8a4cdb3..4f243b5 100644 --- a/lib/netdev-bsd.c +++ b/lib/netdev-bsd.c @@ -680,7 +680,7 @@ netdev_bsd_rxq_drain(struct netdev_rxq *rxq_) */ static int netdev_bsd_send(struct netdev *netdev_, int qid OVS_UNUSED, - struct dp_packet_batch *batch, bool may_steal, + struct dp_packet_batch *batch, bool concurrent_txq OVS_UNUSED) { struct netdev_bsd *dev = netdev_bsd_cast(netdev_); @@ -728,7 +728,7 @@ netdev_bsd_send(struct netdev *netdev_, int qid OVS_UNUSED, } ovs_mutex_unlock(&dev->mutex); - dp_packet_delete_batch(batch, may_steal); + dp_packet_delete_batch(batch, true); return error; } diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 1d82bca..8e3158f 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1872,12 +1872,12 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) static int netdev_dpdk_vhost_send(struct netdev *netdev, int qid, struct dp_packet_batch *batch, - bool may_steal, bool concurrent_txq OVS_UNUSED) + bool concurrent_txq OVS_UNUSED) { - if (OVS_UNLIKELY(!may_steal || batch->packets[0]->source != DPBUF_DPDK)) { + if (OVS_UNLIKELY(batch->packets[0]->source != DPBUF_DPDK)) { dpdk_do_tx_copy(netdev, qid, batch); - dp_packet_delete_batch(batch, may_steal); + dp_packet_delete_batch(batch, true); } else { dp_packet_batch_apply_cutlen(batch); __netdev_dpdk_vhost_send(netdev, qid, batch->packets, batch->count); @@ -1887,11 +1887,11 @@ netdev_dpdk_vhost_send(struct netdev *netdev, int qid, static inline void netdev_dpdk_send__(struct netdev_dpdk *dev, int qid, - struct dp_packet_batch *batch, bool may_steal, + struct dp_packet_batch *batch, bool concurrent_txq) { if (OVS_UNLIKELY(!(dev->flags & NETDEV_UP))) { - dp_packet_delete_batch(batch, may_steal); + dp_packet_delete_batch(batch, true); return; } @@ -1900,12 +1900,11 @@ netdev_dpdk_send__(struct netdev_dpdk *dev, int qid, rte_spinlock_lock(&dev->tx_q[qid].tx_lock); } - if (OVS_UNLIKELY(!may_steal || - batch->packets[0]->source != DPBUF_DPDK)) { + if (OVS_UNLIKELY(batch->packets[0]->source != DPBUF_DPDK)) { struct netdev *netdev = &dev->up; dpdk_do_tx_copy(netdev, qid, batch); - dp_packet_delete_batch(batch, may_steal); + dp_packet_delete_batch(batch, true); } else { int dropped; int cnt = batch->count; @@ -1933,12 +1932,11 @@ netdev_dpdk_send__(struct netdev_dpdk *dev, int qid, static int netdev_dpdk_eth_send(struct netdev *netdev, int qid, - struct dp_packet_batch *batch, bool may_steal, - bool concurrent_txq) + struct dp_packet_batch *batch, bool concurrent_txq) { struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); - netdev_dpdk_send__(dev, qid, batch, may_steal, concurrent_txq); + netdev_dpdk_send__(dev, qid, batch, concurrent_txq); return 0; } @@ -2905,8 +2903,7 @@ dpdk_ring_open(const char dev_name[], dpdk_port_t *eth_port_id) static int netdev_dpdk_ring_send(struct netdev *netdev, int qid, - struct dp_packet_batch *batch, bool may_steal, - bool concurrent_txq) + struct dp_packet_batch *batch, bool concurrent_txq) { struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); unsigned i; @@ -2919,7 +2916,7 @@ netdev_dpdk_ring_send(struct netdev *netdev, int qid, dp_packet_rss_invalidate(batch->packets[i]); } - netdev_dpdk_send__(dev, qid, batch, may_steal, concurrent_txq); + netdev_dpdk_send__(dev, qid, batch, concurrent_txq); return 0; } diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index f731af1..57ef13f 100644 --- a/lib/netdev-dummy.c +++ b/lib/netdev-dummy.c @@ -1062,7 +1062,7 @@ netdev_dummy_rxq_drain(struct netdev_rxq *rxq_) static int netdev_dummy_send(struct netdev *netdev, int qid OVS_UNUSED, - struct dp_packet_batch *batch, bool may_steal, + struct dp_packet_batch *batch, bool concurrent_txq OVS_UNUSED) { struct netdev_dummy *dev = netdev_dummy_cast(netdev); @@ -1132,7 +1132,7 @@ netdev_dummy_send(struct netdev *netdev, int qid OVS_UNUSED, ovs_mutex_unlock(&dev->mutex); } - dp_packet_delete_batch(batch, may_steal); + dp_packet_delete_batch(batch, true); return error; } diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 2ff3e2b..aaf4899 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -1269,7 +1269,7 @@ netdev_linux_tap_batch_send(struct netdev *netdev_, * expected to do additional queuing of packets. */ static int netdev_linux_send(struct netdev *netdev_, int qid OVS_UNUSED, - struct dp_packet_batch *batch, bool may_steal, + struct dp_packet_batch *batch, bool concurrent_txq OVS_UNUSED) { int error = 0; @@ -1305,7 +1305,7 @@ netdev_linux_send(struct netdev *netdev_, int qid OVS_UNUSED, } free_batch: - dp_packet_delete_batch(batch, may_steal); + dp_packet_delete_batch(batch, true); return error; } diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index b3c57d5..e6ec79a 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -347,9 +347,8 @@ struct netdev_class { * If the function returns a non-zero value, some of the packets might have * been sent anyway. * - * If 'may_steal' is false, the caller retains ownership of all the - * packets. If 'may_steal' is true, the caller transfers ownership of all - * the packets to the network device, regardless of success. + * The caller transfers ownership of all the packets to the network + * device, regardless of success. * * If 'concurrent_txq' is true, the caller may perform concurrent calls * to netdev_send() with the same 'qid'. The netdev provider is responsible @@ -369,7 +368,7 @@ struct netdev_class { * datapath". It will also prevent the OVS implementation of bonding from * working properly over 'netdev'.) */ int (*send)(struct netdev *netdev, int qid, struct dp_packet_batch *batch, - bool may_steal, bool concurrent_txq); + bool concurrent_txq); /* Registers with the poll loop to wake up from the next call to * poll_block() when the packet transmission queue for 'netdev' has diff --git a/lib/netdev.c b/lib/netdev.c index cb4d9f0..9f97127 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -771,9 +771,8 @@ netdev_get_pt_mode(const struct netdev *netdev) * If the function returns a non-zero value, some of the packets might have * been sent anyway. * - * If 'may_steal' is false, the caller retains ownership of all the packets. - * If 'may_steal' is true, the caller transfers ownership of all the packets - * to the network device, regardless of success. + * The caller transfers ownership of all the packets to the network device, + * regardless of success. * * If 'concurrent_txq' is true, the caller may perform concurrent calls * to netdev_send() with the same 'qid'. The netdev provider is responsible @@ -790,15 +789,12 @@ netdev_get_pt_mode(const struct netdev *netdev) * cases this function will always return EOPNOTSUPP. */ int netdev_send(struct netdev *netdev, int qid, struct dp_packet_batch *batch, - bool may_steal, bool concurrent_txq) + bool concurrent_txq) { - int error = netdev->netdev_class->send(netdev, qid, batch, may_steal, + int error = netdev->netdev_class->send(netdev, qid, batch, concurrent_txq); if (!error) { COVERAGE_INC(netdev_sent); - if (!may_steal) { - dp_packet_batch_reset_cutlen(batch); - } } return error; } diff --git a/lib/netdev.h b/lib/netdev.h index f8482f7..bdcacf5 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -181,7 +181,7 @@ int netdev_rxq_drain(struct netdev_rxq *); /* Packet transmission. */ int netdev_send(struct netdev *, int qid, struct dp_packet_batch *, - bool may_steal, bool concurrent_txq); + bool concurrent_txq); void netdev_send_wait(struct netdev *, int qid); /* Flow offloading. */