From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 6086AA059B;
	Fri, 10 Apr 2020 09:00:37 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 48FD11C2E6;
	Fri, 10 Apr 2020 09:00:36 +0200 (CEST)
Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com
 [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id E18561C2BC
 for <dev@dpdk.org>; Fri, 10 Apr 2020 09:00:34 +0200 (CEST)
Received: from pps.filterd (m0045849.ppops.net [127.0.0.1])
 by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id
 03A6totO012656; Fri, 10 Apr 2020 00:00:33 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;
 h=date : from : to :
 cc : subject : message-id : references : content-type : in-reply-to :
 mime-version; s=pfpt0818; bh=mS0gydO9YK1GInjvoAAZ7zBowtQpqY7NXux5n4e23Tk=;
 b=OlxOvnPMYGwDrJG5oWCxNTeAOTUyKr2aITXn7oiCVivZuvJ3xFLE7y3QszkChxc23tGH
 bKBSLCeMl0At8t+g1AP27OXhZQ3liK1GsUTw6ZmLXupMqQKw/F05+8QC6EzjNBlO7U7r
 vxEB5gvRQiJS47uUXi0h9MTN6ikikdrFKXPiZ7UN16gcOYPzhcxjfpFk348G3YkCWEYE
 O9WYeKwN+cJ/hKQQVwBLTktN7EOoYhFvuT5hEM8t0Q+eR+DIRGdPGb+6+gPuUJJvmTki
 z1RDxwneOjJRnnGCCA8W9qYlBpFLoQSdsPIrblYi/ZFOmGPeXVmI7+zH4BJ1B2b9ydaP EQ== 
Received: from sc-exch02.marvell.com ([199.233.58.182])
 by mx0a-0016f401.pphosted.com with ESMTP id 3091jwm5k9-12
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);
 Fri, 10 Apr 2020 00:00:33 -0700
Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com
 (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 10 Apr
 2020 00:00:30 -0700
Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170)
 by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id
 15.0.1497.2 via Frontend Transport; Fri, 10 Apr 2020 00:00:30 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BY0+92KwpI0gidF0Lw8Vd9iA6XaixOc6vhDCsvAnlrDAoD1JCbrNwZFfj94LvgIklKVVXkoLHnpnmaaMEdO29pgbbIwPsPchovklN6L79SMP54SV5ytxvIhwLmmZd9/tNdjZvS4j0J5GcyzNRb4xDbnA+bL1LbG9jlRP0sa1cZGveiBrkNugc+knnYgaQojEIS0UGoc5PhUQncZJ0PlOYLQqNHKydEBO5XcCC9YQLb6l5kdAywds1GEPC9eVe7r2/jvvBmmzxMXorg0tcW1DMjjDAewX515wUVV+j1mta/1YtUIVwdQ+WKpXSPF1cuVHD3ld5PcZmb7GBd8Lsj2BGA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mS0gydO9YK1GInjvoAAZ7zBowtQpqY7NXux5n4e23Tk=;
 b=IUoAG+lYaLFxNnc2z4UXycwZ0uazu3NXhzP2uW7fTQ5KpMGFnN+YnlHFOS1xtZa5wgfKe4NKwZg6SRzfZMYNkG3uH+D4EGFZ8FGX7oUwPl6bfiwvN/KGSnqz8sf+qJhiiBiqkgGzHS6J5ZFh0yGzA6AQWFjJH8LzYYMe5Q7CcKKVDsVkgPPO8oJDBqNZyIOq7Be1s98I3YHCJBEhT753S0i/0XwzizEkEgiovkmZy9nHrGw267CjWBYSspJx5J6L/MPLIUUGg/QrsnZZbB2iiWevCoC68IO244uki4NWMQSbWTaZ8BuoJymQlpvp+UK9pAOTsDvfRIm1LCQJsQSvVg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com;
 dkim=pass header.d=marvell.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mS0gydO9YK1GInjvoAAZ7zBowtQpqY7NXux5n4e23Tk=;
 b=ihRFJsRqBD9pdrd1whBRgIdVjPjVlNRPTPDYNfwShzm9RYaQ6KQYDZGYXTZ0uYcNit5b021RbJKsNMau/Ivy3yHeJn2uMnIShiz8VgEaFr7ZVJAzUluNWo0I86hI2a1CKna7elxPG9HVV9s1400vtm0chG5VKXpwgKqV7cnjYC8=
