From patchwork Mon Nov 23 10:12:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 57133 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1342964lbb; Mon, 23 Nov 2015 02:14:27 -0800 (PST) X-Received: by 10.140.109.247 with SMTP id l110mr25906756qgf.35.1448273667273; Mon, 23 Nov 2015 02:14:27 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 66si10609205qgt.39.2015.11.23.02.14.27; Mon, 23 Nov 2015 02:14:27 -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 E21C6611F4; Mon, 23 Nov 2015 10:14:26 +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_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 DCFD461A29; Mon, 23 Nov 2015 10:13:18 +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 4CAA161846; Mon, 23 Nov 2015 10:13:11 +0000 (UTC) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by lists.linaro.org (Postfix) with ESMTPS id E9CB961846 for ; Mon, 23 Nov 2015 10:13:09 +0000 (UTC) Received: by pacdm15 with SMTP id dm15so186993141pac.3 for ; Mon, 23 Nov 2015 02:13:09 -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=5gymm5HiP+cCLkWNJt6o4QBLfulElRNoG6CA40pnkbQ=; b=0P+bUPCI43P91ATCMh5Z/7TRIPLNW78JgT7chdlrE/X3SjPUJoczWOL+3JqQazbFZI 2QjBe8BACCX84eq2TVV5aIeTaxvadjm3WNn07wH1/tDg4NZXV6+Z/2xhRD1RnbkdE6cH EmwanHX1tOEhNCJXBNBP0MoJko/PPpCEeVlFiNhvGnOjPUyDyq36kIiS7LhMiEM9FttY WYLn6j9yyl3eHnfKq8O6gOWgp4HfONx/msiNFhXqQbcOhw4Tqh21EpkAKfZSMsYw+cQY fY4inSN4yoezzexrRuvye2WmUUuaFasH+vfMQFYFtNDq35SooeihsQunxVKcPTwJX5/g u4Cg== 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=5gymm5HiP+cCLkWNJt6o4QBLfulElRNoG6CA40pnkbQ=; b=mms4c8tGSbSUhGM9lFXAc40NXy0YUcpIrkLOfILlBKG2jTpb+EZRj4NME/jhC4zkSM hOP1iXsH/w/3ubWlyx8xaMwocSLElQZHMHJO7dRxl/yekdlhJ67XvWsGH5lf+73gtbJV IG9OdF9SyCXpNMrUwBhfqazE2bQoXB6NiPqlEak46h10odRV1M66jPoZQCkDNNi/esi/ EQrA09fyuJrw5gebQ+n3jbi79578pRpO4VSZTJhG15OLWaDAOrYB6EAMM4cKroTEiuir iI+qraiPlVr8rmGIJlCw3Mlgx7Fm1WhYhLZ5Z8NHogvVYPHfvj6m4DGDNqTC0uDMvCv1 uDiA== X-Gm-Message-State: ALoCoQlDlMQVURf94VeWHFL5QCgpU33EkpaL2gosajPUoTet+/LGe1hWkpt8n4891UJuSPoE9Cud X-Received: by 10.66.154.129 with SMTP id vo1mr22514583pab.152.1448273589277; Mon, 23 Nov 2015 02:13:09 -0800 (PST) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id 132sm9247648pfc.63.2015.11.23.02.13.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 02:13:08 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 23 Nov 2015 15:42:49 +0530 Message-Id: <1448273572-27435-2-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448273572-27435-1-git-send-email-bala.manoharan@linaro.org> References: <1448273572-27435-1-git-send-email-bala.manoharan@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 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 | 4 ++++ platform/linux-generic/include/odp_packet_socket.h | 2 ++ 5 files changed, 17 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 a46c6fe..1f79f9c 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; }; @@ -118,6 +119,9 @@ typedef struct pktio_if_ops { int (*mac_get)(pktio_entry_t *pktio_entry, void *mac_addr); } pktio_if_ops_t; +int _odp_packet_cls_enq(pktio_entry_t *pktio_entry, uint8_t *base, + uint16_t buf_len, odp_packet_t *pkt_ret); + extern void *pktio_entry_ptr[]; static inline int pktio_to_id(odp_pktio_t pktio) 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 */