From patchwork Tue Mar 31 06:48:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Savolainen, Petri \(Nokia - FI/Espoo\)" X-Patchwork-Id: 46567 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B8A1215A7 for ; Tue, 31 Mar 2015 06:49:14 +0000 (UTC) Received: by wgtj4 with SMTP id j4sf1532514wgt.0 for ; Mon, 30 Mar 2015 23:49:13 -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=pcNponmFRqMkpl1fHgDpIkbeYrsjI24TfSx5ddX2neU=; b=UcnCB7/81d7gH0BDSlzKZwvVcGvR3NxJahL7Lm3iyw4A1GGImDwhuAd0VnMdR1F6aO bpKyDLLBrxPfrWPQThwNlHZx4KC4pM1L4dv3dzhWQKidSCnAGyBiwBen7461IkCP8fJ9 6GyhUXt79yN8EW89IRJsqn9aAOOc1FXDnDQe4PJrQHoyK7IBLbRwF5zn+HtoCX3KvdkH JuknKjt41pL7K/81l/BjzVplfBHK7eN1XtLI181WA4ttNO6nQ+nF//vTLbK33pJwSNOs NZBkUk05eEk4M8agFAq3n22iuHeQmIix9bkLsO24ebkmVqX0V0+79bBMUZvT73htXRvw JdXg== X-Gm-Message-State: ALoCoQnBk5LZIfwUWcw/on++isVZB80MGfpihuVTyYL8OoOa6P5QP6kh/5bFfBIIu0YSfcoN8gdL X-Received: by 10.112.151.232 with SMTP id ut8mr452856lbb.9.1427784553813; Mon, 30 Mar 2015 23:49:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.36 with SMTP id yf4ls662618lab.43.gmail; Mon, 30 Mar 2015 23:49:13 -0700 (PDT) X-Received: by 10.112.42.164 with SMTP id p4mr29258839lbl.119.1427784553553; Mon, 30 Mar 2015 23:49:13 -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 rs2si3541094lbb.125.2015.03.30.23.49.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2015 23:49:13 -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 lagg8 with SMTP id g8so5447396lag.1 for ; Mon, 30 Mar 2015 23:49:13 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr3118706lbb.41.1427784553091; Mon, 30 Mar 2015 23:49:13 -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 k9csp1611535lbq; Mon, 30 Mar 2015 23:49:12 -0700 (PDT) X-Received: by 10.140.232.135 with SMTP id d129mr47827198qhc.90.1427784551668; Mon, 30 Mar 2015 23:49:11 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 82si12911839qky.66.2015.03.30.23.49.10; Mon, 30 Mar 2015 23:49:11 -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 6289464EE9; Tue, 31 Mar 2015 06:49:10 +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 BD92B64E6D; Tue, 31 Mar 2015 06:49:05 +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 B1A9C64EE3; Tue, 31 Mar 2015 06:49:04 +0000 (UTC) Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net [93.183.12.32]) by lists.linaro.org (Postfix) with ESMTPS id 80A6C64E6D for ; Tue, 31 Mar 2015 06:49:03 +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 t2V6n0nt024509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 31 Mar 2015 06:49:01 GMT Received: from DEMUHTC004.nsn-intra.net ([10.159.42.35]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id t2V6n0cg025898 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 31 Mar 2015 08:49:00 +0200 Received: from DEMUMBX012.nsn-intra.net ([169.254.12.25]) by DEMUHTC004.nsn-intra.net ([10.159.42.35]) with mapi id 14.03.0224.002; Tue, 31 Mar 2015 08:48:59 +0200 From: "Savolainen, Petri (Nokia - FI/Espoo)" To: ext Bill Fischofer Thread-Topic: [lng-odp] [RFC 4/8] api: packet_io: added odp_pktio_param_t Thread-Index: AQHQaysCKDjsd5mF4ke8W8ebPIUpmp02Jd0Q Date: Tue, 31 Mar 2015 06:48:59 +0000 Message-ID: References: <1427736187-13113-1-git-send-email-petri.savolainen@nokia.com> <1427736187-13113-4-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: 14832 X-purgate-ID: 151667::1427784541-00005972-B408CCDB/0/0 Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [RFC 4/8] api: packet_io: added odp_pktio_param_t 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: Monday, March 30, 2015 11:49 PM To: Savolainen, Petri (Nokia - FI/Espoo) Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [RFC 4/8] api: packet_io: added odp_pktio_param_t On Mon, Mar 30, 2015 at 12:23 PM, Petri Savolainen > wrote: Packet IO interface level parameters are needed e.g. to select input mode. User must select and use one input mode (sched, poll or recv) per pktio interface. Signed-off-by: Petri Savolainen > --- example/generator/odp_generator.c | 6 +++- example/ipsec/odp_ipsec.c | 11 +++++- example/l2fwd/odp_l2fwd.c | 10 +++++- example/packet/odp_pktio.c | 19 +++++++++- include/odp/api/packet_io.h | 28 ++++++++++++++- .../linux-generic/include/odp_packet_io_internal.h | 1 + platform/linux-generic/odp_packet_io.c | 10 ++++-- .../classification/odp_classification_tests.c | 6 +++- test/validation/odp_pktio.c | 41 +++++++++++++++------- 9 files changed, 111 insertions(+), 21 deletions(-) index 61af855..6f638c6 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -122,9 +122,26 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool, int mode) odp_queue_param_t qparam; char inq_name[ODP_QUEUE_NAME_LEN]; int ret; + odp_pktio_param_t pktio_param; + + memset(&pktio_param, 0, sizeof(pktio_param)); + + switch (mode) { + case APPL_MODE_PKT_BURST: + pktio_param.in_mode = ODP_PKTIN_MODE_RECV; + break; + case APPL_MODE_PKT_QUEUE: + pktio_param.in_mode = ODP_PKTIN_MODE_POLL; + break; + case APPL_MODE_PKT_SCHED: + pktio_param.in_mode = ODP_PKTIN_MODE_SCHED; + break; + default: + EXAMPLE_ABORT("invalid mode %d\n", mode); + } Since you're standardizing terms in this patch series, why not APPL_MODE_PKT_RECV to pair with ODP_PKTIN_MODE_RECV, etc.? Having BURST ==> RECV and QUEUE ==> POLL seems non-intuitive. APPL_MODE_XXX is what the application have used for mode selection. It would topic of another patch to change the application structure. This patch just updates the API. -Petri