DPDK patches and discussions
 help / color / mirror / Atom feed
From: John Daley <johndale@cisco.com>
To: dev@dpdk.org
Cc: John Daley <johndale@cisco.com>
Subject: [dpdk-dev] [PATCH v2 10/11] enic: remove unused files and functions and variables
Date: Mon, 23 May 2016 23:32:58 -0700	[thread overview]
Message-ID: <1464071579-30072-11-git-send-email-johndale@cisco.com> (raw)
In-Reply-To: <1464071579-30072-1-git-send-email-johndale@cisco.com>

Remove some files, functions and variables left unused after
Tx performance improvements.

Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/base/enic_vnic_wq.h | 63 ------------------------------------
 drivers/net/enic/base/vnic_cq.h      | 44 -------------------------
 drivers/net/enic/base/vnic_wq.c      |  4 +--
 drivers/net/enic/base/vnic_wq.h      |  6 +---
 drivers/net/enic/enic.h              |  1 -
 drivers/net/enic/enic_main.c         |  2 +-
 drivers/net/enic/enic_rxtx.c         |  1 -
 7 files changed, 4 insertions(+), 117 deletions(-)
 delete mode 100644 drivers/net/enic/base/enic_vnic_wq.h

diff --git a/drivers/net/enic/base/enic_vnic_wq.h b/drivers/net/enic/base/enic_vnic_wq.h
deleted file mode 100644
index 55c5664..0000000
--- a/drivers/net/enic/base/enic_vnic_wq.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2008-2015 Cisco Systems, Inc.  All rights reserved.
- * Copyright 2007 Nuova Systems, Inc.  All rights reserved.
- *
- * Copyright (c) 2015, Cisco Systems, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef _ENIC_VNIC_WQ_H_
-#define _ENIC_VNIC_WQ_H_
-
-#include "vnic_dev.h"
-#include "vnic_cq.h"
-
-static inline void enic_vnic_post_wq_index(struct vnic_wq *wq)
-{
-	/* Adding write memory barrier prevents compiler and/or CPU
-	 * reordering, thus avoiding descriptor posting before
-	 * descriptor is initialized. Otherwise, hardware can read
-	 * stale descriptor fields.
-	*/
-	wmb();
-	iowrite32(wq->head_idx, &wq->ctrl->posted_index);
-}
-
-static inline void enic_vnic_post_wq(struct vnic_wq *wq,
-				     void *os_buf, uint8_t cq_entry)
-{
-	struct vnic_wq_buf *buf = &wq->bufs[wq->head_idx];
-	buf->mb = os_buf;
-	wq->head_idx = enic_ring_incr(wq->ring.desc_count, wq->head_idx);
-
-	if (cq_entry)
-		enic_vnic_post_wq_index(wq);
-}
-
-#endif /* _ENIC_VNIC_WQ_H_ */
diff --git a/drivers/net/enic/base/vnic_cq.h b/drivers/net/enic/base/vnic_cq.h
index 922391b..13ab87c 100644
--- a/drivers/net/enic/base/vnic_cq.h
+++ b/drivers/net/enic/base/vnic_cq.h
@@ -90,50 +90,6 @@ struct vnic_cq {
 #endif
 };
 
-static inline unsigned int vnic_cq_service(struct vnic_cq *cq,
-	unsigned int work_to_do,
-	int (*q_service)(struct vnic_dev *vdev, struct cq_desc *cq_desc,
-	u8 type, u16 q_number, u16 completed_index, void *opaque),
-	void *opaque)
-{
-	struct cq_desc *cq_desc;
-	unsigned int work_done = 0;
-	u16 q_number, completed_index;
-	u8 type, color;
-	struct rte_mbuf **rx_pkts = opaque;
-	unsigned int ret;
-
-	cq_desc = (struct cq_desc *)((u8 *)cq->ring.descs +
-		cq->ring.desc_size * cq->to_clean);
-	cq_desc_dec(cq_desc, &type, &color,
-		&q_number, &completed_index);
-
-	while (color != cq->last_color) {
-		if (opaque)
-			opaque = (void *)&(rx_pkts[work_done]);
-
-		ret = (*q_service)(cq->vdev, cq_desc, type,
-			q_number, completed_index, opaque);
-		cq->to_clean++;
-		if (cq->to_clean == cq->ring.desc_count) {
-			cq->to_clean = 0;
-			cq->last_color = cq->last_color ? 0 : 1;
-		}
-
-		cq_desc = (struct cq_desc *)((u8 *)cq->ring.descs +
-			cq->ring.desc_size * cq->to_clean);
-		cq_desc_dec(cq_desc, &type, &color,
-			&q_number, &completed_index);
-
-		if (ret)
-			work_done++;
-		if (work_done >= work_to_do)
-			break;
-	}
-
-	return work_done;
-}
-
 void vnic_cq_free(struct vnic_cq *cq);
 int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
 	unsigned int socket_id,
