From patchwork Thu Nov 16 15:00:07 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: 119046 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5690766qgn; Thu, 16 Nov 2017 07:01:32 -0800 (PST) X-Google-Smtp-Source: AGs4zMY9C59ZkgiTqbDth/XQkT1ghdrfmRxDrCcJ/z+jtJg0RTwpVrcL4f3Dqty5V5GBfbieeqfp X-Received: by 10.37.49.68 with SMTP id x65mr982624ybx.261.1510844492202; Thu, 16 Nov 2017 07:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510844492; cv=none; d=google.com; s=arc-20160816; b=OLKMwhbrKelOeA9oCgOd52Nut8yGoGcc8vNz3OgcZ64jF96GEBHskPvV4TzTGr6GTu rTl4bbjO5rmOarWpUpaTTqgNxNFGrxk/nW6a50Qpd94jaXdpUNs6zUlLJW7Z1FshOJ5m HdlkR2x5Cmda/SRu7eb242KvQIzxvx2QC+a+wc06ZJZLsZfp2GM17unkJDtMtu3nZbWz 4PTb9/baS5AOnfofkzYMxftNerWi6p+1sE4ZUYZ7sZxgzWaNG82eVYJKK4KBs2NG/WK/ Em0uu0FDX7N0CvsOS8jfo2jQS5RVLkcX4420ll80T6pqgKpxFbT0TAio3f9DXjshM8hj K4ow== 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=62eq1KoLjzbnjiuoILYd8q35MX1zhcblgoru17HPcwU=; b=qkN9qVTQj/aQ7APVMxFTi8tYJWNilbCTqXQD7IymHIWvMS89MGsv31m3/8gK47AXXX tVXV18m8I1aU17lRFkd/8jFRbQ0P8OOkEsH73hrOh3pfS7r2w8UY7Dv5rgK4k1meSMzY WVVJC15O5e+nkfhq8Cip5DNX2lWhZUNOfwoSAl+vgsrSuTJduVCVJLr2BvCWCx9sm7ri 55iSo42IyMB3nv8IqgVs+F3JMatram/JXmLJEshCc+XrPow0iU0yHc3wow2r0wyseu5T g0r0K66YFxb37CuxHAX0XJtX8riiFkYUiPwe8G82VSR+n1V+pY2jzIgVN/sDwi3Wxne7 T1xw== 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 d17si778963qkb.179.2017.11.16.07.01.31; Thu, 16 Nov 2017 07:01:32 -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 CEDDF6074C; Thu, 16 Nov 2017 15:01:31 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 BF21060765; Thu, 16 Nov 2017 15:00:29 +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 D0F106074A; Thu, 16 Nov 2017 15:00:16 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 7428C60746 for ; Thu, 16 Nov 2017 15:00:15 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward104j.mail.yandex.net (Yandex) with ESMTP id D656142787 for ; Thu, 16 Nov 2017 18:00:13 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mgS2GozCIj-0DxWBKJ3; Thu, 16 Nov 2017 18:00:13 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id H8kylhnNlg-0D3KeQcs; 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:07 +0300 Message-Id: <1510844412-21931-2-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 1/6] api: pktio: add max 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 Added functions to request maximum packet input and output frame lengths. 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 **/ include/odp/api/spec/packet_io.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 6e4f88100..b09c9cfcb 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -970,6 +970,36 @@ int odp_pktio_promisc_mode_set(odp_pktio_t pktio, odp_bool_t enable); int odp_pktio_promisc_mode(odp_pktio_t pktio); /** + * Maximum frame length at packet input + * + * Maximum frame length in bytes that the packet IO interface can receive. + * For Ethernet, the frame length bytes start with MAC addresses and continue + * to the end of the payload. So, Ethernet checksum, interpacket gap + * and preamble bytes are excluded from the length. + * + * @param pktio Packet IO handle. + * + * @return Maximum frame length at packet input + * @retval 0 on failure + */ +uint32_t odp_pktin_maxlen(odp_pktio_t pktio); + +/** + * Maximum frame length at packet output + * + * Maximum frame length in bytes that the packet IO interface can transmit. + * For Ethernet, the frame length bytes start with MAC addresses and continue + * to the end of the payload. So, Ethernet checksum, interpacket gap + * and preamble bytes are excluded from the length. + * + * @param pktio Packet IO handle. + * + * @return Maximum frame length at packet output + * @retval 0 on failure + */ +uint32_t odp_pktout_maxlen(odp_pktio_t pktio); + +/** * Get the default MAC address of a packet IO interface. * * @param pktio Packet IO handle