From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 448B5A0A0A; Tue, 23 Mar 2021 19:29:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27A664014D; Tue, 23 Mar 2021 19:29:19 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 79F3940143 for ; Tue, 23 Mar 2021 19:29:18 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id ot17-20020a17090b3b51b0290109c9ac3c34so10294691pjb.4 for ; Tue, 23 Mar 2021 11:29:18 -0700 (PDT) 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=KvgrUf8Etb5jlVo3cdNvXbaePU2O32Rtm1CGMAUSv88=; b=ca/OPSfY7kQgp7UmC6EaiHIcxrum9kHdshYG/a3Ng1EF6L+SfZY5v4tNx+pOz/dqwE Kkls5p/XvyPLw/3vW6EOwu8AzCR53mogkBzlWxEvgloPsF52KrOftGrPkVwQrlIAHZRU g9Iy2vTDQRXc0f83dO3p0sGdSCsWtnzC3IYQ3ynOq3Rcfany1C77lwFvemtGdayIrI12 Ed1S45FgMSzYJW9UOF9wIluZssv9WsRgLQ1l8doTAmlOphJyWfJT74afWXTL5XzZWjzq Jehg4A5d6OjCcM8v0a1o4mEx0yr3dNr0x/14SxAq3KwuCLZjf2tWgvLK+euZh9R7bh3h gGhA== 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=KvgrUf8Etb5jlVo3cdNvXbaePU2O32Rtm1CGMAUSv88=; b=L+0TpFyAg3X3My8/FdwhIZINfUlaqT7psPBmDSGh8yExjNN61cn07RXdHXToPdbLjx wQXOlHsFOUXATfF4uO9Nbu1a1y7fZIYjJsjTRbD5ihrgthJmzO/ES3njhULPGvytDufw wxRzT0ZzjKz1uEr+gV8y5UrPU6GBO0ld0P1Qgs6oKd8jQEgiBxFwTOf4LpUXIh76EQp7 ajnvvtNVn68T8rbVgl0fvzYRDb6Dr2hB+iQjHrJd+WwQzBbqGFx7Yria8JpvUZYl0cfH DbEB9xfd2O61rjjurq3JCeBVgUUyMiLlTiTm0nxeRMCB2XoIpCocPeu5MpE/gFxvcKJR 3xyg== X-Gm-Message-State: AOAM532CQ+COknExo4ZDM6upWw49LuMGgIusKfcMd6hQ0N9/6wz6PWDk isLo0DVidI0ZHKF2Ja7aC2IsAg== X-Google-Smtp-Source: ABdhPJwXh652z84MxtQJNb4Yq3zg1Sc+mACyLfUucr9X4zKdBidK1skB3Z7m7pba1cHtH/2lUcBfgA== X-Received: by 2002:a17:90a:7186:: with SMTP id i6mr4873344pjk.191.1616524157718; Tue, 23 Mar 2021 11:29:17 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id z8sm3268377pjd.0.2021.03.23.11.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:29:17 -0700 (PDT) Date: Tue, 23 Mar 2021 11:29:05 -0700 From: Stephen Hemminger To: Venkata Suresh Kumar P Cc: dev@dpdk.org, cristian.dumitrescu@intel.com, churchill.khangar@intel.com, yogesh.jangra@intel.com Message-ID: <20210323112905.22cc7537@hermes.local> In-Reply-To: <1616155326-2639-1-git-send-email-venkata.suresh.kumar.p@intel.com> References: <1616155326-2639-1-git-send-email-venkata.suresh.kumar.p@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] port: add file descriptor SWX port X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 19 Mar 2021 08:02:06 -0400 Venkata Suresh Kumar P wrote: > +/* > + * FD Reader > + */ > +struct reader { > + struct { > + int fd; > + uint32_t mtu; > + uint32_t burst_size; > + struct rte_mempool *mempool; > + } params; > + > + struct rte_swx_port_in_stats stats; > + struct rte_mbuf **pkts; > + uint32_t n_pkts; > + uint32_t pos; > +}; > + You could save one allocation (and get better cache locality) by using a dynamic array here. struct reader { struct { int fd; uint32_t mtu; uint32_t burst_size; struct rte_mempool *mempool; } params; struct rte_swx_port_in_stats stats; uint32_t n_pkts; uint32_t pos; struct rte_mbuf *pkts[]; }; Then change the allocation to size it based on number of packets.