From patchwork Tue Jul 14 11:58:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 51104 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 44423202B9 for ; Tue, 14 Jul 2015 11:58:52 +0000 (UTC) Received: by wipp2 with SMTP id p2sf4095035wip.2 for ; Tue, 14 Jul 2015 04:58:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id: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=8v/zBlUDm6GLxkZEahc+FOt+zdabLwuz4yW5/yRPD6c=; b=YVrE8xDkwf1rH7I5dT9Nlqkr4NKHrEVeemfX+L/U9tj39RA4LHd1z+oCIXI4bPmmPh n8x8EeMPhX3Lf5Lt/F+AtBHyM0CYzWJRGp0gw07sPnmcg5l8sI4Giarapjo3BIM24hZH qX28QaWatbbwFnvCmGBMOnyAyvzCKnFpFx+JyX8tixPf62YA48SDxDlD158RSKEQq244 r4VV1ND1qvEm5KjgswE36M/sjTKU/vl764qIa8i7O83NVIM5EIPv7zmJw2MfDAX/dwCB iiC0wC1EedM3o1NzACxG9e0+5V7h0W/tvTrdNDKZpSeZ0fsrzSNZ/fTTtkRK3ixTxBgO NUHA== X-Gm-Message-State: ALoCoQnS3L64tHKj8op9Oa9F05raDpIBzDyXzwYUG7LCHKoCWaEolaEJ669+gkoN01G0zRgRrfhE X-Received: by 10.180.35.162 with SMTP id i2mr9901846wij.6.1436875131597; Tue, 14 Jul 2015 04:58:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.108 with SMTP id ud12ls37832lac.43.gmail; Tue, 14 Jul 2015 04:58:51 -0700 (PDT) X-Received: by 10.152.23.4 with SMTP id i4mr37287356laf.51.1436875131427; Tue, 14 Jul 2015 04:58:51 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id i18si723442lbo.102.2015.07.14.04.58.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jul 2015 04:58:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laem6 with SMTP id m6so4641970lae.0 for ; Tue, 14 Jul 2015 04:58:51 -0700 (PDT) X-Received: by 10.112.139.103 with SMTP id qx7mr1824835lbb.73.1436875131337; Tue, 14 Jul 2015 04:58:51 -0700 (PDT) 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.108.230 with SMTP id hn6csp2334781lbb; Tue, 14 Jul 2015 04:58:50 -0700 (PDT) X-Received: by 10.140.95.85 with SMTP id h79mr60954178qge.68.1436875130180; Tue, 14 Jul 2015 04:58:50 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 202si738040qhw.97.2015.07.14.04.58.49; Tue, 14 Jul 2015 04:58:50 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 5087161DA5; Tue, 14 Jul 2015 11:58:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6902261B71; Tue, 14 Jul 2015 11:58:46 +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 5F50461B76; Tue, 14 Jul 2015 11:58:44 +0000 (UTC) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by lists.linaro.org (Postfix) with ESMTPS id DD98661800 for ; Tue, 14 Jul 2015 11:58:25 +0000 (UTC) Received: by wiga1 with SMTP id a1so97189122wig.0 for ; Tue, 14 Jul 2015 04:58:25 -0700 (PDT) X-Received: by 10.180.95.67 with SMTP id di3mr4706836wib.78.1436875105043; Tue, 14 Jul 2015 04:58:25 -0700 (PDT) Received: from e106441.cambridge.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id bq7sm1603578wjc.31.2015.07.14.04.58.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Jul 2015 04:58:24 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Tue, 14 Jul 2015 12:58:18 +0100 Message-Id: <1436875098-27302-1-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: Classification patch Subject: [lng-odp] [PATCH] linux-generic: classification: add support for ODP_PMR_IPSEC_SPI X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stuart.haslam@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.215.44 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: Stuart Haslam Reviewed-by: Balasubramanian Manoharan --- platform/linux-generic/include/odp_classification_inlines.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/include/odp_classification_inlines.h b/platform/linux-generic/include/odp_classification_inlines.h index 8d1e1c1..560104e 100644 --- a/platform/linux-generic/include/odp_classification_inlines.h +++ b/platform/linux-generic/include/odp_classification_inlines.h @@ -189,7 +189,18 @@ static inline int verify_pmr_ipsec_spi(uint8_t *pkt_addr ODP_UNUSED, odp_packet_hdr_t *pkt_hdr ODP_UNUSED, pmr_term_value_t *term_value ODP_UNUSED) { - ODP_UNIMPLEMENTED(); + uint32_t *spi; + + if (!pkt_hdr->input_flags.ipsec) + return 0; + + spi = (uint32_t *)(pkt_addr + pkt_hdr->l4_offset); + if (pkt_hdr->l4_protocol == ODPH_IPPROTO_AH) + spi++; + + if (term_value->val == (odp_be_to_cpu_32(*spi) & term_value->mask)) + return 1; + return 0; } static inline int verify_pmr_ld_vni(uint8_t *pkt_addr ODP_UNUSED,