From patchwork Mon Jun 13 16:46:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 69898 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1636000qgf; Mon, 13 Jun 2016 09:47:17 -0700 (PDT) X-Received: by 10.141.30.195 with SMTP id t64mr15675170qhf.38.1465836437751; Mon, 13 Jun 2016 09:47:17 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n50si15688975qtc.125.2016.06.13.09.47.17; Mon, 13 Jun 2016 09:47:17 -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 1FBD36854C; Mon, 13 Jun 2016 16:47:17 +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, 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 B677D68510; Mon, 13 Jun 2016 16:47:12 +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 AA9F868545; Mon, 13 Jun 2016 16:47:09 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by lists.linaro.org (Postfix) with ESMTPS id B87FE684DE for ; Mon, 13 Jun 2016 16:47:08 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id k204so88020944wmk.0 for ; Mon, 13 Jun 2016 09:47:08 -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=/i5VCVBn6s2hgBK6cmZzb50B39WhEpRblIWq+V22xF4=; b=IiI5BpkMSO0cjKLSpGPvZs95eFJppiqJLbLO8wAPK68Wa+bCSkx6hKeOuWZvT8UoGx M9V7jeAlHo1IfoUiS/0i1AAfJcwvaOZf6U0NelQ7ykzR5s2BGIiv3sPlK2Il6XOxnnP9 0YJWc+7oR5SWZgGaOpm8MjpIdwFIDkP24kbWE2emWudBE+tR0iHCC6GhxJcocr8Bp3C/ VfCWS4lz15/uJ6EiplrVoRjXxSOhYnqB8OQJ0PcWl5g1pCLn9NnwiIjKWJQc9Ny7El6o dfsZUDXNAxnYyzrq0kjpyVzRaE1C7t1SYJTejwt4kVpm1+84MRHYl8Vtc107WYt0SqT3 CmkA== X-Gm-Message-State: ALyK8tJ8qWrR9aHCRGfvFVCKoHo48XLlPbRedqk7El7g/J9/nZxAsBP/8Ohqz1apNDaoAvLg69o= X-Received: by 10.194.58.239 with SMTP id u15mr2038610wjq.73.1465836427623; Mon, 13 Jun 2016 09:47:07 -0700 (PDT) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id x83sm15170818wmx.9.2016.06.13.09.47.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Jun 2016 09:47:07 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Mon, 13 Jun 2016 17:46:27 +0100 Message-Id: <1465836387-32671-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: Classification patch Cc: matias.elo@nokia.com Subject: [lng-odp] [PATCH] linux-generic: classification: use proper accessor to set packet length 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" And repurpose packet_set_len() for this, as it is no longer used. This was introduced by the following commit, and break compatibility with ODP-DPDK: bd18047a "linux-gen: pktio: don't allocate new packets in classifier" Signed-off-by: Zoltan Kiss Reviewed-by: Bill Fischofer Reviewed-by: Balasubramanian Manoharan --- platform/linux-generic/include/odp_packet_internal.h | 4 ++-- platform/linux-generic/odp_classification.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index d5ace12..a84a6f8 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -278,9 +278,9 @@ static inline uint32_t packet_len(odp_packet_hdr_t *pkt_hdr) return pkt_hdr->frame_len; } -static inline void packet_set_len(odp_packet_t pkt, uint32_t len) +static inline void packet_set_len(odp_packet_hdr_t *pkt_hdr, uint32_t len) { - odp_packet_hdr(pkt)->frame_len = len; + pkt_hdr->frame_len = len; } static inline int packet_parse_l2_not_done(odp_packet_hdr_t *pkt_hdr) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 7520bdc..d2cc081 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -815,7 +815,7 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, uint16_t len, cos_t *cos; packet_parse_reset(pkt_hdr); - pkt_hdr->frame_len = len; + packet_set_len(pkt_hdr, len); _odp_parse_common(pkt_hdr, base); cos = cls_select_cos(entry, base, pkt_hdr);