diff --git a/drivers/net/enic/base/vnic_wq.c b/drivers/net/enic/base/vnic_wq.c
index cfef1af..9b9ff4d 100644
--- a/drivers/net/enic/base/vnic_wq.c
+++ b/drivers/net/enic/base/vnic_wq.c
@@ -179,7 +179,7 @@ int vnic_wq_disable(struct vnic_wq *wq)
 }
 
 void vnic_wq_clean(struct vnic_wq *wq,
-	void (*buf_clean)(struct vnic_wq *wq, struct vnic_wq_buf *buf))
+		   void (*buf_clean)(struct vnic_wq_buf *buf))
 {
 	struct vnic_wq_buf *buf;
 	unsigned int  to_clean = wq->tail_idx;
@@ -188,7 +188,7 @@ void vnic_wq_clean(struct vnic_wq *wq,
 
 	while (vnic_wq_desc_used(wq) > 0) {
 
-		(*buf_clean)(wq, buf);
+		(*buf_clean)(buf);
 		to_clean = buf_idx_incr(wq->ring.desc_count, to_clean);
 
 		buf = &wq->bufs[to_clean];
diff --git a/drivers/net/enic/base/vnic_wq.h b/drivers/net/enic/base/vnic_wq.h
index 7a66813..38a217f 100644
--- a/drivers/net/enic/base/vnic_wq.h
+++ b/drivers/net/enic/base/vnic_wq.h
@@ -79,7 +79,6 @@ struct vnic_wq {
 	struct vnic_wq_buf *bufs;
 	unsigned int head_idx;
 	unsigned int tail_idx;
-	unsigned int pkts_outstanding;
 	unsigned int socket_id;
 	const struct rte_memzone *cqmsg_rz;
 	uint16_t last_completed_index;
@@ -193,8 +192,5 @@ unsigned int vnic_wq_error_status(struct vnic_wq *wq);
 void vnic_wq_enable(struct vnic_wq *wq);
 int vnic_wq_disable(struct vnic_wq *wq);
 void vnic_wq_clean(struct vnic_wq *wq,
-	void (*buf_clean)(struct vnic_wq *wq, struct vnic_wq_buf *buf));
-int vnic_wq_mem_size(struct vnic_wq *wq, unsigned int desc_count,
-	unsigned int desc_size);
-
+		   void (*buf_clean)(struct vnic_wq_buf *buf));
 #endif /* _VNIC_WQ_H_ */
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index fe186de..4eb28ee 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -233,5 +233,4 @@ uint16_t enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			uint16_t nb_pkts);
 uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts);
-void enic_free_wq_buf(__rte_unused struct vnic_wq *wq, struct vnic_wq_buf *buf);
 #endif /* _ENIC_H_ */
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index eaa206e..996f999 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -102,7 +102,7 @@ void enic_set_hdr_split_size(struct enic *enic, u16 split_hdr_size)
 	vnic_set_hdr_split_size(enic->vdev, split_hdr_size);
 }
 
-void enic_free_wq_buf(__rte_unused struct vnic_wq *wq, struct vnic_wq_buf *buf)
+static void enic_free_wq_buf(struct vnic_wq_buf *buf)
 {
 	struct rte_mbuf *mbuf = (struct rte_mbuf *)buf->mb;
 
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index ba15670..a04ebd0 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -37,7 +37,6 @@
 #include "enic_compat.h"
 #include "rq_enet_desc.h"
 #include "enic.h"
-#include "enic_vnic_wq.h"
 
 #define RTE_PMD_USE_PREFETCH
 
-- 
2.7.0

  parent reply	other threads:[~2016-05-24  6:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24  6:32 [dpdk-dev] [PATCH v2 00/11] enic counter fixes and Tx optimization John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 01/11] enic: fix Rx drop counters John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 02/11] enic: drop bad packets and remove unused Rx error flag John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 03/11] enic: count truncated packets John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 04/11] enic: put Tx and Rx functions into same file John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 05/11] enic: remove some unused functions in Tx path John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 06/11] enic: streamline mbuf handling " John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 07/11] enic: use Tx completion messages instead of descriptors John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 08/11] enic: refactor Tx mbuf recycling John Daley
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 09/11] enic: optimize the Tx function John Daley
2016-05-30 10:05   ` Azarewicz, PiotrX T
2016-05-24  6:32 ` John Daley [this message]
2016-05-24  6:32 ` [dpdk-dev] [PATCH v2 11/11] enic: add an enic assert macro John Daley
2016-06-03  0:22 ` [dpdk-dev] [PATCH v3 00/13] enic counter fixes and Tx optimization John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 01/13] enic: fix Rx drop counters John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 02/13] enic: drop bad packets and remove unused Rx error flag John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 03/13] enic: count truncated packets John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 04/13] enic: put Tx and Rx functions into same file John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 05/13] enic: remove some unused functions in Tx path John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 06/13] enic: streamline mbuf handling " John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 07/13] enic: use Tx completion messages instead of descriptors John Daley
2016-06-10 21:18     ` Bruce Richardson
2016-06-10 22:28       ` John Daley (johndale)
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 08/13] enic: refactor Tx mbuf recycling John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 09/13] enic: optimize the Tx function John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 10/13] enic: remove unused files and functions and variables John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 11/13] enic: add an enic assert macro John Daley
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 12/13] enic: expand local Tx mbuf flags variable to 64-bits John Daley
2016-06-03  8:05     ` Azarewicz, PiotrX T
2016-06-03  0:22   ` [dpdk-dev] [PATCH v3 13/13] enic: fix Tx IP and UDP/TCP checksum offload John Daley
2016-06-10 22:38   ` [dpdk-dev] [PATCH v3 00/13] enic counter fixes and Tx optimization Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464071579-30072-11-git-send-email-johndale@cisco.com \
    --to=johndale@cisco.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).