From patchwork Thu Nov 16 15:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 119047 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5692024qgn; Thu, 16 Nov 2017 07:02:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ5CdHKfZgovMSZag6x3cDAegD/ORLrbnFNELK1nkidDgUEuc9oVyCY4Dhn/ssaXnUNC4Om X-Received: by 10.200.17.146 with SMTP id d18mr2897607qtj.61.1510844545471; Thu, 16 Nov 2017 07:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510844545; cv=none; d=google.com; s=arc-20160816; b=DDsxiS66e1HQWJBvUabX9Jj5pY0GGAs1qfeVqJO2704BVWS3UbkJGNfMiqo/pegzIR d3Lqu7o5v+GPlWFYB0j0xgUIUas4o9LD3KCEDKVP7zHHK9dS1U1fftEbrBjL4unLCYW4 gg6BPGPpfKz1WLm31YdshfPsvGshvG6zZ4pYm0JVKAuOgVHeUV79MkTyzqFeMgB7yKsD cTxtoUOaayCCLw8C0Epoh5LLUoO4Njn4kgPbXHNk4Au+eD4HEC3mUJzNii0pJTp05EgP yrmWA4wwcc4j04o60x/sgWI57V9CHfoXPZlIp3uwfNTFqTeMLY41Fghco9zwpPkb1cok SDPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=auqZZO/iu/n462Aad43lmp3e6721ie3AeI1OkECLCkE=; b=09ulKfxPwKeNQ6oqbfr4fpUBzx5GtJK3n8JdFcJs697T67iU3Bj5YC8ZIhN+ISZick OIM0XOxI4s1bNunVbEwv2LHNYxLsQpKLZI9FvA3OIXwbgRCmc+Q2OQcRjS8Zf6WLqpd6 TJitP/1EIAsTjl15tYvH0A0Xos4sytq3rkqGLjNd7IIGf/M3bNFAYgn5Dg45hpmnk93M Gd6Rjz1L9PRzK30s81RmGNHsG3yVmoWnvB3tUzWJaybdXjf2XweHvFGEp8aw1cR+Sh4P mlgzaXfbyF0n2UxTVfMSOI3y3UKPYPNygTEBTcnyqjie9L9kw+31ezuh4Q9aC+0Qx4uK iRxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id m4si1209600qkc.328.2017.11.16.07.02.25; Thu, 16 Nov 2017 07:02:25 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2C45060865; Thu, 16 Nov 2017 15:02:25 +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,FREEMAIL_FROM, 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 222EB6073F; Thu, 16 Nov 2017 15:00:37 +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 E4C8F6074A; Thu, 16 Nov 2017 15:00:17 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 07A24606A8 for ; Thu, 16 Nov 2017 15:00:16 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 780F22A22C13 for ; Thu, 16 Nov 2017 18:00:14 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 8OZzm8XKUQ-0EEOtKVA; Thu, 16 Nov 2017 18:00:14 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id H8kylhnNlg-0D3uG21C; Thu, 16 Nov 2017 18:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 16 Nov 2017 18:00:08 +0300 Message-Id: <1510844412-21931-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510844412-21931-1-git-send-email-odpbot@yandex.ru> References: <1510844412-21931-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 298 Subject: [lng-odp] [PATCH API-NEXT v1 2/6] linux-gen: pktio: implement frame 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Use mtu to implement frame length functions. Various packet IO devices mtu functions need to be still updated to return correct frame length values. Signed-off-by: Petri Savolainen --- /** Email created from pull request 298 (psavol:next-frame-len) ** https://github.com/Linaro/odp/pull/298 ** Patch: https://github.com/Linaro/odp/pull/298.patch ** Base sha: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d ** Merge commit sha: f65f2a6ea63917fca4366f41eeac436d31acec9f **/ platform/linux-generic/odp_packet_io.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 5f7da2635..cf65e7235 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -777,7 +777,7 @@ void sched_cb_pktio_stop_finalize(int pktio_index) unlock_entry(entry); } -uint32_t odp_pktio_mtu(odp_pktio_t hdl) +static inline uint32_t pktio_mtu(odp_pktio_t hdl) { pktio_entry_t *entry; uint32_t ret = 0; @@ -803,6 +803,21 @@ uint32_t odp_pktio_mtu(odp_pktio_t hdl) return ret; } +uint32_t odp_pktio_mtu(odp_pktio_t pktio) +{ + return pktio_mtu(pktio); +} + +uint32_t odp_pktin_maxlen(odp_pktio_t pktio) +{ + return pktio_mtu(pktio); +} + +uint32_t odp_pktout_maxlen(odp_pktio_t pktio) +{ + return pktio_mtu(pktio); +} + int odp_pktio_promisc_mode_set(odp_pktio_t hdl, odp_bool_t enable) { pktio_entry_t *entry; @@ -1089,8 +1104,11 @@ void odp_pktio_print(odp_pktio_t hdl) " mac %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); len += snprintf(&str[len], n - len, - " mtu %" PRIu32 "\n", - odp_pktio_mtu(hdl)); + " pktin maxlen %" PRIu32 "\n", + odp_pktin_maxlen(hdl)); + len += snprintf(&str[len], n - len, + " pktout maxlen %" PRIu32 "\n", + odp_pktout_maxlen(hdl)); len += snprintf(&str[len], n - len, " promisc %s\n", odp_pktio_promisc_mode(hdl) ? "yes" : "no");