From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50054.outbound.protection.outlook.com [40.107.5.54]) by dpdk.org (Postfix) with ESMTP id 274E71B3C1; Tue, 30 Jan 2018 10:22:31 +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=wNUrh6nFwkEzeZoOqkcHXGCeaUcDiA1IhSv9z4qTFvQ=; b=LIzRLbSzC/Q/ZzEHz2qU9dHk6k23ZVQwA4PT/kgm05Xo0fqUYgcZwlj5R2oJd49u+2dBHBGZ6zMyQS4e1lSswz7MEf83gUwHDphlaGYARcThqueJcL0jWmjlE8Nt4w9B9OGtUu4pHoJmzg4GCuvazRI3VEiQUpaiCJO7kObGrpg= Received: from AM4PR05MB1476.eurprd05.prod.outlook.com (10.164.79.142) by AM4PR05MB1889.eurprd05.prod.outlook.com (10.167.91.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 09:22:28 +0000 Received: from AM4PR05MB1476.eurprd05.prod.outlook.com ([fe80::951d:79c9:7763:1603]) by AM4PR05MB1476.eurprd05.prod.outlook.com ([fe80::951d:79c9:7763:1603%13]) with mapi id 15.20.0444.016; Tue, 30 Jan 2018 09:22:28 +0000 From: Ori Kam To: Wei Zhao , "dev@dpdk.org" CC: "stable@dpdk.org" , "john.mcnamara@intel.com" Thread-Topic: [PATCH v2] doc: update flow filting document Thread-Index: AQHTmZ9Ek66eTcU1KUSK7dtLvHSjEqOMI9dw Date: Tue, 30 Jan 2018 09:22:28 +0000 Message-ID: References: <20180130073240.114479-1-wei.zhao1@intel.com> <20180130074431.116094-1-wei.zhao1@intel.com> In-Reply-To: <20180130074431.116094-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; AM4PR05MB1889; 7:ObEGQCRWs43HQqq6Rwx24zL+8RtWmRjd+ZID+Se9BUof54Oaq37GM+1TQDsQQ0CpXctzYD3x2zmUNcMTezFIUyXmXXf95VEkCQZPZU0nJ0ds9onEbmQBZRqB1WNQTknEmcBTdV3mrhEljJVZRk4RFOqnn65QiBCj4Z/1qqs0xQ6izKDYR4PM6QiXJyUcd40cZA3EHit1gAG8MKHx5LlbKcR3+Q1vnQYUTD5XYIsA4PLlbyFvLSt1w8/uTPFeh3x2 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 76ae9789-ad61-4075-ef4e-08d567c2fb93 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR05MB1889; x-ms-traffictypediagnostic: AM4PR05MB1889: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(116097685857584)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231101)(944501161)(6055026)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR05MB1889; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1889; x-forefront-prvs: 0568F32D91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(346002)(366004)(396003)(376002)(13464003)(199004)(189003)(33656002)(105586002)(68736007)(54906003)(97736004)(110136005)(316002)(5660300001)(2950100002)(3846002)(25786009)(186003)(2906002)(6246003)(4326008)(99286004)(478600001)(6506007)(59450400001)(14454004)(53546011)(66066001)(76176011)(106356001)(7696005)(102836004)(2900100001)(26005)(6116002)(8676002)(81156014)(8936002)(81166006)(74316002)(7736002)(305945005)(9686003)(6436002)(55016002)(53936002)(5250100002)(2501003)(3660700001)(15650500001)(3280700002)(229853002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1889; 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: qVGNXnz+M+v7j02yvX1cZFjynuSm86TutBdn/t14PdnInhAOWyzAVeOgfG/zCz1cwNEB8EcidHU3qdU3TsvgZQ== 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: 76ae9789-ad61-4075-ef4e-08d567c2fb93 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2018 09:22:28.3792 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1889 Subject: Re: [dpdk-dev] [PATCH v2] doc: update flow filting document 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: Tue, 30 Jan 2018 09:22:31 -0000 Hi Wei, You have a typo in the patch subject and comment,=20 It should be filtering Ori > -----Original Message----- > From: Wei Zhao [mailto:wei.zhao1@intel.com] > Sent: Tuesday, January 30, 2018 9:45 AM > To: dev@dpdk.org > Cc: Ori Kam ; stable@dpdk.org; > john.mcnamara@intel.com; Wei Zhao > Subject: [PATCH v2] doc: update flow filting document >=20 > This patch will update example application of flow_filting document. > It add Tx queues configuration related comment. >=20 > Signed-off-by: Wei Zhao >=20 > --- >=20 > v2: > -change code indentation style. > --- > doc/guides/sample_app_ug/flow_filtering.rst | 108 ++++++++++++++++++- > --------- > 1 file changed, 72 insertions(+), 36 deletions(-) >=20 > diff --git a/doc/guides/sample_app_ug/flow_filtering.rst > b/doc/guides/sample_app_ug/flow_filtering.rst > index 725dcb4..b4a1dd7 100644 > --- a/doc/guides/sample_app_ug/flow_filtering.rst > +++ b/doc/guides/sample_app_ug/flow_filtering.rst > @@ -167,44 +167,65 @@ application is shown below: > struct rte_eth_conf port_conf =3D { > .rxmode =3D { > .split_hdr_size =3D 0, > - /**< Header Split disabled */ > - .header_split =3D 0, > - /**< IP checksum offload disabled */ > - .hw_ip_checksum =3D 0, > - /**< VLAN filtering disabled */ > - .hw_vlan_filter =3D 0, > - /**< Jumbo Frame Support disabled */ > - .jumbo_frame =3D 0, > - /**< CRC stripped by hardware */ > - .hw_strip_crc =3D 1, > + .ignore_offload_bitfield =3D 1, > + .offloads =3D DEV_RX_OFFLOAD_CRC_STRIP, > + }, > + .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_rxconf rxq_conf; > + struct rte_eth_dev_info dev_info; >=20 > printf(":: initializing port: %d\n", port_id); > ret =3D rte_eth_dev_configure(port_id, > - nr_queues, nr_queues, &port_conf); > + nr_queues, nr_queues, &port_conf); > if (ret < 0) { > rte_exit(EXIT_FAILURE, > ":: cannot configure device: err=3D%d, port= =3D%u\n", > ret, port_id); > } >=20 > + rte_eth_dev_info_get(port_id, &dev_info); > + rxq_conf =3D dev_info.default_rxconf; > + rxq_conf.offloads =3D port_conf.rxmode.offloads; > /* only set Rx queues: something we care only so far */ > for (i =3D 0; i < nr_queues; i++) { > ret =3D rte_eth_rx_queue_setup(port_id, i, 512, > - rte_eth_dev_socket_id(port_id), > - NULL, > - mbuf_pool); > + rte_eth_dev_socket_id(port_id), > + &rxq_conf, > + mbuf_pool); > if (ret < 0) { > - rte_exit(EXIT_FAILURE, > - ":: Rx queue setup failed: err=3D%d, port= =3D%u\n", > - ret, port_id); > + rte_exit(EXIT_FAILURE, > + ":: Rx queue setup failed: err=3D%d, > + port=3D%u\n", > + ret, port_id); > } > } >=20 > + txq_conf =3D dev_info.default_txconf; > + txq_conf.offloads =3D port_conf.txmode.offloads; >=20 > - rte_eth_promiscuous_enable(port_id); > + 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); > + } > + } >=20 > + rte_eth_promiscuous_enable(port_id); > ret =3D rte_eth_dev_start(port_id); > if (ret < 0) { > rte_exit(EXIT_FAILURE, @@ -223,20 +244,21 @@ The Ethe= rnet port > is configured with default settings using the .. code-block:: c >=20 > struct rte_eth_conf port_conf =3D { > - .rxmode =3D { > - .split_hdr_size =3D 0, > - /**< Header Split disabled */ > - .header_split =3D 0, > - /**< IP checksum offload disabled */ > - .hw_ip_checksum =3D 0, > - /**< VLAN filtering disabled */ > - .hw_vlan_filter =3D 0, > - /**< Jumbo Frame Support disabled */ > - .jumbo_frame =3D 0, > - /**< CRC stripped by hardware */ > - .hw_strip_crc =3D 1, > - }, > - }; > + .rxmode =3D { > + .split_hdr_size =3D 0, > + .ignore_offload_bitfield =3D 1, > + .offloads =3D DEV_RX_OFFLOAD_CRC_STRIP, > + }, > + .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, > + }, > + }; >=20 > ret =3D rte_eth_dev_configure(port_id, nr_queues, nr_queues, > &port_conf); > if (ret < 0) { > @@ -244,23 +266,37 @@ The Ethernet port is configured with default > settings using the > ":: cannot configure device: err=3D%d, port=3D%u\n", > ret, port_id); > } > + rte_eth_dev_info_get(port_id, &dev_info); > + rxq_conf =3D dev_info.default_rxconf; > + rxq_conf.offloads =3D port_conf.rxmode.offloads; >=20 > -For this example we are configuring number of rx queues that are > connected to -a single port. > +For this example we are configuring number of rx and tx queues that are > +connected to a single port. >=20 > .. code-block:: c >=20 > for (i =3D 0; i < nr_queues; i++) { > ret =3D rte_eth_rx_queue_setup(port_id, i, 512, > rte_eth_dev_socket_id(port_id), > - NULL, > + &rxq_conf, > mbuf_pool); > if (ret < 0) { > rte_exit(EXIT_FAILURE, > ":: Rx queue setup failed: err=3D%d, port=3D%u= \n", > ret, port_id); > } > - } > + } > + > + 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); > + } > + } >=20 > In the next step we create and apply the flow rule. which is to send pac= kets > with destination ip equals to 192.168.1.1 to queue number 1. The detail > -- > 2.9.3