From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0073.outbound.protection.outlook.com [104.47.0.73]) by dpdk.org (Postfix) with ESMTP id B437A1C00 for ; Wed, 13 Dec 2017 08:21:03 +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=6VGUxW8R3InlV4RYma6oG8Lt0Wf06wUAC8FvVqmd4L4=; b=e2I1uSl7DUjzK8SHytSD7Fx7nhEmtuHXE6TTWfNf18E5rgHiTMy4AExS6D0ryJUd2dQPkRHbrX0z44hTwdEAjwS7KeacAPgE+zV+ZTsWn5QvpzDRGZhoxlhq39HcYFnlk7jcHRjLqqPNHpUv5+vqZx86s2+keOBUqPdy7DWTr8g= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB3150.eurprd05.prod.outlook.com (10.170.237.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 07:21:01 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::3905:ed70:f744:9dc6]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::3905:ed70:f744:9dc6%13]) with mapi id 15.20.0302.013; Wed, 13 Dec 2017 07:21:01 +0000 From: Shahaf Shuler To: "Ananyev, Konstantin" , "dev@dpdk.org" , "Nicolau, Radu" , "arybchenko@solarflare.com" Thread-Topic: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API Thread-Index: AQHTc2xfFKcCfr6+OE+dZzgKGG66zaNA3lNg Date: Wed, 13 Dec 2017 07:21:01 +0000 Message-ID: References: <20171123121419.144132-1-shahafs@mellanox.com> <2601191342CEEE43887BDE71AB9772585FAC8AEB@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772585FAC8AEB@irsmsx105.ger.corp.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=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB3150; 6:SQg25baGhL9ji6X5yPgqBHCDIvFDwCW464udoCOvwWsZOKjJgkRGBNB6I/8Zpk3MRxUDuzab5UGoJ009mYN6L622ihX2iZYMC+J9eDRo0d30zeb3U/jnlvbFKPLS/7j10m0F9Jt3LVq8yg6V87OQonHoIFSRyamxu+/wgBXB08/w0W20/A0KheQO3tpY9hEQkfmPVqTkdFofZz8nmRfbIt2n2Fnsz0uTxnV4VEd97L5AP+HrPNOJFxVxdNafRakAoGc/f7dx03ezc9wxlJozTWsWn7GD1E4E9YWYpB6Hfxmn7NrrFZI1CuJqJ4b8D/OAt/BHPxZdYJGssiDrIGKUmNteWCpQ0uDioMB5LGfDEhk=; 5:4SlqcA4yBiirSqpAN5NRo/UnJCg7QPWVOV1lVnnWEMoj+Ab4BQbbHD2gfZ31aC7iXdxpKcOzpP5B7ZMkSNfFTxmj6qWxCYkCbaJkATFz7gxbNWYSqsx5Dg276+ntAutU2cy4N9EfQkikC/nXQPyykmWChHv+OCC/qJAxwmX3HBw=; 24:9xT4d7ASAz+7m7c8HqWYyy62cs4YMJqSBTIxWI510oCI2mnimOTz1KxAyCvHlON7TQGtC5gBHM1DDcLJhQvMZ+P9oaOdvqXuogQZH+Svzdc=; 7:KxjQczaBD9TFzLmI8Kr8GP4wSG+tAW/QRJ/hKbgBdez69G4caEVbzes4YSHNVuahlrXXpty7UD/ncjHDIeeC4z/LRNEilNQRE5TWEAyf7KfGNtPLy6k2p+RUDp38W6N3mWJbqDuy5QtpKAG1JW3MTsAe7VTYgq+ftfi2dhd5S97jyw627w96OGba5LHRjWjKpe38qGb7Vtsp+RT0ywqHZA9gVXmwwTmDqGANh/OdbhJ4OQt+ZycbOWQEimt6z6wB x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5eba5670-bc59-428b-984d-08d541fa104f x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307); SRVR:VI1PR05MB3150; x-ms-traffictypediagnostic: VI1PR05MB3150: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011); SRVR:VI1PR05MB3150; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3150; x-forefront-prvs: 052017CAF1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(346002)(376002)(366004)(39860400002)(189003)(199004)(13464003)(76176011)(7696005)(33656002)(14454004)(97736004)(110136005)(478600001)(5660300001)(93886005)(2900100001)(99286004)(59450400001)(25786009)(8936002)(68736007)(3280700002)(2501003)(53546011)(6506007)(5250100002)(316002)(2906002)(6116002)(3660700001)(3846002)(86362001)(2950100002)(6436002)(8676002)(81156014)(66066001)(81166006)(7736002)(105586002)(9686003)(305945005)(229853002)(55016002)(74316002)(106356001)(53936002)(102836003)(6246003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3150; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) 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: 5eba5670-bc59-428b-984d-08d541fa104f X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2017 07:21:01.2824 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3150 Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API 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, 13 Dec 2017 07:21:04 -0000 Tuesday, December 12, 2017 7:12 PM, Ananyev, Konstantin: > > -----Original Message----- > > From: Shahaf Shuler [mailto:shahafs@mellanox.com] > > Sent: Tuesday, December 12, 2017 12:26 PM > > To: dev@dpdk.org; Ananyev, Konstantin > ; > > Nicolau, Radu ; arybchenko@solarflare.com > > Subject: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API > > > > Ethdev offloads API has changed since: > > > > commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit > > cba7f53b717d ("ethdev: introduce Tx queue offloads API") > > > > This commit support the new API. > > > > Signed-off-by: Shahaf Shuler > > --- > > examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++-------- > -- > > 1 file changed, 30 insertions(+), 10 deletions(-) > > > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index > > 6229568..3bdf4d5 100644 > > --- a/examples/l3fwd/main.c > > +++ b/examples/l3fwd/main.c > > @@ -149,11 +149,9 @@ struct lcore_params { > > .mq_mode =3D ETH_MQ_RX_RSS, > > .max_rx_pkt_len =3D ETHER_MAX_LEN, > > .split_hdr_size =3D 0, > > - .header_split =3D 0, /**< Header Split disabled */ > > - .hw_ip_checksum =3D 1, /**< IP checksum offload enabled */ > > - .hw_vlan_filter =3D 0, /**< VLAN filtering disabled */ > > - .jumbo_frame =3D 0, /**< Jumbo Frame Support disabled */ > > - .hw_strip_crc =3D 1, /**< CRC stripped by hardware */ > > + .ignore_offload_bitfield =3D 1, > > + .offloads =3D (DEV_RX_OFFLOAD_CRC_STRIP | > > + DEV_RX_OFFLOAD_CHECKSUM), > > }, > > .rx_adv_conf =3D { > > .rss_conf =3D { > > @@ -163,6 +161,7 @@ struct lcore_params { > > }, > > .txmode =3D { > > .mq_mode =3D ETH_MQ_TX_NONE, > > + .offloads =3D DEV_TX_OFFLOAD_MBUF_FAST_FREE, >=20 > Hmm, does it mean a new warning for all PMDs (majority) which don't > support DEV_TX_OFFLOAD_MBUF_FAST_FREE? Good point. Unlike other offloads which are must for the application proper run, this o= ne it only for optimizing the performance and should be set only if PMD sup= ports.=20 Am continuing to aggregate reasons why the DEV_TX_OFFLOAD_MBUF_FAST_FREE sh= ould not be defined as an offload. Anyway we passed that...=20 I will fix on v3. > Konstantin >=20 > > }, > > }; > > > > @@ -612,7 +611,8 @@ enum { > > }; > > > > printf("%s\n", str8); > > - port_conf.rxmode.jumbo_frame =3D 1; > > + port_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > > + port_conf.txmode.offloads |=3D > DEV_TX_OFFLOAD_MULTI_SEGS; > > > > /* > > * if no max-pkt-len set, use the default @@ -908,6 > +908,22 @@ > > enum { > > n_tx_queue =3D MAX_TX_QUEUE_PER_PORT; > > printf("Creating queues: nb_rxq=3D%d nb_txq=3D%u... ", > > nb_rx_queue, (unsigned)n_tx_queue ); > > + > > + rte_eth_dev_info_get(portid, &dev_info); > > + if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) > !=3D > > + port_conf.rxmode.offloads) { > > + printf("Some Rx offloads are not supported " > > + "by port %d: requested 0x%lx supported > 0x%lx\n", > > + portid, port_conf.rxmode.offloads, > > + dev_info.rx_offload_capa); > > + } > > + if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) > !=3D > > + port_conf.txmode.offloads) { > > + printf("Some Tx offloads are not supported " > > + "by port %d: requested 0x%lx supported > 0x%lx\n", > > + portid, port_conf.txmode.offloads, > > + dev_info.tx_offload_capa); > > + } > > ret =3D rte_eth_dev_configure(portid, nb_rx_queue, > > (uint16_t)n_tx_queue, &port_conf); > > if (ret < 0) > > @@ -955,10 +971,9 @@ enum { > > printf("txq=3D%u,%d,%d ", lcore_id, queueid, > socketid); > > fflush(stdout); > > > > - rte_eth_dev_info_get(portid, &dev_info); > > txconf =3D &dev_info.default_txconf; > > - if (port_conf.rxmode.jumbo_frame) > > - txconf->txq_flags =3D 0; > > + txconf->txq_flags =3D ETH_TXQ_FLAGS_IGNORE; > > + txconf->offloads =3D port_conf.txmode.offloads; > > ret =3D rte_eth_tx_queue_setup(portid, queueid, > nb_txd, > > socketid, txconf); > > if (ret < 0) > > @@ -984,6 +999,8 @@ enum { > > fflush(stdout); > > /* init RX queues */ > > for(queue =3D 0; queue < qconf->n_rx_queue; ++queue) { > > + struct rte_eth_rxconf rxq_conf; > > + > > portid =3D qconf->rx_queue_list[queue].port_id; > > queueid =3D qconf->rx_queue_list[queue].queue_id; > > > > @@ -996,9 +1013,12 @@ enum { > > printf("rxq=3D%d,%d,%d ", portid, queueid, socketid); > > fflush(stdout); > > > > + rte_eth_dev_info_get(portid, &dev_info); > > + rxq_conf =3D dev_info.default_rxconf; > > + rxq_conf.offloads =3D port_conf.rxmode.offloads; > > ret =3D rte_eth_rx_queue_setup(portid, queueid, > nb_rxd, > > socketid, > > - NULL, > > + &rxq_conf, > > pktmbuf_pool[socketid]); > > if (ret < 0) > > rte_exit(EXIT_FAILURE, > > -- > > 1.8.3.1