From patchwork Tue Oct 10 09:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 115365 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp3279730edb; Tue, 10 Oct 2017 02:02:43 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBr2mBDCC4Y6U4Ay58192Yem2BEjNfu7vOQtdY8DxZW5/HJbqbKxju2Q1JEkOPb7kxMOGmS X-Received: by 10.107.3.147 with SMTP id e19mr14882274ioi.39.1507626163727; Tue, 10 Oct 2017 02:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507626163; cv=none; d=google.com; s=arc-20160816; b=xQhEoFCshYuIGzZhIjEsp4bXwXPJTdyXST4JvrJ4EO9do6x9ifZoWpN04uCCce0vtC SWQce9Z0zuILrNzd/bRH9dsq+OvzpqBeqnizEy2WRDdoRK/QGSvfMD3zXrMivKmaLtqR bBTVtxMYzlNV/byisqMP+2UUooruR1yE2WCHYmJpe8GqyGfYgdMZ2gXmaezhj4nYroUw giKF2MN/93UTRxjNKl0FoD5JQNpbazXKBg3J5vC8NJHfPoY26tRYf9ac1HYQgYMjXMGa 1IlYJMVokDRN6wSnxR173xqsQZNOzmYG5NoFxv9wVmHqnnJZ7+zodUgreKv/cW4sUM3g /USQ== 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 :content-transfer-encoding:mime-version:github-pr-num:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=nudtBuYFvNPBg3IpdqkJKnLKx8Q3HBZFDHtlHxBgK9A=; b=JSZ5Rd+D0ntusfEOWreOUyeqScZ88RfDpQzokHXQl1VMHBn4T22nKEeQ9ZhQ/ygZzm TsHbhutLYME68/vxD/rTrbLzJryWO5ROkTv+SGBN5uVovMm/7Xn5PoaZ2KXN1JxIQ6z3 4MINGMO1OkiZ1vggR2HkOAQbXJ3Hd5Bqvf+6ovaAEqWmRmynDoP1n2i6U6pQuaW/l9Rd mrp4SbNfvOqTv5Aoiq3+DT2VI6eQD7+rO1rBUT+7oFtPzaFUnZBDuqcbVywqDdMw9Mtp szSUNqE9I3MHNZKPSvPeaw0ssBzWcH64RZqutTF7H7CYMthZBxytPDXAc0tItvcIm0f8 Laww== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x13si8746780iti.107.2017.10.10.02.02.43; Tue, 10 Oct 2017 02:02:43 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2C3E160CDC; Tue, 10 Oct 2017 09:02:43 +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 E647060C2C; Tue, 10 Oct 2017 09:01:00 +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 2642D60C03; Tue, 10 Oct 2017 09:00:48 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id C5A3E609DB for ; Tue, 10 Oct 2017 09:00:40 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 011924444117 for ; Tue, 10 Oct 2017 12:00:39 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Pncji5cG5Q-0cvOXiAx; Tue, 10 Oct 2017 12:00:38 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id drzNSBeNeN-0cRqgK32; Tue, 10 Oct 2017 12:00:38 +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: Tue, 10 Oct 2017 12:00:09 +0300 Message-Id: <1507626011-15870-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507626011-15870-1-git-send-email-odpbot@yandex.ru> References: <1507626011-15870-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 203 MIME-Version: 1.0 Subject: [lng-odp] [PATCH API-NEXT v5 1/3] api: packet_io: add MAC address set function 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: Bogdan Pricope Add support for setting default MAC address of a packet IO interface and for reporting availability of this operation. Signed-off-by: Bogdan Pricope --- /** Email created from pull request 203 (bogdanPricope:set_mac_pr) ** https://github.com/Linaro/odp/pull/203 ** Patch: https://github.com/Linaro/odp/pull/203.patch ** Base sha: bf803098eb1518dfb9e719071256fe22700b8c72 ** Merge commit sha: 9741b2bb193f1cb28f8dd4bf382bc598e1dbd5ef **/ include/odp/api/spec/packet_io.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index b56a5205d..52af646a6 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -482,6 +482,8 @@ typedef union odp_pktio_set_op_t { struct { /** Promiscuous mode */ uint32_t promisc_mode : 1; + /** MAC address */ + uint32_t mac_addr : 1; } op; /** All bits of the bit field structure. * This field can be used to set/clear all flags, or bitwise @@ -979,6 +981,22 @@ int odp_pktio_promisc_mode(odp_pktio_t pktio); int odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, int size); /** + * Set the default MAC address of a packet IO interface. + * + * Support of this operation on a packet IO interface is reported + * through ‘mac_addr’ set operation capability. + * + * @param pktio Packet IO handle + * @param mac_addr MAC address to be set as default address + * @param size Size of the MAC address + * + * @return 0 on success + * @retval <0 on failure + */ +int odp_pktio_mac_addr_set(odp_pktio_t pktio, const void *mac_addr, + int size); + +/** * Setup per-port default class-of-service. * * @param[in] pktio Ingress port pktio handle.