From patchwork Wed Jan 20 18:29:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 60048 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3337433lbb; Wed, 20 Jan 2016 10:30:16 -0800 (PST) X-Received: by 10.55.82.137 with SMTP id g131mr46626750qkb.66.1453314616485; Wed, 20 Jan 2016 10:30:16 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v16si44980915qge.70.2016.01.20.10.30.15; Wed, 20 Jan 2016 10:30:16 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A96276178E; Wed, 20 Jan 2016 18:30:15 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=EEY6CgNX; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6DDE0615CC; Wed, 20 Jan 2016 18:30:12 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7ED3D615DD; Wed, 20 Jan 2016 18:30:08 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by lists.linaro.org (Postfix) with ESMTPS id 8CAF3615CC for ; Wed, 20 Jan 2016 18:30:07 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id b14so43727616wmb.1 for ; Wed, 20 Jan 2016 10:30:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Kg+L+7KfPiW+4RGtBUw7zHDqZoN24N+XqGNBcSGrnRQ=; b=EEY6CgNXgaks4VjHMYB0s5HOdVf0c8a/53RDSlA1A7ZnbJh1crxH0q6HLmq9ojCplV 3yR0cUK5Tr/W038BNlQPL2Y05FmaZKa9MnvY8AHDiV/yylYEH3ZueLMXR6Uki1xSJPye GYxQWwElIA1vjnCjXFmu/9I+V3UX5Bh8ZM6sA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Kg+L+7KfPiW+4RGtBUw7zHDqZoN24N+XqGNBcSGrnRQ=; b=AfkRbg3fpU0FxnXo6bQJ40ckJQC8+8izV5gakJDH1ivnq7sfBZbVYskZYJRdmdYIZk 6lJUvaPtv6IjKahOj45zEud+G+5/AlETpMN0sCIaNpDIbtSXsIMxe0AiKdmmrO0qt+iH HyiYNKTvda6pCuRcz40Cu4Qfb4F5fwYFIEOMj/suqqPFFKhVL/lp/4Sh4p0XwlbzWIBS Rt97W8jNSz8lGmlWIeed2fjEnc3rqVL450G0NZwoGMBLcgh0ntywvnrpd5ptY5H3L3IT Jqz+kgiAwn7UOK20bHDWHXSyRTDef6xC2MeUPpXUFF8v3+om3BqSOiFMg1v1Xpf+BZrw eUCg== X-Gm-Message-State: ALoCoQlQDM99csscdgsW6xEGYiS1i6Wy6C6iE/Khggdsu6XWK3cwWZTtA3C/KWRApB3kn26eveUcabUJXGNQNDx2jbF4e4YVBA== X-Received: by 10.194.158.135 with SMTP id wu7mr37959530wjb.142.1453314606115; Wed, 20 Jan 2016 10:30:06 -0800 (PST) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id cv10sm34183208wjb.17.2016.01.20.10.30.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jan 2016 10:30:05 -0800 (PST) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 20 Jan 2016 18:29:53 +0000 Message-Id: <1453314593-6773-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: packet_io: expose pktio_tbl and is_free() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" The table and the accessor would be used by ODP-DPDK, when it scans through all the pktio interfaces to flush out TX completed buffers. Signed-off-by: Zoltan Kiss Reviewed-by: Stuart Haslam --- platform/linux-generic/include/odp_packet_io_internal.h | 2 ++ platform/linux-generic/odp_packet_io.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 84bee1e..3ab0bc8 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -104,6 +104,8 @@ typedef struct { pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES]; } pktio_table_t; +int is_free(pktio_entry_t *entry); + typedef struct pktio_if_ops { int (*init)(void); int (*term)(void); diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 908f9a4..cda1900 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -25,7 +25,7 @@ #include #include -static pktio_table_t *pktio_tbl; +pktio_table_t *pktio_tbl; /* pktio pointer entries ( for inlines) */ void *pktio_entry_ptr[ODP_CONFIG_PKTIO_ENTRIES]; @@ -90,7 +90,7 @@ int odp_pktio_init_local(void) return 0; } -static int is_free(pktio_entry_t *entry) +int is_free(pktio_entry_t *entry) { return (entry->s.taken == 0); }