From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id B78381B23B for ; Thu, 28 Dec 2017 02:54:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Dec 2017 17:54:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,468,1508828400"; d="scan'208";a="15000432" Received: from kmsmsx156.gar.corp.intel.com ([172.21.138.133]) by FMSMGA003.fm.intel.com with ESMTP; 27 Dec 2017 17:54:56 -0800 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.108]) by KMSMSX156.gar.corp.intel.com ([172.21.138.133]) with mapi id 14.03.0248.002; Thu, 28 Dec 2017 09:54:55 +0800 From: "Zhao1, Wei" To: Ori Kam , "dev@dpdk.org" Thread-Topic: [PATCH v2] examples/flow_filtering: add Tx queues setup process Thread-Index: AQHTfu5keRwuS3DilEuKQU0/gXlE4qNWjqOAgAFxI9A= Date: Thu, 28 Dec 2017 01:54:54 +0000 Message-ID: References: <20171226094905.83277-1-wei.zhao1@intel.com> <20171227083215.112330-1-wei.zhao1@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] examples/flow_filtering: add Tx queues setup process 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: , X-List-Received-Date: Thu, 28 Dec 2017 01:54:59 -0000 Thabk you. > -----Original Message----- > From: Ori Kam [mailto:orika@mellanox.com] > Sent: Wednesday, December 27, 2017 7:53 PM > To: Zhao1, Wei ; dev@dpdk.org > Subject: RE: [PATCH v2] examples/flow_filtering: add Tx queues setup > process >=20 >=20 >=20 > > -----Original Message----- > > From: Wei Zhao [mailto:wei.zhao1@intel.com] > > Sent: Wednesday, December 27, 2017 10:32 AM > > To: dev@dpdk.org > > Cc: Ori Kam ; Wei Zhao > > Subject: [PATCH v2] examples/flow_filtering: add Tx queues setup > > process > > > > This example do not has the process of set up tx queues, but some NIC > > start up process will be blocked if this is no tx queue and only rx > > queues. So add tx queues setup process in main code. > > > > Signed-off-by: Wei Zhao > > > > --- > > > > v2: > > -add support the new tx offloads. > > --- > > examples/flow_filtering/main.c | 26 ++++++++++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > > > diff --git a/examples/flow_filtering/main.c > > b/examples/flow_filtering/main.c index 7d739b4..4a07b63 100644 > > --- a/examples/flow_filtering/main.c > > +++ b/examples/flow_filtering/main.c > > @@ -149,7 +149,18 @@ init_port(void) > > /**< CRC stripped by hardware */ > > .hw_strip_crc =3D 1, > > }, > > + .txmode =3D { > > + .offloads =3D > > + DEV_TX_OFFLOAD_VLAN_INSERT | > > + DEV_TX_OFFLOAD_IPV4_CKSUM | > > + DEV_TX_OFFLOAD_UDP_CKSUM | > > + DEV_TX_OFFLOAD_TCP_CKSUM | > > + DEV_TX_OFFLOAD_SCTP_CKSUM | > > + DEV_TX_OFFLOAD_TCP_TSO, > > + }, > > }; > > + struct rte_eth_txconf txq_conf; > > + struct rte_eth_dev_info dev_info; > > > > printf(":: initializing port: %d\n", port_id); > > ret =3D rte_eth_dev_configure(port_id, @@ -173,6 +184,21 @@ > > init_port(void) > > } > > } > > > > + rte_eth_dev_info_get(port_id, &dev_info); > > + txq_conf =3D dev_info.default_txconf; > > + txq_conf.offloads =3D port_conf.txmode.offloads; > > + > > + for (i =3D 0; i < nr_queues; i++) { > > + ret =3D rte_eth_tx_queue_setup(port_id, i, 512, > > + rte_eth_dev_socket_id(port_id), > > + &txq_conf); > > + if (ret < 0) { > > + rte_exit(EXIT_FAILURE, > > + ":: Tx queue setup failed: err=3D%d, > > port=3D%u\n", > > + ret, port_id); > > + } > > + } > > + > > rte_eth_promiscuous_enable(port_id); > > ret =3D rte_eth_dev_start(port_id); > > if (ret < 0) { > > -- > > 2.9.3 >=20 > Acked-by: Ori Kam