From patchwork Mon Mar 2 18:46:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Barbu X-Patchwork-Id: 45300 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E7270214B5 for ; Mon, 2 Mar 2015 18:47:32 +0000 (UTC) Received: by lbiw7 with SMTP id w7sf25574934lbi.0 for ; Mon, 02 Mar 2015 10:47:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=emVHF0hzb1HUCoQnGoGPk5m9NdBmWBWjJXKDhM5BqdU=; b=FUnB9bYPf+8PyHwHijqmn4WFH4TqwlxFik3d0fl1YJBySyjBR6lS301gagp96oZB7O 7Ix/PHfUfqqtXTGB8Uh0bUAns0yWoDmH+KkQlUhgB6eqDhGcoLL5ml1XenWN7VPjgKgB sDQXxVbwjRT/2j8GOBMce9iq7GRPTGNfYmfT1QvVXxDa1SeKhWVV0CJb3apCFT1lE4Wu 5F6qdS/Ie0etEjsrAgrNmS2MkOE1iH/YDAIw0HIh/bCyaYPVnzKSiGnEYCWWf3JaY/TZ QTsd4nq4uThkwFl33UqzJQ37BuuBEbfBezGr8lYHdoUDTyJsnQg16tQKaIM4KooIc8NO nxZg== X-Gm-Message-State: ALoCoQk6nBlvlHiv4BZjY0tJXHMlhcXm6Hm4QZgidxDBwZDt/VhNHZ/5VmkA4cuDyzzADqbXoMu2 X-Received: by 10.180.89.194 with SMTP id bq2mr2420869wib.4.1425322051943; Mon, 02 Mar 2015 10:47:31 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.98 with SMTP id m2ls485357lae.5.gmail; Mon, 02 Mar 2015 10:47:31 -0800 (PST) X-Received: by 10.152.180.202 with SMTP id dq10mr24720232lac.74.1425322051769; Mon, 02 Mar 2015 10:47:31 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id pw1si9479280lbb.72.2015.03.02.10.47.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 10:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbdu14 with SMTP id u14so10998017lbd.0 for ; Mon, 02 Mar 2015 10:47:31 -0800 (PST) X-Received: by 10.152.115.136 with SMTP id jo8mr26393704lab.32.1425322051638; Mon, 02 Mar 2015 10:47:31 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp89928lbj; Mon, 2 Mar 2015 10:47:30 -0800 (PST) X-Received: by 10.140.239.136 with SMTP id k130mr54556823qhc.2.1425322050316; Mon, 02 Mar 2015 10:47:30 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id l18si1170587qkh.59.2015.03.02.10.47.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 02 Mar 2015 10:47:30 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YSVNG-0008BA-VK; Mon, 02 Mar 2015 18:47:27 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YSVN2-00087t-IO for lng-odp@lists.linaro.org; Mon, 02 Mar 2015 18:47:12 +0000 Received: by labgq15 with SMTP id gq15so32491605lab.3 for ; Mon, 02 Mar 2015 10:47:06 -0800 (PST) X-Received: by 10.152.36.226 with SMTP id t2mr7197244laj.53.1425322026520; Mon, 02 Mar 2015 10:47:06 -0800 (PST) Received: from cipriantemp.enea.se (sestofw01.enea.se. [192.36.1.252]) by mx.google.com with ESMTPSA id i13sm2696725lab.38.2015.03.02.10.47.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Mar 2015 10:47:05 -0800 (PST) From: Ciprian Barbu To: lng-odp@lists.linaro.org Date: Mon, 2 Mar 2015 20:46:46 +0200 Message-Id: <1425322017-14636-2-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1425322017-14636-1-git-send-email-ciprian.barbu@linaro.org> References: <1425322017-14636-1-git-send-email-ciprian.barbu@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH NETMAP 01/12] linux-netmap: pktio: use ticketlock to send and recv packets X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ciprian.barbu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Ciprian Barbu --- platform/linux-netmap/include/odp_packet_io_internal.h | 4 ++-- platform/linux-netmap/include/odp_packet_netmap.h | 1 + platform/linux-netmap/odp_packet_io.c | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/linux-netmap/include/odp_packet_io_internal.h b/platform/linux-netmap/include/odp_packet_io_internal.h index ea0b472..9208906 100644 --- a/platform/linux-netmap/include/odp_packet_io_internal.h +++ b/platform/linux-netmap/include/odp_packet_io_internal.h @@ -18,7 +18,7 @@ extern "C" { #endif -#include +#include #include #include @@ -33,7 +33,7 @@ typedef enum { } odp_pktio_type_t; struct pktio_entry { - odp_spinlock_t lock; /**< entry spinlock */ + odp_ticketlock_t lock; /**< entry ticketlock */ int taken; /**< is entry taken(1) or free(0) */ odp_queue_t inq_default; /**< default input queue, if set */ odp_queue_t outq_default; /**< default out queue */ diff --git a/platform/linux-netmap/include/odp_packet_netmap.h b/platform/linux-netmap/include/odp_packet_netmap.h index b4c523f..58f7fbe 100644 --- a/platform/linux-netmap/include/odp_packet_netmap.h +++ b/platform/linux-netmap/include/odp_packet_netmap.h @@ -17,6 +17,7 @@ #include #include #include +#include #define ODP_NETMAP_RING_HW 0 #define ODP_NETMAP_RING_SW 1 diff --git a/platform/linux-netmap/odp_packet_io.c b/platform/linux-netmap/odp_packet_io.c index de371e3..ad749d5 100644 --- a/platform/linux-netmap/odp_packet_io.c +++ b/platform/linux-netmap/odp_packet_io.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -60,7 +60,7 @@ int odp_pktio_init_global(void) for (id = 1; id <= ODP_CONFIG_PKTIO_ENTRIES; ++id) { pktio_entry = get_entry(id); - odp_spinlock_init(&pktio_entry->s.lock); + odp_ticketlock_init(&pktio_entry->s.lock); /* Create a default output queue for each pktio resource */ snprintf(name, sizeof(name), "%i-pktio_outq_default", (int)id); @@ -100,12 +100,12 @@ static void set_taken(pktio_entry_t *entry) static void lock_entry(pktio_entry_t *entry) { - odp_spinlock_lock(&entry->s.lock); + odp_ticketlock_lock(&entry->s.lock); } static void unlock_entry(pktio_entry_t *entry) { - odp_spinlock_unlock(&entry->s.lock); + odp_ticketlock_unlock(&entry->s.lock); } static void init_pktio_entry(pktio_entry_t *entry)