From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by dpdk.org (Postfix) with ESMTP id 989884C77 for ; Thu, 1 Mar 2018 00:45:25 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id z10so1665516pfh.13 for ; Wed, 28 Feb 2018 15:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PE9qAysObTo00saHAen1QntogQmwO23VV6GGmegE0ZY=; b=rUOPrBbv/01mIeDXki0lZbBMSiXUrVgJgNgz6t3a8Pu7Ww4igNySRVXl8b498lbcm9 d3G1W/PS+lt+zeOWZG/Oe59LWBFp1oBC3jMW4A4yvstA96gorTGv0iPmDq3ucgwxNCAu kQVpB0r9EOEQGMzlJsn0CRCHT3Lkf5FAHsdZ6Qw35SeJUoAEnyWYWmVf7GUmrOXJhPP3 xkVVwCRu/9fjL2fQ4ri8GXXpFAKROPb/5VqF3rR9aFo7pgBXMtTvciGLgB8+Yv2MZrkj zF0DyIIa3g5A61cCJ6UazQZEEOJwlzFqdfNsKtpCKXKCHe+MwXMgBVcVobmvonOnfwNx UhlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PE9qAysObTo00saHAen1QntogQmwO23VV6GGmegE0ZY=; b=aWGhqfwGY5mkHTj5ySFtCCoOLmAKo1zRNGHiBihL70IG/Pf4N4eoWlmvOwEWwGBfT5 Xgb34sz8tHxOLbtuYD4XZMv4VjIWYcdMoeib+UpUeYUIsZ+FOKaeRjwp2JGrNyqjqj8j iep0ryug9NIi5/MncobkRXbcevwGmV8iTk+6gp5AQyd92U+aqurPLtcSqzMi9FrkyVFE 9lW9re73by0ulXe2G7GYr4PQTV7afWwsVMP+u98s5qurXo3/0bzn3fM1j07YP3Hj4u5A Z/ew85Pxup+91UUo7r+bpIgpsq9/OyJwGg+P9VgtKFh0dQtFPGhT+b0arnSTOr+ZGJWl ntCQ== X-Gm-Message-State: APf1xPBRWbsjntgsIEybdlldBXq5lWldrwhfeV8pjdRDa1ndu5wuWnzn P+PSocqX5NTCTIKaEM9tJIGSqA== X-Google-Smtp-Source: AH8x224pcYBgelb2xULn0L70eHn5CgpUF1xOuiDY6IG+nmprCYCYD7tXoE5II5TZci0/b7Iwn209Kw== X-Received: by 10.99.127.80 with SMTP id p16mr15581694pgn.144.1519861524700; Wed, 28 Feb 2018 15:45:24 -0800 (PST) Received: from xeon-e3 (204-195-71-95.wavecable.com. [204.195.71.95]) by smtp.gmail.com with ESMTPSA id 76sm6158579pfm.124.2018.02.28.15.45.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 15:45:24 -0800 (PST) Date: Wed, 28 Feb 2018 15:45:22 -0800 From: Stephen Hemminger To: Qi Zhang Cc: dev@dpdk.org, magnus.karlsson@intei.com, bjorn.topel@intel.com Message-ID: <20180228154522.2fa43379@xeon-e3> In-Reply-To: <20180227093306.23854-2-qi.z.zhang@intel.com> References: <20180227093306.23854-1-qi.z.zhang@intel.com> <20180227093306.23854-2-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC 1/7] net/af_xdp: new PMD driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 23:45:25 -0000 On Tue, 27 Feb 2018 17:33:00 +0800 Qi Zhang wrote: > + > +static uint16_t > +eth_af_xdp_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > +{ > + struct pmd_internals *internals = queue; > + struct xdp_queue *rxq = &internals->rx; > + struct rte_mbuf *mbuf; > + unsigned long dropped = 0; > + unsigned long rx_bytes = 0; > + uint16_t count = 0; > + > + nb_pkts = nb_pkts < ETH_AF_XDP_RX_BATCH_SIZE ? > + nb_pkts : ETH_AF_XDP_RX_BATCH_SIZE; > + Put declarations first. Why not iterate if nb_pkts is huge? > + struct xdp_desc descs[ETH_AF_XDP_RX_BATCH_SIZE]; > + void *indexes[ETH_AF_XDP_RX_BATCH_SIZE]; > + int rcvd, i; > + /* fill rx ring */ > + if (rxq->num_free >= ETH_AF_XDP_RX_BATCH_SIZE) { Blank line after declarations before code please.