From patchwork Wed Jan 28 20:19:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 43885 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 201E223FFF for ; Wed, 28 Jan 2015 20:20:01 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id f15sf12494820lbj.2 for ; Wed, 28 Jan 2015 12:20:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state: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=ovQvkxc/Sf6S9gJq1OhSDtpSrDt+Ok0k+OWnCVXvJOQ=; b=C+1nEXbEZnPAkeBdYvuHUv4pXhYiztgxHlBGd3+Ms4PJjWt0ix0nTbqzY+sRC1gsXO Q2nd+YP7ARnSMUmTNV9q3deg1sz3L2pc9Ww1THvML6ou6WLA8J5O9mVofQUphk/RewxP s1aShWoGNWxj999xqQBZ4DLQODqlLvd3URCC5CFz3Z7q1G7R+0dLErflKuuq3rdVZoBM KKlCbmmFIFqQxYEIZhy8qRK11ueFvZitSzSymtgHGDOPCRbhhrmcn+A3tFgeNpQ4sNgj 8QTVRo/tww9jYv/QpMpLvlPJ8vR8aWcFVQTs0HkXjrnpYm3dbe5gTXRyiKFFkv+e+BUy CEHA== X-Gm-Message-State: ALoCoQnnoZJjzJRXjcfjAmDVaoh58HMyC/fPZzrFx6G3PVdvd+6UZv+dSTIu6fXXApd1mK3VNa5U X-Received: by 10.152.37.71 with SMTP id w7mr660430laj.5.1422476400133; Wed, 28 Jan 2015 12:20:00 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.9 with SMTP id v9ls89692laa.34.gmail; Wed, 28 Jan 2015 12:20:00 -0800 (PST) X-Received: by 10.152.23.98 with SMTP id l2mr10545019laf.46.1422476399977; Wed, 28 Jan 2015 12:19:59 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id to9si5503646lbb.15.2015.01.28.12.19.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Jan 2015 12:19:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id z12so20995599lbi.7 for ; Wed, 28 Jan 2015 12:19:59 -0800 (PST) X-Received: by 10.112.44.230 with SMTP id h6mr10558261lbm.98.1422476399893; Wed, 28 Jan 2015 12:19:59 -0800 (PST) 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.35.133 with SMTP id h5csp1553298lbj; Wed, 28 Jan 2015 12:19:59 -0800 (PST) X-Received: by 10.224.29.209 with SMTP id r17mr16247017qac.104.1422476398393; Wed, 28 Jan 2015 12:19:58 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id p1si7415867qas.45.2015.01.28.12.19.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 28 Jan 2015 12:19:58 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YGZ5e-0001pi-Je; Wed, 28 Jan 2015 20:19:54 +0000 Received: from mail-oi0-f48.google.com ([209.85.218.48]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YGZ5Z-0001pd-2i for lng-odp@lists.linaro.org; Wed, 28 Jan 2015 20:19:49 +0000 Received: by mail-oi0-f48.google.com with SMTP id v63so19728347oia.7 for ; Wed, 28 Jan 2015 12:19:43 -0800 (PST) X-Received: by 10.60.55.169 with SMTP id t9mr3445058oep.70.1422476383674; Wed, 28 Jan 2015 12:19:43 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id y127sm2720707oie.3.2015.01.28.12.19.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Jan 2015 12:19:43 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 28 Jan 2015 14:19:37 -0600 Message-Id: <1422476377-31311-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCHv2] api: packet: odp_packet_flags spec changes X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@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.176 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 Rename odp_packet_error() to odp_packet_has_error() and delete odp_packet_errflag_frame_len() for consistency with related packet APIs as requested and approved by Petri. Signed-off-by: Bill Fischofer --- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 2 +- example/l2fwd/odp_l2fwd.c | 2 +- example/packet/odp_pktio.c | 2 +- platform/linux-generic/include/api/odp_packet_flags.h | 13 +++---------- platform/linux-generic/odp_packet_flags.c | 9 +-------- test/validation/buffer/odp_packet_test.c | 5 +---- test/validation/odp_pktio.c | 2 +- 8 files changed, 10 insertions(+), 27 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 492664e..ad62e08 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -522,7 +522,7 @@ static void *gen_recv_thread(void *arg) pkt = odp_packet_from_event(ev); /* Drop packets with errors */ - if (odp_unlikely(odp_packet_error(pkt))) { + if (odp_unlikely(odp_packet_has_error(pkt))) { odp_packet_free(pkt); continue; } diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index f2d2fc7..22fddb2 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -616,7 +616,7 @@ static pkt_disposition_e do_input_verify(odp_packet_t pkt, pkt_ctx_t *ctx EXAMPLE_UNUSED) { - if (odp_unlikely(odp_packet_error(pkt))) + if (odp_unlikely(odp_packet_has_error(pkt))) return PKT_DROP; if (!odp_packet_has_eth(pkt)) diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c index 18403da..305d9ae 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -424,7 +424,7 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned len) for (i = 0, j = 0; i < len; ++i) { pkt = pkt_tbl[i]; - if (odp_unlikely(odp_packet_error(pkt))) { + if (odp_unlikely(odp_packet_has_error(pkt))) { odp_packet_free(pkt); /* Drop */ pkt_cnt--; } else if (odp_unlikely(i != j++)) { diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index c4c720b..1972dfa 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -408,7 +408,7 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned len) for (i = 0, j = 0; i < len; ++i) { pkt = pkt_tbl[i]; - if (odp_unlikely(odp_packet_error(pkt))) { + if (odp_unlikely(odp_packet_has_error(pkt))) { odp_packet_free(pkt); /* Drop */ pkt_cnt--; } else if (odp_unlikely(i != j++)) { diff --git a/platform/linux-generic/include/api/odp_packet_flags.h b/platform/linux-generic/include/api/odp_packet_flags.h index 24c4065..c239a28 100644 --- a/platform/linux-generic/include/api/odp_packet_flags.h +++ b/platform/linux-generic/include/api/odp_packet_flags.h @@ -32,17 +32,10 @@ extern "C" { * Checks all error flags at once. * * @param pkt Packet handle - * @return 1 if packet has errors, 0 otherwise + * @retval 1 packet has errors + * @retval 0 packet has no errors */ -int odp_packet_error(odp_packet_t pkt); - -/** - * Check if error was 'frame length' error - * - * @param pkt Packet handle - * @return 1 if frame length error detected, 0 otherwise - */ -int odp_packet_errflag_frame_len(odp_packet_t pkt); +int odp_packet_has_error(odp_packet_t pkt); /** * Check for L2 header, e.g. ethernet diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index 3f0ea9f..e678f66 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -8,18 +8,11 @@ #include -int odp_packet_error(odp_packet_t pkt) +int odp_packet_has_error(odp_packet_t pkt) { return (odp_packet_hdr(pkt)->error_flags.all != 0); } -/* Get Error Flags */ - -int odp_packet_errflag_frame_len(odp_packet_t pkt) -{ - return odp_packet_hdr(pkt)->error_flags.frame_len; -} - /* Get Input Flags */ int odp_packet_has_l2(odp_packet_t pkt) diff --git a/test/validation/buffer/odp_packet_test.c b/test/validation/buffer/odp_packet_test.c index c1b28ab..022f9a3 100644 --- a/test/validation/buffer/odp_packet_test.c +++ b/test/validation/buffer/odp_packet_test.c @@ -435,10 +435,7 @@ static void packet_error_flags(void) * properly set. Just check that function return one of allowed values. * @todo: check classified packet when classifier is added in place. */ - err = odp_packet_error(pkt); - CU_ASSERT(err == 0 || err == 1); - - err = odp_packet_errflag_frame_len(pkt); + err = odp_packet_has_error(pkt); CU_ASSERT(err == 0 || err == 1); } diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 0985771..03b14f9 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -342,7 +342,7 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b, if (rx_pkt == ODP_PACKET_INVALID) break; CU_ASSERT(odp_packet_input(rx_pkt) == pktio_b->id); - CU_ASSERT(odp_packet_error(rx_pkt) == 0); + CU_ASSERT(odp_packet_has_error(rx_pkt) == 0); odp_packet_free(rx_pkt); }