From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0086.outbound.protection.outlook.com [104.47.2.86]) by dpdk.org (Postfix) with ESMTP id 5744D28F3 for ; Thu, 23 Nov 2017 13:17:08 +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=sUkMt1fxd6E3qj6En/ZHqkHe4hVzuOkQ4uiPFydWLos=; b=pPOlMDJJUxOEt831pZIeoGclrwi2jNJ+pb7nMyZK1ltbVkmnK5XSSGKLEm8wHE7rXMzFTH0dfN3q3STECgDxPPodOXcC7RewbaGP3857FjQhfdl8Z1HoHejBQdq+PmHpJSswucqOBfWKLrbcb5Yew7c9KP9UpVV8dOpWcBTcd6w= Received: from mellanox.com (82.166.227.17) by HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 23 Nov 2017 12:17:06 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:12 +0200 Message-Id: <20171123121419.144132-3-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171123121419.144132-1-shahafs@mellanox.com> References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1P18901CA0022.EURP189.PROD.OUTLOOK.COM (10.173.66.160) To HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c0bdfb30-f9d5-483b-530b-08d5326c1d5b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600025)(4604075)(2017052603258); SRVR:HE1PR05MB3147; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 3:kHnpl/DsCJlTj6Xijc80TVRH9YJn1JKn97v57SrDEaA7br50pC5lvuqLCY+3dd96jx+BeO8WSaBJQfDopV4zQkOOUpNC5nOYix1Leu7twv1ZD0DcGgmhdU4nA8nT6PIVcgBCeOU59ozzIPzrZMIC5qKviHeltRkxAuTfFLEW04KWa2wX8ijkqU4l5AydCYd7DHDDMJ7ipUA/2ycYrZ/BjJAByMY1LH0PJZYXMfqegXcWJXnCiYxnJPo4CeXjxD2K; 25:edcr6iXSXiSuKRk2lkyxRH3z/kArmNHvFxZPrGKVGUm5HR2ibq7FDQS1AA8CmXwli4MQMm3NJJ3m37puXiZn1wxG7IFURzi8SKEYoAW4puaM0RD8WnHcZL0RAtTBB1/I80Vj/F/lc9tH7h7GmUMEt2QnF4hYUPrmujULggVJbIJAVK+MUM1Dt0KYkJpxHIJDxgkHX5w9Jv5BX8cCUSfnV0Mv3Ultt1rc2AZOP4LZmw+uBtSPwxhuZgpvc2uCUY6UQU8Ykn8NVigtdO6TdjVGVMMdvRb2QDfzbrKSd2xdjU/1yU5cSdyYORFDYyDMTXPFybLHzITc/t/SgU8YzVv9Svg8uO2b52LX516P0NS0fyU=; 31:pQnm+QN+qp3uPh2vytE+RIgXZVLoNKphTzBPVnUwJkUKFcSM/0SXGCDO1JoqVPnNSHf+MNSlJfVvZdf3p9zh9t4unZNubYS4YxpcHdB5Xg7LKkFLTl7bE9a8tjk/CVEO9DUfijcLirN/dm+WwqAKMiBVILYn54HjQzFLiuH6N95sZGY4qF6nw/GZgTilESVLs1CXB8cbD1qtpdn9Q2yn8wIzC2xF+I87AJ1GYVWhYsc= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:YKsOCFYUI2BCfpSPhtA/vjsSM3zMFfLQnxVa1riUMBYMi2xcP25/4+VWvfczhhlWQSSI0fIAUEDKqERW/gage21YYD5HiE551t8MtVPEUTxq1GcbsKmPMR5F3HQ5D821sspS7hGuovJOHYJ/BfOt1dl5rYHW7WySml9jpREx2dLJDolSMbYsn90Xfg0cKvyuhv3O61tmumilBTM/DNATzKTVpg6f+tAzgu7DetAFRpllh3r8GebQhrgfHCSKgkKeRrl/IwaqYWIspDhMjUluoNzyjCd8WZLJwsdFFetVqZ6Tg2HL+oupLX2NHTDryyN8MB6EKWX1sCTdKa+6B/+q7p1ZwHFZuW8dd5gB3WOXpK8L+wN7MuRF8Yb6XvU/viEzXaQHM/mOOV0JKktoeTmaPRMXgiV4rChYu43K2IfDpVigoR8vNHWYtCLUxwLkp3jh/B1CzTfJRyLTu/QsqNLlmMIr/Mt8DXgSYMKB+VBTwPYQRjOXpgAkiW2TfZCjD2fO; 4:5wPOtrNDsitd9yXHQs2ljzNeLGhW7sZrQ5kuQ6gmmi7Pt93t5/gE1ufs2Hyd+QdYCEp7ZKN0S7wGumCvHR8MGBR2zVM+ImgwS0TozyhQf5orXR1asSnmFcwXtmgPAEt6jntoFC0AgfOchgINeLgst9y4ukmRajHtreVjhxZ4o2/z08bF84kzeWiNCIrNZ5Y+lkwXot/UPEWXyXTQoU2b/spSF2X/BYc1+KIW7gF//vxcNQUUaWgwWi+xf56rFp1q0i7NN3KEZq/08jcOn16JLg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3231022)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR05MB3147; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR05MB3147; X-Forefront-PRVS: 05009853EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(366004)(39860400002)(189002)(199003)(106356001)(50466002)(2361001)(7736002)(105586002)(76176999)(55016002)(305945005)(2351001)(189998001)(101416001)(97736004)(2950100002)(6666003)(5660300001)(6916009)(69596002)(33646002)(50986999)(48376002)(16526018)(2906002)(47776003)(52116002)(66066001)(36756003)(21086003)(33026002)(25786009)(16586007)(316002)(81166006)(8676002)(81156014)(3846002)(6116002)(1076002)(5003940100001)(478600001)(50226002)(8936002)(68736007)(86362001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3147; H:mellanox.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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR05MB3147; 23:FVg9o41o0eW/v1zQHbsI7As91F5CyyKxh+gnzmHBb?= =?us-ascii?Q?vxX5VrrlzG+SSQdTmIEUP2bOlPnSVPId+CdtDsL5rM4i2AWTbkH3EuBdB8Qr?= =?us-ascii?Q?SvpSuG+dVM1z3Gijre+imeDJp7S6q7LliMIaR+yt+n7Fpo8CIv8ZLBSgeNyH?= =?us-ascii?Q?Ve8dKtd8JhqxCafPU+FyzsYqhFIwmf6/OIRwlyMesy9DFG6hB1zLnXkJ/itZ?= =?us-ascii?Q?RYbOD7yBkg4SO+vqZlKe9/BNgNbiE5jsJF9F1ycT96RVOl4mwoSbQe1pIy89?= =?us-ascii?Q?3gWwzWzgExWRwVY7xIvSRvSyO1TjbPW5hVwQB3bprLYelbr1HeZ/ujTVFVmF?= =?us-ascii?Q?P4UMZnLfaaTgKAeufhmRISIeK0sdXEGP/WpLMzni9I3Fj9BDiNULAcBM+d5U?= =?us-ascii?Q?lbi/vqrr2no/njvYeAN9oJkvNSkAIGO6oFnnN1fUELAhp8zdavXRA85e8S/l?= =?us-ascii?Q?W7FgtumCZaPrIToEXWhrTa6aoha2Qk/+IgKUFHYz8N3g1LZFHzDErAinnac2?= =?us-ascii?Q?eleE7JjKKtbE2xNeqsSMjzx4j5Enkn9FJEU4wiRKCXI47AqmM2kxP/Lj+efc?= =?us-ascii?Q?RRumezZiTTDqQwHxohKYM1034PctxqnB+9EzgDtw5SnMF+Hj1YYbtfp735Hj?= =?us-ascii?Q?TCeF6V3UVXNJwbze7fV2yIW69VCi3GQBQew9PPWKm9oIydDWPt+5WqNfiQyx?= =?us-ascii?Q?fitCUcdwUV7zkaass8N1Vb0x/hAUb+Lj5hY9AizIS771EJLx3atQ//baQ3bR?= =?us-ascii?Q?Js0tIUrbazbcX7UwbQr/E3I21PJCb30taD8HP20tzkDU5UW2T1oo3iwF/cHp?= =?us-ascii?Q?G74RiJcL7OKNXm5sZloNLhcAtLc9TFBC8ZYDXM/vUCNFSpFmLIRHhrY5Ar3G?= =?us-ascii?Q?zxWBpKqe77tnZQY+qyOBE59jmgsf1ScaARWP6p4W/iDX160O5TN+DwLmHGLM?= =?us-ascii?Q?l1l4XKNACxtOqmT09cuft9qHhOUDuur1vQkK+4Pea48S8UZqZ0KHktLEUDxt?= =?us-ascii?Q?6CPZe0MBrX7jtx9VC0YxvK0iV3A+J+QAYGY59EG0VQsglGQ5v2KvqgB4ZvnB?= =?us-ascii?Q?nuuJ9pyzG8jwI5eyG1RY4+3xBzKvq3Xjz5TF8HrlmnCpDoMg6xFxDbod0AbP?= =?us-ascii?Q?c0r3R9I/avIVM1XLDDc8UDR36vy8YY/QexHo9ljz4uC8/qjjYEQWz0qPzh0X?= =?us-ascii?Q?8WjDnrxuun68YU=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 6:V2P/RBtemiThkvLMNnpZOio5v56MvHwR1DdzYI2/y5f8XQZUEayxV1oCdYmeO5pP2Jo9RJ6G2//ZvrIyNJVPpZ7mg/W6WSxlPNUS+SyXDo8NWUcHW+5c4PynSDyzUVOTqC3LGAXhhZDkpMxQyWMUrLYEpjf2WoO2VNxbFUjzGa5fc2rPtstIOecdS+Oq/J+kqVt2e91tHuaqTQCSvGyprsOcOhZpb5/8FgGLM8WA3CEynznnTgPzj0vf1oW23noQLWlPCpZWtDrj1B2if2q6Hv7f3Rny789TR/t8d7ztOEhHvecCkFWpZYJPi0ZmhdkkLScnsGKXoD5pRLXo3F3RVnIpzezt/Yp7/riGfU17SI8=; 5:dwFDZlXdYzkodOyX44bCV8hnEvavf1kwLNgOcFUNtph3b/YGSYr0ngKyp7vD7XgLOaF7qaZcAyCprFws35pd/sR6OY5hT8sMtW5rkFMFA08Q1AUZIkvCTL1997783bo/+/d3yPlQC4FyEdg9Vqk2jSzzx8QflLrsai1nXiUKg9I=; 24:45EB89ZlFN7qXhuSmhcsUMXTi7DlAeFWIDWtrrlEX2gsrHT9lldRHva0IDyimgKEYG3CPiiY0mTNOx3CBYzSJR6lxPwBWVfGGYrW0YQO1TE=; 7:CMWlpMcvEjSyVaYD1H9u4uzQV6je2Ep4+Y8+vpUng1YsNuOMX9OW0wBDXkCmVXclr5K96J/YQo0Krq+sTgSdsxKAI2/zM4BXPd2M2g62e23pGjEAITol7sHBsYzAIwnVtk45Cy4EJ0rkF9h3jM2WPkpJEyuxMHuVCiAm1ZRdZpCRjdTTA7WAkeorZ6+OA6omw6HXrN/iZQCpJoeZL9o+z2JwCrDmWJUz80JE3bmD9ZrqY0wkNCbORNnD1R63jznq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:06.9268 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c0bdfb30-f9d5-483b-530b-08d5326c1d5b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3147 Subject: [dpdk-dev] [PATCH 02/39] examples/l2fwd-crypto: convert to new 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: Thu, 23 Nov 2017 12:17:08 -0000 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/l2fwd-crypto/main.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index d4e1682c8..e88638af4 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -235,16 +235,13 @@ struct lcore_queue_conf { struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .mq_mode = ETH_MQ_RX_NONE, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP checksum offload disabled */ - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ - .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .ignore_offload_bitfield = 1, + .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -2356,6 +2353,9 @@ initialize_ports(struct l2fwd_crypto_options *options) for (last_portid = 0, portid = 0; portid < nb_ports; portid++) { int retval; + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; /* Skip ports that are not enabled */ if ((options->portmask & (1 << portid)) == 0) @@ -2364,6 +2364,23 @@ initialize_ports(struct l2fwd_crypto_options *options) /* init port */ printf("Initializing port %u... ", portid); fflush(stdout); + rte_eth_dev_info_get(portid, &dev_info); + if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) != + 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); + port_conf.rxmode.offloads &= dev_info.rx_offload_capa; + } + if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) != + 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); + port_conf.txmode.offloads &= dev_info.tx_offload_capa; + } retval = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (retval < 0) { printf("Cannot configure device: err=%d, port=%u\n", @@ -2381,9 +2398,11 @@ initialize_ports(struct l2fwd_crypto_options *options) /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, l2fwd_pktmbuf_pool); + &rxq_conf, l2fwd_pktmbuf_pool); if (retval < 0) { printf("rte_eth_rx_queue_setup:err=%d, port=%u\n", retval, portid); @@ -2392,9 +2411,12 @@ initialize_ports(struct l2fwd_crypto_options *options) /* init one TX queue on each port */ fflush(stdout); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = port_conf.txmode.offloads; retval = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid), - NULL); + &txq_conf); if (retval < 0) { printf("rte_eth_tx_queue_setup:err=%d, port=%u\n", retval, portid); -- 2.12.0