From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50069.outbound.protection.outlook.com [40.107.5.69]) by dpdk.org (Postfix) with ESMTP id 498CC1B263 for ; Wed, 27 Dec 2017 12:53:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DaVEkYAyK+r32xqQZEgA7Cxr0zzWNODQPxNu8ryzKb0=; b=aPQrZzAKOT9RAc8eql12hNzzALMwSVZrZ6qWAoZF/4GiokCRNRqvk4k7FwlC4YcS75HBR93GtvAN7HU6USpPJPlIZjP+fI6pG3l/7pTwQWB8KQdUr8O4cMbij5fCHB1LWN938xOVZ2i1WbgcH7kM/LT+36EY+Jl7fjj3oSN6gR4= Received: from AM4PR05MB1476.eurprd05.prod.outlook.com (10.164.79.142) by AM4PR05MB1476.eurprd05.prod.outlook.com (10.164.79.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Wed, 27 Dec 2017 11:53:27 +0000 Received: from AM4PR05MB1476.eurprd05.prod.outlook.com ([fe80::d1dc:f4f0:aba8:5d3f]) by AM4PR05MB1476.eurprd05.prod.outlook.com ([fe80::d1dc:f4f0:aba8:5d3f%14]) with mapi id 15.20.0345.017; Wed, 27 Dec 2017 11:53:27 +0000 From: Ori Kam To: Wei Zhao , "dev@dpdk.org" Thread-Topic: [PATCH v2] examples/flow_filtering: add Tx queues setup process Thread-Index: AQHTfu5SZTlUFliTZU6rW/vgFF8dbaNXFHqQ Date: Wed, 27 Dec 2017 11:53:27 +0000 Message-ID: References: <20171226094905.83277-1-wei.zhao1@intel.com> <20171227083215.112330-1-wei.zhao1@intel.com> In-Reply-To: <20171227083215.112330-1-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1476; 7:D7QVpbFcIAERtK/qI4EHF2pNMqdH1w4VSsTrqALA/5u20W99m5PvFEx3M/60sp5q7js4Kw9yYV93Lq3Eo43afkpoIFhcQGcHpjW2ZXiWrZ6gh9akZO+5mMWPjEkmyQokdXA+6RzAUXft7D9eqA4eZRLRDP22LaGiajkpjQNSfrVq8yuiFfjCgXDqh5vbLlHtzo9IiwwElSmvtWQL6RY6/CAMAvupGNqQ6ydW1zWhvnnkE+LYA9DF0fQuHjEUrOWx x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: b5e6ab8f-1089-48f2-652e-08d54d207142 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060); SRVR:AM4PR05MB1476; x-ms-traffictypediagnostic: AM4PR05MB1476: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231023)(944501075)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR05MB1476; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM4PR05MB1476; x-forefront-prvs: 0534947130 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(39380400002)(39860400002)(376002)(13464003)(199004)(189003)(106356001)(229853002)(3846002)(6116002)(3660700001)(14454004)(6436002)(305945005)(8676002)(2900100001)(81156014)(53936002)(2906002)(102836004)(6246003)(6506007)(25786009)(53546011)(3280700002)(316002)(33656002)(110136005)(66066001)(478600001)(59450400001)(76176011)(7696005)(7736002)(97736004)(2501003)(2950100002)(5250100002)(9686003)(86362001)(81166006)(8936002)(55016002)(99286004)(5660300001)(74316002)(105586002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1476; H:AM4PR05MB1476.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: hgTZBwAYSYlEDWBV34TQbDueNeS6FVO1FGLVtJgAdr1+5ACzLSaO7nrnohyZWjFYzt7VWKh7ckdZ3Q2vb/fSSw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5e6ab8f-1089-48f2-652e-08d54d207142 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2017 11:53:27.6168 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1476 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: Wed, 27 Dec 2017 11:53:30 -0000 > -----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 >=20 > This example do not has the process of set up tx queues, but some NIC sta= rt > up process will be blocked if this is no tx queue and only rx queues. So = add tx > queues setup process in main code. >=20 > Signed-off-by: Wei Zhao >=20 > --- >=20 > v2: > -add support the new tx offloads. > --- > examples/flow_filtering/main.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) >=20 > diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/mai= n.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; >=20 > printf(":: initializing port: %d\n", port_id); > ret =3D rte_eth_dev_configure(port_id, > @@ -173,6 +184,21 @@ init_port(void) > } > } >=20 > + 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 Acked-by: Ori Kam