From patchwork Tue Mar 31 07:26:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Savolainen, Petri \(Nokia - FI/Espoo\)" X-Patchwork-Id: 46572 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA6382159A for ; Tue, 31 Mar 2015 07:26:25 +0000 (UTC) Received: by labmi15 with SMTP id mi15sf1641439lab.0 for ; Tue, 31 Mar 2015 00:26:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:thread-topic :thread-index:date:message-id:references:in-reply-to:accept-language :content-language:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=QcDVPG0dlYkI3Ln68+Diy9UkIxMnP6zXUbGKLORcraw=; b=ct9EQNVMjY72YHJ6dmLjqMboZQ4ZmTgkgv1w1fNtXuhgOjIhf0/48H9gYFYRiSaQa6 G3gFtzlMZ9KsGiiuPpu+m3mK5nrMRW35k74KmUpznF4RcOIXnTX/gHvzbwWuiIp+aQWv jDMHDrIMhBlm9X78jiLQonWRJrwj3u3+ElWZnWECnvJoTv6nrwfD+O87bt/AHIx0zi1+ 8R+mGBLZM5fJHep6YYdiO/27UQY4iTHbWu+XWmE7Ksaj01ekoHpTVIh5CoDqrRPPYSXR D7OPl9UaPLW9ytpEuMCZxPrbHaCIRzqzD6Q/DqWmBegIxrTVCAlp4uUUDvA8YRXN3/5e zuhg== X-Gm-Message-State: ALoCoQmVPIXmY46BPcg6mNGMJpAJOj3avYvumrocKd8BvOKm8P4OPRnjE4wUAKFwTjnxMT+rMgCt X-Received: by 10.194.71.227 with SMTP id y3mr5533167wju.3.1427786784666; Tue, 31 Mar 2015 00:26:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.201 with SMTP id p9ls485002lae.4.gmail; Tue, 31 Mar 2015 00:26:24 -0700 (PDT) X-Received: by 10.152.219.2 with SMTP id pk2mr29347695lac.107.1427786784488; Tue, 31 Mar 2015 00:26:24 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id xl4si8663984lac.1.2015.03.31.00.26.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2015 00:26:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lahf3 with SMTP id f3so5608007lah.2 for ; Tue, 31 Mar 2015 00:26:24 -0700 (PDT) X-Received: by 10.112.201.231 with SMTP id kd7mr30387782lbc.35.1427786784350; Tue, 31 Mar 2015 00:26:24 -0700 (PDT) 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.57.201 with SMTP id k9csp1628837lbq; Tue, 31 Mar 2015 00:26:23 -0700 (PDT) X-Received: by 10.140.202.144 with SMTP id x138mr47834351qha.14.1427786783022; Tue, 31 Mar 2015 00:26:23 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e133si455028qka.84.2015.03.31.00.26.22; Tue, 31 Mar 2015 00:26:22 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 03B3364EE6; Tue, 31 Mar 2015 07:26:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=HTML_MESSAGE, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5D85164EC9; Tue, 31 Mar 2015 07:26:19 +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 A94F864ED7; Tue, 31 Mar 2015 07:26:17 +0000 (UTC) Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net [93.183.12.32]) by lists.linaro.org (Postfix) with ESMTPS id 7EBC564EC9 for ; Tue, 31 Mar 2015 07:26:16 +0000 (UTC) Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd001.nsn-inter.net (8.14.3/8.14.3) with ESMTP id t2V7QEPW005449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 31 Mar 2015 07:26:14 GMT Received: from DEMUHTC003.nsn-intra.net ([10.159.42.34]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id t2V7QCgj030145 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 31 Mar 2015 09:26:13 +0200 Received: from DEMUMBX012.nsn-intra.net ([169.254.12.25]) by DEMUHTC003.nsn-intra.net ([10.159.42.34]) with mapi id 14.03.0224.002; Tue, 31 Mar 2015 09:26:13 +0200 From: "Savolainen, Petri (Nokia - FI/Espoo)" To: ext Bill Fischofer Thread-Topic: [lng-odp] [RFC 7/8] api: packet_io: added packet io control info Thread-Index: AQHQazKzNyIfDJVfl0OKcgOwPdoS3J02LYfQ Date: Tue, 31 Mar 2015 07:26:13 +0000 Message-ID: References: <1427736187-13113-1-git-send-email-petri.savolainen@nokia.com> <1427736187-13113-7-git-send-email-petri.savolainen@nokia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.159.42.112] MIME-Version: 1.0 X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 15308 X-purgate-ID: 151667::1427786774-00005972-7FE1F926/0/0 Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [RFC 7/8] api: packet_io: added packet io control info X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@nokia.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 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 From: ext Bill Fischofer [mailto:bill.fischofer@linaro.org] Sent: Tuesday, March 31, 2015 12:44 AM To: Savolainen, Petri (Nokia - FI/Espoo) Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [RFC 7/8] api: packet_io: added packet io control info On Mon, Mar 30, 2015 at 12:23 PM, Petri Savolainen > wrote: Structure tells which packet io control operation are permitted on the interface. Some control operations may not be permitted from all interfaces (virtual functions). Signed-off-by: Petri Savolainen > --- include/odp/api/packet_io.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) typedef struct odp_pktio_ctrl_info_t { union { uint32_t all; struct { ...individual flags as bits }; }; } odp_pktio_ctrl_info_t; With “all” user could check “all” vs. “nothing”. It may be useful and could be added. Although, I’m suspecting that the more we add ctrl functions (flags), the more likely it is that a virtual function on NICs/SoCs have some set of these set (vs all zeros). E.g. some NIC could support max_frame size setting per VF (== all ODP pktio interfaces) while others could not (== only on the interface that has the physical function role). Thus a VF interface would see 0x20000000 and a PF 0xF8000000. -Petri diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 7e84fe1..dc76270 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -48,6 +48,24 @@ extern "C" { * Actual MAC address sizes may be different. */ +/** + * Packet IO interface control information + * + * A collection of flags that indicate interface control operation availability. + * A packet IO interface control operation is permitted when the corresponding + * flag is set. Otherwise, the operation is not permitted on the interface. + */ +typedef struct odp_pktio_ctrl_info_t { + struct { + uint32_t mtu:1; /**< Set MTU */ + uint32_t promisc:1; /**< Set promiscuous mode */ + uint32_t max_frame:1; /**< Set maximum frame length */ + uint32_t min_frame:1; /**< Set minimum frame length */ + uint32_t link:1; /**< Set link status*/ + + uint32_t _reserved:27; /**< Reserved for future use */ + } flag; /**< Operation flags */ +} odp_pktio_ctrl_info_t; We've used unions for these sort of flags in things like packet_flags, which I think makes for more convenient manipulation. So better might be: