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 3B9BDA0A0A; Tue, 23 Mar 2021 19:25:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2408F40689; Tue, 23 Mar 2021 19:25:45 +0100 (CET) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id EB79A40143 for ; Tue, 23 Mar 2021 19:25:43 +0100 (CET) Received: by mail-pj1-f53.google.com with SMTP id kk2-20020a17090b4a02b02900c777aa746fso10483609pjb.3 for ; Tue, 23 Mar 2021 11:25:43 -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=13oxalfrLmreMIq8KaDB/MRBrJXDhUGU09o4wrlzmKk=; b=YN/4ZvBYPk5fIpOfwFYJ5pyPJamsqktXbtHK+N1CGQD6MmBJnh/U4gAfFu9Qpht+pm O1gW6n4daA+t2GxEBB3ym/0B+PZ3PE649zuuT91iDu+8s3z/eaTq8A37mrKWaAX5e4Nw bhrWhxL9Ib+kgzGnH4uW8MGJEMevfWVLWGoUgNLWyIKnDgUZtam/P6CFDk6t71K/7OQn q4ABU7Hqz/W9s+mJSzs6GXVTvCsdVa3s69Lg8FaNKjVWELj6qRdIfQQF8J/Cc6qhs8t7 wb/C4fS2lx6cjlx7ofpoIIE35p+Tn5fhSvwAiVpO1DZRNb3Z0Uce9f57T8Dl4fmy+skH KQFw== 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=13oxalfrLmreMIq8KaDB/MRBrJXDhUGU09o4wrlzmKk=; b=R3AeSt/z4FtiX0hxYXU6XCvKihBEDxrozy4I7hk9ZehMyGfgMFemnXjySWDtSoBSLF q2NDMmDgRCPyXImofCeqIpCNQZGQ51B0VkNn7PWbTfu6IHlGLgtjMMYCm78mFlo2RWH9 P8mgxNnFUMG39kcs2Gpf77i8Vuj2U5ifwF9WTv3f1NPYT0KdCFxHUHud2s7TkN8aWhg6 RFyrqZ0M6eTQG03RKovalcBkl7r8+uA/ntvM8jnmw3xTFdiPNtV8yMJAGVo/gghP6RLV NbRxNuYaNVpw7nXFknGC+oJdH3ntaUg8p9/DbW7MM55gObAA3q3fP3DLCLblE25bWCfj AZ7w== X-Gm-Message-State: AOAM532gz8+B58BeyPkLYjRqzhCVDeIlQyBkSNbliqrcuup+ksXpPtqi BvZ7NhVxzSoOEDhMAuinCEJl3w== X-Google-Smtp-Source: ABdhPJy9RGzDr3HwTx9BYAOCYcbDWytI0DC3ypmMTh0PMKitIyHmUhAFJwIew9/DwbzgtFWqB6L8SQ== X-Received: by 2002:a17:90a:bf15:: with SMTP id c21mr5716867pjs.160.1616523943249; Tue, 23 Mar 2021 11:25:43 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id f17sm10115658pgj.86.2021.03.23.11.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:25:42 -0700 (PDT) Date: Tue, 23 Mar 2021 11:25:38 -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: <20210323112538.3dc472fa@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: > +static void > +__writer_flush(struct writer *p) > +{ > + struct rte_mbuf *pkt; > + void *pkt_data; > + size_t n_bytes; > + ssize_t ret; > + uint32_t i; > + > + for (i = 0; i < p->n_pkts; i++) { > + pkt = p->pkts[i]; > + pkt_data = rte_pktmbuf_mtod(pkt, void*); > + n_bytes = rte_pktmbuf_data_len(pkt); > + > + ret = write(p->params.fd, pkt_data, n_bytes); > + if (ret < 0) > + break; > + } > + > + TRACE("[FD %u] %u packets out\n", > + (uint32_t)p->params.fd, > + p->n_pkts); > + > + for (i = 0; i < p->n_pkts; i++) > + rte_pktmbuf_free(p->pkts[i]); Loop can be replaced by: rte_pktmbuf_free_bulk(p->pkts, p->n_pkts);