From patchwork Thu Jan 11 06:52:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenzhuo Lu X-Patchwork-Id: 33554 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D0EB1B1E7; Thu, 11 Jan 2018 07:50:45 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 4F9FC1B1E1 for ; Thu, 11 Jan 2018 07:50:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2018 22:50:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,343,1511856000"; d="scan'208";a="165878881" Received: from dpdk26.sh.intel.com ([10.67.110.152]) by orsmga004.jf.intel.com with ESMTP; 10 Jan 2018 22:50:39 -0800 From: Wenzhuo Lu To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Wenzhuo Lu Date: Thu, 11 Jan 2018 14:52:35 +0800 Message-Id: <1515653557-63430-2-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1515653557-63430-1-git-send-email-wenzhuo.lu@intel.com> References: <1515653557-63430-1-git-send-email-wenzhuo.lu@intel.com> Subject: [dpdk-dev] [PATCH 1/3] net/avf/base: add spinlock functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Move the spinlock functions to the base code, and make them inline. This patch is for next-net and want to be squashed to the commit in fixes tag. Fixes: 8267939627e7 ("net/avf/base: add base code for avf PMD") Signed-off-by: Wenzhuo Lu --- drivers/net/avf/base/avf_osdep.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/avf/base/avf_osdep.h b/drivers/net/avf/base/avf_osdep.h index 2f46bb2..9ef4596 100644 --- a/drivers/net/avf/base/avf_osdep.h +++ b/drivers/net/avf/base/avf_osdep.h @@ -156,6 +156,29 @@ struct avf_spinlock { #define avf_allocate_virt_mem(h, m, s) avf_allocate_virt_mem_d(h, m, s) #define avf_free_virt_mem(h, m) avf_free_virt_mem_d(h, m) +static inline void +avf_init_spinlock_d(struct avf_spinlock *sp) +{ + rte_spinlock_init(&sp->spinlock); +} + +static inline void +avf_acquire_spinlock_d(struct avf_spinlock *sp) +{ + rte_spinlock_lock(&sp->spinlock); +} + +static inline void +avf_release_spinlock_d(struct avf_spinlock *sp) +{ + rte_spinlock_unlock(&sp->spinlock); +} + +static inline void +avf_destroy_spinlock_d(__rte_unused struct avf_spinlock *sp) +{ +} + #define avf_init_spinlock(_sp) avf_init_spinlock_d(_sp) #define avf_acquire_spinlock(_sp) avf_acquire_spinlock_d(_sp) #define avf_release_spinlock(_sp) avf_release_spinlock_d(_sp)