Received: from MWHPR1801MB2063.namprd18.prod.outlook.com
 (2603:10b6:301:6a::11) by MWHPR1801MB2032.namprd18.prod.outlook.com
 (2603:10b6:301:62::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.22; Fri, 10 Apr
 2020 07:00:27 +0000
Received: from MWHPR1801MB2063.namprd18.prod.outlook.com
 ([fe80::380f:5ca1:ce60:6586]) by MWHPR1801MB2063.namprd18.prod.outlook.com
 ([fe80::380f:5ca1:ce60:6586%7]) with mapi id 15.20.2856.027; Fri, 10 Apr 2020
 07:00:27 +0000
Date: Fri, 10 Apr 2020 12:30:12 +0530
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: Andrzej Ostruszka <amo@semihalf.com>
CC: <dev@dpdk.org>
Message-ID: <20200410070012.GA23867@outlook.office365.com>
References: <20200331192945.2466880-1-jerinj@marvell.com>
 <20200405085613.1336841-1-jerinj@marvell.com>
 <20200405085613.1336841-17-jerinj@marvell.com>
 <5546f4cb-6ee1-1148-716f-56101be1e7f6@semihalf.com>
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5546f4cb-6ee1-1148-716f-56101be1e7f6@semihalf.com>
User-Agent: Mutt/1.12.2 (34cd43c) (2019-09-21)
X-ClientProxiedBy: BM1PR0101CA0033.INDPRD01.PROD.OUTLOOK.COM
 (2603:1096:b00:1a::19) To MWHPR1801MB2063.namprd18.prod.outlook.com
 (2603:10b6:301:6a::11)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from outlook.office365.com (115.113.156.2) by
 BM1PR0101CA0033.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.17 via Frontend
 Transport; Fri, 10 Apr 2020 07:00:25 +0000
X-Originating-IP: [115.113.156.2]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: abe66198-5d8b-496a-788c-08d7dd1cd8e0
X-MS-TrafficTypeDiagnostic: MWHPR1801MB2032:
X-Microsoft-Antispam-PRVS: <MWHPR1801MB20324E507A72E8188B2A2F30AFDE0@MWHPR1801MB2032.namprd18.prod.outlook.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:8273;
X-Forefront-PRVS: 0369E8196C
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:MWHPR1801MB2063.namprd18.prod.outlook.com; PTR:; CAT:NONE;
 SFTY:;
 SFS:(10009020)(4636009)(376002)(396003)(136003)(346002)(366004)(39860400002)(81156014)(4326008)(316002)(2906002)(5660300002)(9686003)(66946007)(66556008)(26005)(33656002)(478600001)(66476007)(186003)(1076003)(16526019)(8936002)(8676002)(6666004)(956004)(86362001)(55016002)(55236004)(53546011)(6916009)(52116002)(6506007)(7696005);
 DIR:OUT; SFP:1101; 
Received-SPF: None (protection.outlook.com: marvell.com does not designate
 permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: upvJevicaZX9Q5mlXYZgOYSl0KCLeX3WQNM572gGttgkCh33l/9q+XLVTt9L1YfaKJBOle6H2bp01/2f/wcDwjmkNqNmERZvNRymKv5vsyjFlgp4rGc3yAJ0vIK4pxZfYljua4mx8bRcvTd/ZtqozEWTVvAFUeOtGEZD5Go0ZyZ4oFY129Ikah8mt53NO09Zuk8S9pMAMdded+15IdkZoR0bwcElkE3jSiAg0lLhiMD8yXtI0xhQ5sJ8bQQTsvcCrLXZdQXRnKdtElAIrsEXnMokTm4BFyu8q5wGzVksew3DnMczx9qqFnn5Z2sAMa0SEfv3A9Sr5FjSupboc3oqGGsE4i5KYljzLRl+jJr2HE6lY22VmKYN2VTU3emn7BlC77Hc/PE6kIWvWJy6e8rwt2mYpL8nooK1LVdk5IeYuqNP5gIlRIuIn94RYJVZXGnv
X-MS-Exchange-AntiSpam-MessageData: azRWy0gKK4TYspOd8Pwk9PpfQoE7MER+HyNJQW5RJYGdmXf/EmYuzSDBSeyWqNj9w1hmpDDB3XCRbHSAZ3ay1qxhGut2Eiv6vGxWDGlPy2JiWTMPk5NnUrzU9kNvP8RZRjiy3GGvT2Y6fZDZIPEJKA==
X-MS-Exchange-CrossTenant-Network-Message-Id: abe66198-5d8b-496a-788c-08d7dd1cd8e0
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2020 07:00:26.8004 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: wzpHbsSiRyls/BMiGPY0Np5823IcVbr8ri0tojzTKBO/OABAObTqmq5Qj9xiWz4P9j7eVkNw5ZCZ4qIAflyIiQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB2032
X-OriginatorOrg: marvell.com
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676
 definitions=2020-04-10_02:2020-04-07,
 2020-04-10 signatures=0
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Fri, Apr 10, 2020 at 01:05:08AM +0200, Andrzej Ostruszka wrote:
> On 4/5/20 10:56 AM, jerinj@marvell.com wrote:
> > From: Nithin Dabilpuram <ndabilpuram@marvell.com>
> > 
> > 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 <ndabilpuram@marvell.com>
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> [...]
> > +/* 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 :)

I tested it now in octeon and there is 6% increasing when using prefetch based while loop
instead of non-prefetch based while loop.

Yes, it is not intended to be used normally, but I just followed ideology of prefetch ahead 
before use. It could be changed later if needed for other platforms or split into platform 
dependent implementation like lookup node.

> 
> > +
> > +		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