From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 269DDA0597; Fri, 10 Apr 2020 01:05:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0618D1C43D; Fri, 10 Apr 2020 01:05:11 +0200 (CEST) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by dpdk.org (Postfix) with ESMTP id 8300F1C2F1 for ; Fri, 10 Apr 2020 01:05:10 +0200 (CEST) Received: by mail-lj1-f194.google.com with SMTP id n17so289786lji.8 for ; Thu, 09 Apr 2020 16:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Vf5P35jcsHhe3fhn1A2ngmeU3EdnQsY/Z2rdUXY2KaA=; b=AE5mikadmcLVqGUsf07KSN3bPyiRTJD12/9KONYdP0fNk6PvcRGa0sbU+UbHg6MLRg ihWs36fcTyumVXJY6weYufonM3oQlxMMteuFG8vIFRLMh6yzDMctfQWP5OkiOqK4tHDm XLD1kgnei5jh1wTbqJgR4mod6apZO+RlA49RDYxavp6vv7kvTPbJ8lmk5BGtFPeh7TYj 9qcJyyQzicXGyCLl/M8YbPSCnSTaP3Do+jECuudKPTSrCJBnsSxLN0jJIbay+WDoXTGV EDaH2piQipK7XvMW4lf0s/MAoereeAHTbf3xjPGMreSF5EAbf0ELyo8PsSeMtIfgg5fG 32kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Vf5P35jcsHhe3fhn1A2ngmeU3EdnQsY/Z2rdUXY2KaA=; b=PioTLQXRUP5DmwlgdD8Ie4nk3SRZYiasyMJEtKB/hylj/Lb3LLZ5u9anYxXYmM9Pki 9Wj1o7A1XsrYLE1FSJDsl/s2QO0ScccA18gReZlDMPVMOOThdzxVVX1h+DNVANZcJ5B7 /bm4ZX2Olqvt+ydebfjzPxnVcN7YGMjEl+54sIBQCeyb7MV5AEy4n2J5IYVOyy0RyzQ5 zC9/tLp1nz4PfPMl/X3TnxPf112DzXBqMefGHXazbi1nan8X5WzfLakLhPtoMzpLhY3N R7M+0qH+Q73KN8bEr6z7KOmP8Kd2/Mq9fghaU3bt2zfBjOHjy+t5CPvnOYgbOPqS2+J4 jQ8A== X-Gm-Message-State: AGi0PubdSHUITdfpFRaRrSValrvlKjd9RKDVQ0d2y0Z+Cr1Y/qt7556w 9tW2jnJ93pPeRflC9hwPwCVy3UVweek= X-Google-Smtp-Source: APiQypKACT713krI5vUmRIkd9pNIk+bC36VAoz2nUSDJyya1Gb9MWdfWa76YB3EaAg5vQ9Gxr1kQHw== X-Received: by 2002:a2e:858d:: with SMTP id b13mr1185908lji.227.1586473509924; Thu, 09 Apr 2020 16:05:09 -0700 (PDT) Received: from [192.168.8.100] (user-5-173-33-152.play-internet.pl. [5.173.33.152]) by smtp.gmail.com with ESMTPSA id a26sm95153ljn.22.2020.04.09.16.05.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2020 16:05:09 -0700 (PDT) To: dev@dpdk.org References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-17-jerinj@marvell.com> From: Andrzej Ostruszka Message-ID: <5546f4cb-6ee1-1148-716f-56101be1e7f6@semihalf.com> Date: Fri, 10 Apr 2020 01:05:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200405085613.1336841-17-jerinj@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 16/29] node: add ethdev Rx node 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 4/5/20 10:56 AM, jerinj@marvell.com wrote: > From: Nithin Dabilpuram > > Add source rte_node ethdev_rx process function and register > it. This node is a source node that will be called periodically > and when called, performs rte_eth_rx_burst() on a specific > (port, queue) pair and enqueue them as stream of objects to > next node. > > Signed-off-by: Nithin Dabilpuram > Signed-off-by: Pavan Nikhilesh > Signed-off-by: Kiran Kumar K [...] > +/* Callback for soft ptype parsing */ > +static uint16_t > +eth_pkt_parse_cb(uint16_t port, uint16_t queue, struct rte_mbuf **mbufs, > + uint16_t nb_pkts, uint16_t max_pkts, void *user_param) > +{ > + struct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3; > + struct rte_ether_hdr *eth_hdr; > + uint16_t etype, n_left; > + struct rte_mbuf **pkts; > + > + RTE_SET_USED(port); > + RTE_SET_USED(queue); > + RTE_SET_USED(max_pkts); > + RTE_SET_USED(user_param); > + > + pkts = mbufs; > + n_left = nb_pkts; > + while (n_left >= 12) { > + > + /* Prefetch next-next mbufs */ > + rte_prefetch0(pkts[8]); > + rte_prefetch0(pkts[9]); > + rte_prefetch0(pkts[10]); > + rte_prefetch0(pkts[11]); > + > + /* Prefetch next mbuf data */ > + rte_prefetch0( > + rte_pktmbuf_mtod(pkts[4], struct rte_ether_hdr *)); > + rte_prefetch0( > + rte_pktmbuf_mtod(pkts[5], struct rte_ether_hdr *)); > + rte_prefetch0( > + rte_pktmbuf_mtod(pkts[6], struct rte_ether_hdr *)); > + rte_prefetch0( > + rte_pktmbuf_mtod(pkts[7], struct rte_ether_hdr *)); I know this is software fallback only (and not likely to be used) but is this aggressive prefetching always beneficial? I guess you tested this on octeon and it works, but if this is supposed to be standard RX node then maybe this is not always good? On the other hand if other platforms find that detrimental they can submit some improvements later :) > + > + mbuf0 = pkts[0]; > + mbuf1 = pkts[1]; > + mbuf2 = pkts[2]; > + mbuf3 = pkts[3]; > + pkts += 4; > + n_left -= 4; > + > + /* Extract ptype of mbuf0 */ > + eth_hdr = rte_pktmbuf_mtod(mbuf0, struct rte_ether_hdr *); > + etype = eth_hdr->ether_type; > + mbuf0->packet_type = l3_ptype(etype, 0); > + > + /* Extract ptype of mbuf1 */ > + eth_hdr = rte_pktmbuf_mtod(mbuf1, struct rte_ether_hdr *); > + etype = eth_hdr->ether_type; > + mbuf1->packet_type = l3_ptype(etype, 0); > + > + /* Extract ptype of mbuf2 */ > + eth_hdr = rte_pktmbuf_mtod(mbuf2, struct rte_ether_hdr *); > + etype = eth_hdr->ether_type; > + mbuf2->packet_type = l3_ptype(etype, 0); > + > + /* Extract ptype of mbuf3 */ > + eth_hdr = rte_pktmbuf_mtod(mbuf3, struct rte_ether_hdr *); > + etype = eth_hdr->ether_type; > + mbuf3->packet_type = l3_ptype(etype, 0); > + } > + > + while (n_left > 0) { > + mbuf0 = pkts[0]; > + > + pkts += 1; > + n_left -= 1; > + > + /* Extract ptype of mbuf0 */ > + eth_hdr = rte_pktmbuf_mtod(mbuf0, struct rte_ether_hdr *); > + etype = eth_hdr->ether_type; > + mbuf0->packet_type = l3_ptype(etype, 0); > + } > + > + return nb_pkts; > +} [...] With regards Andrzej Ostruszka