From patchwork Fri Aug 14 18:42:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 52458 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id E6A2122B12 for ; Fri, 14 Aug 2015 18:43:20 +0000 (UTC) Received: by lbck9 with SMTP id k9sf29262411lbc.0 for ; Fri, 14 Aug 2015 11:43:19 -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:in-reply-to:references:in-reply-to:references: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=lMnr32ac82pC9+K8eQCYsnVqjFz+sIe1I5wuAfaWaYY=; b=P3E6slWQwQd+GtFVzWB+RHgMhTn9JvcALnGjFxhmLqGPG8VPZGRZpZC0VZOFlBbQOz EimvzYRiLi+2XU6YFBdauBppBwlDOmJoNOWdFpI1fA+I4j/al8p44RWdRWyVK9eEpjzX gl47jVx5p77vmtQyfiBjFlkEWWGmKVCEj0CbcllW5M7khggZW7XyOwEh5XE/YLyX3TMy 5LJDrqNo8REf42MFvpfVsZIfNoVIK3saDTwj3l68csV5C+pZBXwzqLpO4iySS2gj6Ntb sK/O3lUf/LhhNgizni7Udgvcdcw9F17kIX4Az861b/lxXiA3olrHmoxPpBDCpdSNhhE9 exWQ== X-Gm-Message-State: ALoCoQnUjmSoYsaP8kI2+dEAY7HQtpEqQECiWwXi1gevz2LcyqbAVMKCq0TSjVadZgdbOW14lTDR X-Received: by 10.180.35.162 with SMTP id i2mr1343217wij.6.1439577799905; Fri, 14 Aug 2015 11:43:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.228 with SMTP id h4ls441507lam.23.gmail; Fri, 14 Aug 2015 11:43:19 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr46500602laf.32.1439577799606; Fri, 14 Aug 2015 11:43:19 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id i19si6493898lbh.10.2015.08.14.11.43.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 11:43:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcbn3 with SMTP id bn3so50204762lbc.2 for ; Fri, 14 Aug 2015 11:43:19 -0700 (PDT) X-Received: by 10.112.125.34 with SMTP id mn2mr41532679lbb.76.1439577799419; Fri, 14 Aug 2015 11:43:19 -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.7.198 with SMTP id l6csp1810685lba; Fri, 14 Aug 2015 11:43:17 -0700 (PDT) X-Received: by 10.140.93.103 with SMTP id c94mr58640985qge.54.1439577796489; Fri, 14 Aug 2015 11:43:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 6si10861184qhd.70.2015.08.14.11.43.14; Fri, 14 Aug 2015 11:43:16 -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 D34D36227E; Fri, 14 Aug 2015 18:43:14 +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 353AC62285; Fri, 14 Aug 2015 18:42:44 +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 C62316227F; Fri, 14 Aug 2015 18:42:41 +0000 (UTC) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by lists.linaro.org (Postfix) with ESMTPS id AA31B61E02 for ; Fri, 14 Aug 2015 18:42:40 +0000 (UTC) Received: by wibhh20 with SMTP id hh20so30011975wib.0 for ; Fri, 14 Aug 2015 11:42:40 -0700 (PDT) X-Received: by 10.180.75.233 with SMTP id f9mr8791600wiw.21.1439577759980; Fri, 14 Aug 2015 11:42:39 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id mc18sm4282281wic.23.2015.08.14.11.42.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Aug 2015 11:42:39 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 14 Aug 2015 19:42:25 +0100 Message-Id: <1439577746-21499-2-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439577746-21499-1-git-send-email-zoltan.kiss@linaro.org> References: <1439577746-21499-1-git-send-email-zoltan.kiss@linaro.org> In-Reply-To: <1439488346-5676-1-git-send-email-zoltan.kiss@linaro.org> References: <1439488346-5676-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 2/3] linux-generic: packet: implement RSS hash support 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: zoltan.kiss@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.217.179 as permitted sender) smtp.mailfrom=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 This platform doesn't compute it, packet_init set it to 0, which happens to be ODP_PACKET_RSS_INVALID. Signed-off-by: Zoltan Kiss --- platform/linux-generic/include/odp/plat/packet_types.h | 2 ++ platform/linux-generic/include/odp_packet_internal.h | 1 + platform/linux-generic/odp_packet.c | 14 ++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/platform/linux-generic/include/odp/plat/packet_types.h b/platform/linux-generic/include/odp/plat/packet_types.h index 45cb801..afc72f4 100644 --- a/platform/linux-generic/include/odp/plat/packet_types.h +++ b/platform/linux-generic/include/odp/plat/packet_types.h @@ -36,6 +36,8 @@ typedef ODP_HANDLE_T(odp_packet_seg_t); #define ODP_PACKET_SEG_INVALID _odp_cast_scalar(odp_packet_seg_t, 0xffffffff) +#define ODP_PACKET_RSS_INVALID _odp_cast_scalar(odp_packet_t, 0) + /** Get printable format of odp_packet_t */ static inline uint64_t odp_packet_to_u64(odp_packet_t hdl) { diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 8c41491..6e52713 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -136,6 +136,7 @@ typedef struct { uint32_t tailroom; odp_pktio_t input; + uint32_t rss_hash; /**< RSS hash value*/ odp_crypto_generic_op_result_t op_result; /**< Result for crypto */ } odp_packet_hdr_t; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 5581cc4..649071f 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -326,6 +326,20 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset) return 0; } +uint32_t odp_packet_rss_hash(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->rss_hash; +} + +void odp_packet_rss_hash_set(odp_packet_t pkt, uint32_t rss_hash) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + pkt_hdr->rss_hash = rss_hash; +} + int odp_packet_is_segmented(odp_packet_t pkt) { return odp_packet_hdr(pkt)->buf_hdr.segcount > 1;