From patchwork Tue Nov 17 06:16:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 56704 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1741502lbb; Mon, 16 Nov 2015 22:18:13 -0800 (PST) X-Received: by 10.141.0.194 with SMTP id b185mr42221118qhd.23.1447741093756; Mon, 16 Nov 2015 22:18:13 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s73si28814528qks.111.2015.11.16.22.18.13; Mon, 16 Nov 2015 22:18:13 -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.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id 2562361C85; Tue, 17 Nov 2015 06:18:13 +0000 (UTC) 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_H2,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 AA6CB61CE8; Tue, 17 Nov 2015 06:17:35 +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 DD80161C85; Tue, 17 Nov 2015 06:17:30 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by lists.linaro.org (Postfix) with ESMTPS id 3B1C761C9C for ; Tue, 17 Nov 2015 06:17:09 +0000 (UTC) Received: by pacdm15 with SMTP id dm15so200711235pac.3 for ; Mon, 16 Nov 2015 22:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=czY8PUZxt9idyQc0vILcZMmCv2kARyuG2qwpHb0HKMM=; b=Ip70MSVMhhWdK/8SDNlg6wz6nb+V6O4XGsBdQMQHSwBBgtPPiXrWtzIFp3rp9as0LY OYOk9g8RvwejYIatqDyfAg5TRj3oA+8Cy0G9LbcGGSR9CeGkQBh8LTFwmRg0BdaK8/p2 vtmbhv3NQWWSQ58N6k/+EUCcp00K7EunMzNChOvccOpkawzVNCJmhNXYtBaux5ShYazj buEupMtylKPDKqhPxzojzd3aQEQFEH9eG/KjGpCBrfH8lSjMeW8tloqDEQwV498LDN7h yKoYqKVDpHahILPq3GocdYVkp2pShnmV/h/LDCMYnunYdIbMXRcM0O4VIwuDeJtyeOpz 10KQ== 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:in-reply-to :references; bh=czY8PUZxt9idyQc0vILcZMmCv2kARyuG2qwpHb0HKMM=; b=i61keVvPmdh0UgnMRcjjezH3CJww1SOym5wHMPTXOH06QmyXQRxMbBH2GgmydX8Si7 wZkDuQijPvDEPkETxiINHMhzx1RiuRRuH68j7Gd5wRvfdwTmhyn5nIkSy/AjYWRkeOyB EnFinAHIjBGi/uBYNelXua7YsasTh2REnLFFyxwo7IxigpLFgAtYqyDDEn3sK86tRzbB hagDOSTBI3sbYTmDHiWyk3BLYWL25XVLyINGuero8gxDQDjS3x+IsdWEK27HJ1iUBAtT +BF6pn9aRg7KJileGZszoOQnD9sYuGS4DD1VaguIH8qHCQc5Ys7aCFqHN3tKMiPSdUdj U1kA== X-Gm-Message-State: ALoCoQlpHcuQF5n5zn1WL2mZddLk7BheZNLpJLjg+lRSOeSCr/e4t2sfJhxa4AL3vvH5HrmWgr3n X-Received: by 10.68.228.228 with SMTP id sl4mr60397673pbc.51.1447741028500; Mon, 16 Nov 2015 22:17:08 -0800 (PST) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id tp6sm40199084pbc.81.2015.11.16.22.17.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 22:17:08 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Tue, 17 Nov 2015 11:46:50 +0530 Message-Id: <1447741013-7333-2-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447741013-7333-1-git-send-email-bala.manoharan@linaro.org> References: <1447741013-7333-1-git-send-email-bala.manoharan@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/5] linux-generic: internal header file changes to support odp_cls_cos_pool_set() api 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" Adds linux-generic internal api's and modify internal structs to support configuring packet pool to CoS. Signed-off-by: Balasubramanian Manoharan --- platform/linux-generic/include/odp_classification_datamodel.h | 1 + platform/linux-generic/include/odp_classification_internal.h | 3 +++ platform/linux-generic/include/odp_packet_internal.h | 8 +++++++- platform/linux-generic/include/odp_packet_io_internal.h | 1 + platform/linux-generic/include/odp_packet_socket.h | 2 ++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/include/odp_classification_datamodel.h b/platform/linux-generic/include/odp_classification_datamodel.h index 4358fca..3569e9c 100644 --- a/platform/linux-generic/include/odp_classification_datamodel.h +++ b/platform/linux-generic/include/odp_classification_datamodel.h @@ -67,6 +67,7 @@ Class Of Service struct cos_s { queue_entry_t *queue; /* Associated Queue */ pool_entry_t *pool; /* Associated Buffer pool */ + odp_pool_t pool_id; /* Associated pool handle */ union pmr_u *pmr; /* Chained PMR */ union cos_u *linked_cos; /* CoS linked with the PMR */ uint32_t valid; /* validity Flag */ diff --git a/platform/linux-generic/include/odp_classification_internal.h b/platform/linux-generic/include/odp_classification_internal.h index 5593280..7e46986 100644 --- a/platform/linux-generic/include/odp_classification_internal.h +++ b/platform/linux-generic/include/odp_classification_internal.h @@ -61,6 +61,9 @@ This function calls Classifier module internal functions for a given packet and enqueues the packet to specific Queue based on PMR and CoS selected. **/ int packet_classifier(odp_pktio_t pktio, odp_packet_t pkt); + +int _odp_packet_classifier(pktio_entry_t *entry, odp_packet_t pkt); + /** Packet IO classifier init diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 6f1521c..12e9cca 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -28,6 +28,8 @@ extern "C" { #include #include +#define PACKET_JUMBO_LEN (9 * 1024) + /** * Packet input & protocol flags */ @@ -243,7 +245,7 @@ void packet_parse_l2(odp_packet_hdr_t *pkt_hdr); int packet_parse_full(odp_packet_hdr_t *pkt_hdr); /* Reset parser metadata for a new parse */ -void packet_parse_reset(odp_packet_t pkt); +void packet_parse_reset(odp_packet_hdr_t *pkt_hdr); /* Convert a packet handle to a buffer handle */ odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); @@ -251,6 +253,10 @@ odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); /* Convert a buffer handle to a packet handle */ odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf); +int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); + +int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 1a1118c..5e91cc0 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -86,6 +86,7 @@ struct pktio_entry { classifier_t cls; /**< classifier linked with this pktio*/ char name[PKTIO_NAME_LEN]; /**< name of pktio provided to pktio_open() */ + odp_pktio_t id; odp_pktio_param_t param; }; diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index a5e0eb3..1eaafb7 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -44,6 +44,8 @@ typedef struct { int sockfd; /**< socket descriptor */ odp_pool_t pool; /**< pool to alloc packets from */ unsigned char if_mac[ETH_ALEN]; /**< IF eth mac addr */ + uint8_t *cache_ptr[ODP_PACKET_SOCKET_MAX_BURST_RX]; + odp_shm_t shm; } pkt_sock_t; /** packet mmap ring */