From patchwork Fri May 20 19:04:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 12935 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 2DE4CC360; Fri, 20 May 2016 21:05:25 +0200 (CEST) Received: from alln-iport-8.cisco.com (alln-iport-8.cisco.com [173.37.142.95]) by dpdk.org (Postfix) with ESMTP id 1AE06C316 for ; Fri, 20 May 2016 21:05:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=7841; q=dns/txt; s=iport; t=1463771116; x=1464980716; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=tIQkdjEkTkf/2wgpiYM15oCE3EI256oaRkwRR0rZjwk=; b=bJLFBZHnZUyzLxGbQOQJUeOn/xtaJ1dacsvdewSr36QCoicdM4MfpKgq j1R0KHMDAK+HIpDXHX3In06tqyEBUVK3Yu14nb/Oa0daUbLoAUar84c6x sXOG0m/Lxw4B8q227PdmFj53IKd7qY4b/wn1Z3bs2zekTJFgmQsAZPkvf g=; X-IronPort-AV: E=Sophos;i="5.26,340,1459814400"; d="scan'208";a="275905917" Received: from rcdn-core-6.cisco.com ([173.37.93.157]) by alln-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 May 2016 19:05:14 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id u4KJ5ElY027464; Fri, 20 May 2016 19:05:14 GMT Received: by cisco.com (Postfix, from userid 392789) id 20FDA20F2003; Fri, 20 May 2016 12:05:14 -0700 (PDT) From: John Daley To: dev@dpdk.org Cc: John Daley Date: Fri, 20 May 2016 12:04:13 -0700 Message-Id: <1463771054-16861-10-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1463771054-16861-1-git-send-email-johndale@cisco.com> References: <1463771054-16861-1-git-send-email-johndale@cisco.com> Subject: [dpdk-dev] [PATCH 10/11] enic: Tx cleanup - remove unused files, functions, variables X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove some files, functions and variables left unused after Tx performance improvements. Signed-off-by: John Daley --- 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 336cfdf..821053e 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -39,7 +39,6 @@ #include "enic_compat.h" #include "rq_enet_desc.h" #include "enic.h" -#include "enic_vnic_wq.h" #define RTE_PMD_USE_PREFETCH