From patchwork Mon Mar 21 10:14:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 64111 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1294961lbc; Mon, 21 Mar 2016 03:15:00 -0700 (PDT) X-Received: by 10.50.80.74 with SMTP id p10mr11948137igx.46.1458555300225; Mon, 21 Mar 2016 03:15:00 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j67si13877030iof.74.2016.03.21.03.14.59; Mon, 21 Mar 2016 03:15:00 -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 Received: by lists.linaro.org (Postfix, from userid 109) id 5EA6661745; Mon, 21 Mar 2016 10:14:59 +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 F08A1616D7; Mon, 21 Mar 2016 10:14:53 +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 2F469616E2; Mon, 21 Mar 2016 10:14:52 +0000 (UTC) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by lists.linaro.org (Postfix) with ESMTPS id 040AF616AA for ; Mon, 21 Mar 2016 10:14:51 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id k12so123273833lbb.1 for ; Mon, 21 Mar 2016 03:14:50 -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=RMzItwY72wQfEkDxgZtrcqewgbaZGqdFoy2m5/0Mcww=; b=DyA+lyjC91AZaJ5A0+hhojWf/GnQ8HVMsxfoPK+4BTDPQON2Rrzj585D0Z+Eu59CCz M8XgZSEv/YMqFOe0kHIrwsL4oKNtJVJ46T4rGGp7+5BTqvYucgvuYG+2DJg+ZysPAfbh g9DtrXX/F7SXTaXQ91w+TNZGe/WISgZoJOrfCXrSjcOPdES6Y+cSK+5FEOEMidxhIzL4 Qd8nR43YlIupR9eC7OS7df9DbytAnXqIZFeLGMQvnl7muNapA2cffn2XCcbb/qTDbXwJ c9oTC+Q7G7j4yBqTWvpTomKhVJLAszLcNRr7tQldp5Qu0YgrGucjAEI+mUD5Y6fZbvvU qjbw== X-Gm-Message-State: AD7BkJJNT+si3HLXyp6eHL954RSzc0s9pTLWMKPuDZetk4rntPeWY2eoK49VfNWo49NbGxlj5vo= X-Received: by 10.112.150.165 with SMTP id uj5mr10671233lbb.95.1458555289571; Mon, 21 Mar 2016 03:14:49 -0700 (PDT) Received: from localhost.localdomain (ppp95-165-125-64.pppoe.spdop.ru. [95.165.125.64]) by smtp.gmail.com with ESMTPSA id h8sm4363611lfg.10.2016.03.21.03.14.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Mar 2016 03:14:48 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 21 Mar 2016 13:14:45 +0300 Message-Id: <1458555285-20317-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] api: pktio api to enable/disable offload features 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" Introduce pktio offload functions api to enable and disable such offload features like rx and tx check sum, tso, gro, lro and etc.. Getting state of that features if needed might be retrieved with odp_pktio_print(). Signed-off-by: Maxim Uvarov --- include/odp/api/spec/packet_io.h | 1 + include/odp/api/spec/packet_io_offload.h | 140 +++++++++++++++++++++++++++++++ platform/Makefile.inc | 1 + 3 files changed, 142 insertions(+) create mode 100644 include/odp/api/spec/packet_io_offload.h diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 6fe2cac..b237a58 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -18,6 +18,7 @@ extern "C" { #endif +#include #include #include diff --git a/include/odp/api/spec/packet_io_offload.h b/include/odp/api/spec/packet_io_offload.h new file mode 100644 index 0000000..ba19af6 --- /dev/null +++ b/include/odp/api/spec/packet_io_offload.h @@ -0,0 +1,140 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP Packet IO + */ + +#ifndef ODP_API_PACKET_IO_OFFLOAD_H_ +#define ODP_API_PACKET_IO_OFFLOAD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odp_packet_io + * @{ + */ + +/** + * Specifies whether RX checksumming should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_rx_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether TX checksumming should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_tx_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether TCP segmentation offload should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_tso_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether UDP fragmentation offload should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_ufo_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether generic segmentation offload should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_gso_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether generic receive offload should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_gro_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether large receive offload should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_lro_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether RX VLAN acceleration should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_rxvlan_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * Specifies whether RX VLAN acceleration should be enabled. + * + * @param[in] pktio Ingress port pktio handle. + * @param[in] enable 1 - enable. + * 0 - disable. + * + * @retval 0 on success + * @retval !0 on failure + */ +int odp_pktio_offload_txvlan_set(odp_pktio_t pktio, odp_bool_t enable); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 62375a6..3138de8 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -41,6 +41,7 @@ odpapispecinclude_HEADERS = \ $(top_srcdir)/include/odp/api/spec/packet.h \ $(top_srcdir)/include/odp/api/spec/packet_flags.h \ $(top_srcdir)/include/odp/api/spec/packet_io.h \ + $(top_srcdir)/include/odp/api/spec/packet_io_offload.h \ $(top_srcdir)/include/odp/api/spec/packet_io_stats.h \ $(top_srcdir)/include/odp/api/spec/pool.h \ $(top_srcdir)/include/odp/api/spec/queue.h \