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 B250DA00E6 for ; Tue, 6 Aug 2019 10:02:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 606411BE09; Tue, 6 Aug 2019 10:02:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 4BF771BDE8 for ; Tue, 6 Aug 2019 10:02:36 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x767UO4v005792; Tue, 6 Aug 2019 01:02:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=vuj3k2mKf8P7x7s4YB785hi/uNK44D89JG9TIeQO4bk=; b=tSA3wbDZKbUNyJlj5IhiQn5nzMwUcgvMQB7xPI5OnbJTj4tOiCDGlJBC+B7snDzqEfOH W51hEAEKg+bcc80X6kW5NN3k2P071vIkHz0sIxgVPFHmyCr05ziQr1hGZZqhBHzQaNBU p895WLwTyWLcp2oTR9iKN/byUfXUXEEaAjOhnx8bjGvXonQd+FCTwOq2g+9e/qtuCj+j PC+DnjuFvVJBMpRb0Dt3vzP+P+1JKmNJ9Qex2gjkw5qrnr2Yn6w62yKBz2lArRrqy5eC Oa11PUY8d6WYJFjvN5D4YY7ri3Mslpt2tF+bDVRsxx0zwlhqO0jbP5LETZLBmV/jGgRJ zw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2u59sksjht-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 06 Aug 2019 01:02:35 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 6 Aug 2019 01:02:34 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 6 Aug 2019 01:02:33 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.50]) by maili.marvell.com (Postfix) with ESMTP id 457CD3F703F; Tue, 6 Aug 2019 01:02:28 -0700 (PDT) From: To: , Konstantin Ananyev , David Hunt , Marko Kovacevic , Ori Kam , Bruce Richardson , Pablo de Lara , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , John McNamara , Harry van Haaren , Xiaoyun Li CC: , Pavan Nikhilesh Date: Tue, 6 Aug 2019 13:32:04 +0530 Message-ID: <20190806080206.1572-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806080206.1572-1-pbhagavatula@marvell.com> References: <20190806080206.1572-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-06_04:2019-07-31,2019-08-06 signatures=0 Subject: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload 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" From: Pavan Nikhilesh Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable examples. Signed-off-by: Pavan Nikhilesh --- examples/ip_fragmentation/main.c | 7 +++++++ examples/l3fwd-power/main.c | 8 ++++++++ examples/l3fwd/main.c | 9 +++++++++ examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++ examples/tep_termination/vxlan_setup.c | 1 + 5 files changed, 34 insertions(+) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 324d60773..2a9895542 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -904,6 +904,13 @@ main(int argc, char **argv) /* limit the frame size to the maximum supported by NIC */ rte_eth_dev_info_get(portid, &dev_info); + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) + local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_PTYPE; + + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN( dev_info.max_rx_pktlen, local_port_conf.rxmode.max_rx_pkt_len); diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd8d9528f..875d60c06 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -2261,6 +2261,14 @@ main(int argc, char **argv) dev_rxq_num = dev_info.max_rx_queues; dev_txq_num = dev_info.max_tx_queues; + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { + if (!parse_ptype) + port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_PTYPE; + } else { + parse_ptype = 1; + } + nb_rx_queue = get_port_n_rx_queues(portid); if (nb_rx_queue > dev_rxq_num) rte_exit(EXIT_FAILURE, diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 3800bad19..dfee880a0 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -875,6 +875,15 @@ main(int argc, char **argv) nb_rx_queue, (unsigned)n_tx_queue ); rte_eth_dev_info_get(portid, &dev_info); + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { + if (!parse_ptype) + local_port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_PTYPE; + } else { + parse_ptype = 1; + } + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 49d942407..f033326be 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -3560,6 +3560,15 @@ main(int argc, char **argv) printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)n_tx_queue); rte_eth_dev_info_get(portid, &dev_info); + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { + if (!parse_ptype_on) + port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_PTYPE; + } else { + parse_ptype_on = 1; + } + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c index 9a0880002..3d2acecd5 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -69,6 +69,7 @@ uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID, static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, + .offloads = DEV_RX_OFFLOAD_PTYPE, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, -- 2.17.1