From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH 4/8] app/eventdev: add ethernet device setup helpers Date: Sun, 10 Dec 2017 17:39:32 +0530 Message-ID: <20171210120931.GE11770@jerin> References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> <1508330348-30060-5-git-send-email-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com, dev@dpdk.org To: Pavan Nikhilesh Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0056.outbound.protection.outlook.com [104.47.34.56]) by dpdk.org (Postfix) with ESMTP id 41FF329CF for ; Sun, 10 Dec 2017 13:09:57 +0100 (CET) Content-Disposition: inline In-Reply-To: <1508330348-30060-5-git-send-email-pbhagavatula@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Wed, 18 Oct 2017 18:09:04 +0530 > From: Pavan Nikhilesh > To: bruce.richardson@intel.com, harry.van.haaren@intel.com, > gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, > nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com, > jerin.jacob@caviumnetworks.com > Cc: dev@dpdk.org, Pavan Nikhilesh > Subject: [PATCH 4/8] app/eventdev: add ethernet device setup helpers > X-Mailer: git-send-email 2.7.4 > > Add ethernet device setup functions to configure ethdev ports incase > prod_type_ethdev option is enabled. > > Signed-off-by: Pavan Nikhilesh > --- > > +#define NB_RX_DESC 128 > +#define NB_TX_DESC 512 > +int > +perf_ethdev_setup(struct evt_test *test, struct evt_options *opt) > +{ > + uint16_t nb_rx_queues = 1; const ? > + int i; > + int j; > + struct test_perf *t = evt_test_priv(test); > + struct rte_eth_conf port_conf = { > + .rxmode = { > + .mq_mode = ETH_MQ_RX_RSS, > + .max_rx_pkt_len = ETHER_MAX_LEN, > + .split_hdr_size = 0, > + .header_split = 0, > + .hw_ip_checksum = 0, > + .hw_vlan_filter = 0, > + .hw_vlan_strip = 0, > + .hw_vlan_extend = 0, > + .jumbo_frame = 0, > + .hw_strip_crc = 1, > + }, > + .rx_adv_conf = { > + .rss_conf = { > + .rss_key = NULL, > + .rss_hf = ETH_RSS_IP, > + }, > + }, > + }; > + > + if (opt->prod_type == EVT_PROD_TYPE_SYNT) > + return 0; > + > + if (!rte_eth_dev_count()) { > + evt_err("No ethernet ports found.\n"); > + return -ENODEV; > + } > + > + for (i = 0; i < rte_eth_dev_count(); i++) { > + > + if (rte_eth_dev_configure(i, nb_rx_queues, nb_rx_queues, > + &port_conf) > + < 0) { > + evt_err("Failed to configure eth port [%d]\n", i); > + return -EINVAL; > + } > + > + for (j = 0; j < nb_rx_queues; j++) { > + if (rte_eth_rx_queue_setup(i, j, NB_RX_DESC, > + rte_socket_id(), NULL, t->pool) < 0) { > + evt_err("Failed to setup eth port [%d]" > + " rx_queue: %d." > + " Using synthetic producer\n", - The "\n" is not required as evt_err already has "\n" - Please change to "Using ethdev Rx adapter producer " instead of "Using synthetic producer" > + i, j); > + return -EINVAL; > + } > + if (rte_eth_tx_queue_setup(i, j, NB_TX_DESC, > + rte_socket_id(), NULL) < 0) { > + evt_err("Failed to setup eth port [%d]" > + " tx_queue: %d." > + " Using synthetic producer\n", > + i, j); > + return -EINVAL; > + } > + } > + > + rte_eth_promiscuous_enable(i); > + } > + > + return 0; > +} With above changes, Acked-by: Jerin Jacob