From patchwork Wed Sep 7 10:58:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 75629 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp261685qgf; Wed, 7 Sep 2016 03:58:18 -0700 (PDT) X-Received: by 10.36.23.142 with SMTP id 136mr5368532ith.73.1473245898554; Wed, 07 Sep 2016 03:58:18 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m195si4844084itm.123.2016.09.07.03.58.17; Wed, 07 Sep 2016 03:58:18 -0700 (PDT) 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E724A61618; Wed, 7 Sep 2016 10:58:16 +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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 7FFC76160D; Wed, 7 Sep 2016 10:58:13 +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 DC7326160F; Wed, 7 Sep 2016 10:58:11 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 7660861604 for ; Wed, 7 Sep 2016 10:58:10 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id h127so8034037lfh.0 for ; Wed, 07 Sep 2016 03:58:10 -0700 (PDT) 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=tG2T6HEoi9sbbAjJWXSEAQm4Ek5wFXuzrw74ksIvQ+g=; b=GgNSMXF8QcDfAVggYce82s/DtIwItEnHf7XeufGkaESBupUyvokAOKyKHSJ1Oy1jrn CQi8/VY9ANSZSro8hpZ98FBtnaViTiJ0psQmfUnmxNU7SJk8kwNEF/ZFH0c532LlvciZ /QVseYH5si3ecJeu9aVTdtMeg238fbzWavyY6hJS1PCLEfZ0SCx4h2dbR31zexBkqggg w+98lNvcEu2dvYPVYHfZl+BmVq0JfWje4jQclGxJLVNubuO1SwxpbObm8jSO2v7MbmW4 bF3J3/kW8hZQUo1PPwz4/z8jEshwF+m3aev99580MmTtYWAdcxF2gzEwtqEqZtT3ZrxN K6ag== X-Gm-Message-State: AE9vXwMUc5p4K2y/xWcEME1Q1L3fl0GNFnfTQJ3D8rfETYSjtXQSOVtuauIc5U49JV0owqErs74= X-Received: by 10.25.157.146 with SMTP id g140mr10852118lfe.172.1473245889257; Wed, 07 Sep 2016 03:58:09 -0700 (PDT) Received: from Ubuntu15.localdomain ([194.251.119.207]) by smtp.gmail.com with ESMTPSA id o79sm6413688lfb.33.2016.09.07.03.58.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 03:58:08 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 7 Sep 2016 13:58:06 +0300 Message-Id: <1473245886-17059-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [RFC API-NEXT PATCHv2] api: packet: add odp_packet_parse() and odp_packet_classify apis 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" The odp_packet_parse() call forces an inline reparse of a packet without reclassifying it. The odp_packet_classify() API causes a packet to be reclassified asynchronously with or without forced rebuffering. Signed-off-by: Bill Fischofer --- include/odp/api/spec/packet.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) -- 2.5.0 diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 4a14f2d..198f227 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -155,6 +155,42 @@ void odp_packet_free_multi(const odp_packet_t pkt[], int num); int odp_packet_reset(odp_packet_t pkt, uint32_t len); /** + * Parse a packet + * + * Performs a complete parse of an ODP packet to repopulate parser + * metadata associated with the packet. This can be used to perform + * inline re-classification of a packet after, for example, decaspulation. + * Any previous parser metadata is discarded and overwritten by this call. + * + * @param pkt Packet to (re)parse + * + * @return Parse results + * @retval 0 Parse successful + * @retval <0 Parse unsuccessful (packet format not recognized) + */ +int odp_packet_parse(odp_packet_t pkt); + +/** + * Classify a packet + * + * Performa a complete reclassification of an ODP packet. This is an + * asynchronous operation that reparses and assigns the packet to a new + * CoS. The caller may indicate whether rebuffering is or is not required. + * If rebuffering is requested, the packet will be rebuffered as part of the + * reclassification. If rebuffering is not requested, the packet may or may + * not be rebuffered, at the implementation's option. + * + * @param pkt Packet to be (re)classified + * @param rebuf Indicates whether the packet should or should not be rebuffered + * 0 = Rebuffering not required, 1 = rebuffering required. + * + * @retval 0 Classification request accepted. Caller no longer has access + * to pkt. + * @retval <0 Classification request failed. Input pkt unchanged. + */ +int odp_packet_classify(odp_packet_t pkt, int rebuf); + +/** * Get packet handle from event * * Converts an ODP_EVENT_PACKET type event to a packet.