From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0056.outbound.protection.outlook.com [104.47.0.56]) by dpdk.org (Postfix) with ESMTP id BB8551B249 for ; Tue, 12 Dec 2017 13:27:56 +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=8ERzRw+GzcxsemSy/HxJt95MmG2uSSkCMvwjuyK+5ms=; b=OaVPEaX25+oy4chFbvKB8DkNPl8O3Pf7XL5oJmwo8rP6rTsyn0RSu+50X/0N1rq7PxtLZH3785c5tkA+yhjr7MstzNRJIwfJndj2s76MzL07Ee67hvheolLy9Juww21YWOViWY38cJwrUTlkf4RV3l54RV+HH3ECMQQqD5eTe4A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:27:54 +0000 From: Shahaf Shuler To: dev@dpdk.org, konstantin.ananyev@intel.com, radu.nicolau@intel.com, arybchenko@solarflare.com Date: Tue, 12 Dec 2017 14:26:40 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::20) To VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60492b1f-68af-4bca-3aa0-08d5415bc576 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3149; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 3:Ig54gtgXE4D58enWOUIyXRN9BegZmZUmpStb1wH6DxKn22veeUAWaRxAHEFHYW/SiySbzrVdMd3Sd+gB/+7I66jgLVU5rlAu0OaRt9EtVbKecu36e5M5i/PFzb+HqKc0oIGTyfeF3mh1ZvbyHfVN6GfG8Gmgek7WV+ZL0fcdZI1Id9CcAgWVsmLGy3VHRv0wNyUTT8EHgjccu4ed6nqNBm7lw8LmgnpNLasznQ++Stxv1C7133rGAs/KbcljXk98; 25:CKVj7l5AxU7ishrquxATHuGid2BPUoBmFOcGIm1DFo/qYQK0Vq8bAH2BOl2TgIyTTzgUUKBN4IMQBpnKMKP+TxSC6niHeHPqgpRCVmJsiV55UP1WysrfyZrb2jY/IfsuhnyKsaW7346Bqg1N6FIVFSBPe65CQnR+XKq/ykNWSHWobjsipxlsonN7/YKSl9ZRCYN0CzC8RBXIr5Up9gwmG7ODvFt0QcH/oopEg2E6KA483tXWiQmC3QfvyKh4VRIzA40Zf+/unja9DEN68KkU1t/Po+AZkjds/bgsGQrdfRueOwOblOBva1BMX3iVqbaYtYTW9MVmbbEdWCpB+ZQOfg==; 31:kDsRvMNpdkJIO12/SUjOUEepOu/vNw/2bg1m7fKn8nhZRrBm3yF6czGinX/e6ua2LSJUTabWtJ1GEUIAa2VE4Kx+IVv4eZGFTgX99qvAWGCNljAGCpDXtgYMxASkaF2CjT3zbFk3hEMGxhypo3cEF7zHtVYBNsczbHflrhTqoWMheD1tSY8wj+a2iaTQprS/YlRSzbY8jtAVhVQ8uSAziEqCYQn9RZ027UBvQmcf5xc= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:WbVOA6Eay0z0xoNAPahH8/2P39nAeopmta/qo2C8EZI1eNxZw0/G6EqJGhiLvZYZaMjLRWCxAX6qv1Jy6YWcN+QsI8GqAjgabE94y92sLCLdxqyeqYG+T580i7WsUdhMFRWuUbL47Qy+VCai4u1m5W/fTvpgjaVD9uz4vGdCFLR1/kOMMzju/wxC+OXDxlstC2HByN2zvCcOQQQv78L2f9/Ut8SeQDINMqWQ7PSdtlxlGfvGDjVkga7MXAj1OqdwGWh5q85gDnW0OcZBoKrFKujoIHaJfUK3td2l74ZQpo41yosfDVniYnSrQwMcdJMsfvzPThUCrs50G8NAr+1tkHEZua9qsfczshuB9t99f9E1E1gDboO3/4Xh8QTCJLOcfrcznLqsgaDbKeET9dIBLyN0nfwuiH/Qf8lyErLAyD4KKngQgk6CE1DH6L1X+1SAs3KYF9sbV2xMU91gNpFWO4+rAHBzVkvTmO5fwryKL2DkE7UAy0jzWptEHJnaI0Hn; 4:LBRRa2RVuFsP55k7fKu4V15wQ61TM/ShywL/vgrIpEw07266bv3X7F0CY5ZoZji68whSc+OQ/tTCaQbwgL8C5FBb536lFgzzZBSAw0XA96mGhvN9pSDVbdXjv8FYyQzQnnWYouGA8yDk6uglC5TGPldo/nnZUqIRRIvFHEey7o5knsHmwsizN8ridEKDiMNhpAYyMAMQOKCbR6fS8lCkEeHFTciA504Fgrbi+0aGr15QHZtPKW+XbmeZllKsg5g6MLVL8oV5haOyLv6YnQm3zA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3149; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3149; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(366004)(189003)(199004)(7736002)(8936002)(305945005)(66066001)(3846002)(5660300001)(47776003)(6116002)(2906002)(69596002)(68736007)(48376002)(33026002)(2950100002)(50466002)(81166006)(21086003)(81156014)(6666003)(8676002)(106356001)(105586002)(118296001)(97736004)(478600001)(51416003)(25786009)(316002)(52116002)(7696005)(50226002)(86362001)(55016002)(36756003)(59450400001)(76176011)(16586007)(53936002)(16526018); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3149; 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; VI1PR05MB3149; 23:pQcLvchkLXtB97v4kL3XxeTGoErwsBNm7tTsetien?= =?us-ascii?Q?mQ78ACZ/kipuvIrgrb1KhH8tfkBHkHeb+lDEdKWrk/smyaE7suRBm69PNzJ9?= =?us-ascii?Q?DuTbdmhsbD6DjT+6L4i7UsYc7amH6EEymCaxh9E9Aykh5TIXAYI90+o9pN5w?= =?us-ascii?Q?JZROxQaqfrE7r8KFwyOH62OXgZCR7C0KUOv3iO6IiclPAOESafH4pSv7gDzM?= =?us-ascii?Q?kjMkFbGzAiMl/Q/r3A6bqCum9VMezlu5P4iHvSJfGkGwTyd6Yzf9WKyeYFhV?= =?us-ascii?Q?FcXg0wdQMPRwSCkPBOpn3yhPKamFbNgpuen+mDVjO0hFK/iGynNq4BhxMOU8?= =?us-ascii?Q?bQE6wsjnvHzxu6IDfPmvd9/Inipa63c886UR6Q+BLGzc3jEnpbnSnCZNypWq?= =?us-ascii?Q?k1RhnmCfsLFhuo4L4+BDGyp4zl3YfIzTfVL5Y/3wcBs6xiryqnvUZcDbREgX?= =?us-ascii?Q?VazwYU7lkdSRlGENXE5NlhLCiugCxqnRTIHeg7uxOnAn/FUdSJOdcDmjKupK?= =?us-ascii?Q?iFvb5dFIsGhys+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dzJhycc9EWWPzWSwWHiI/xlwasgMpILsNGBYlMGMzVhoWwKpXBgy4SOsRzmlbSVw5RAHBxvgIU3gZxipasgbG/DNX9t7eIneArwD/T2OqjKyguGw0UubwM8Gxyy/AqS9pnPfjZ3jp7gvCOAKQJtmZVJsXqvk5r3Z/Lqeg5u/K0=; 24:yb2T8fUP/L6Pbd8L8No78X7bigG+8RYddag5AQ2PlW+UxLrwhfIffTQc+xm29vIiNNSMcACJYftd869ciw5v6dm6wFjwMTYD+umigz6XUHY=; 7:3/fdgMfed+NdU2w2/19Prr73xuXHV+dQD4HuQrvGqMCjZrLazznjSJrtXbIhbkZa7k+MY+/vopV0OrYuhPLtx24yB2uE+vpxcNWOWRX8ps6/0p7TOAviPazYxQfGk61aDQAk8YapBtBWdkYQF3OJGM401lqd4DzC3RJ3GMytlNA/I+TxicH2ui3WyfJTZ7uDoGr1NLgRJO90+yFDrO1F8IL8dO3AHjNFC1ONWaO1U8CrmI9ok8cJ8cUhEvZ3vbjB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:54.4576 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60492b1f-68af-4bca-3aa0-08d5415bc576 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3149 Subject: [dpdk-dev] [PATCH v2 23/39] examples/qos_sched: 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: Tue, 12 Dec 2017 12:27:57 -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/qos_sched/init.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 038f042..696e15d 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -84,18 +84,16 @@ struct ring_thresh tx_thresh = { int mp_size = NB_MBUF; struct flow_conf qos_conf[MAX_DATA_STREAMS]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .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_DCB_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -104,6 +102,7 @@ struct ring_thresh tx_thresh = { { int ret; struct rte_eth_link link; + struct rte_eth_dev_info dev_info; struct rte_eth_rxconf rx_conf; struct rte_eth_txconf tx_conf; uint16_t rx_size; @@ -125,12 +124,27 @@ struct ring_thresh tx_thresh = { tx_conf.tx_thresh.wthresh = tx_thresh.wthresh; tx_conf.tx_free_thresh = 0; tx_conf.tx_rs_thresh = 0; - tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; tx_conf.tx_deferred_start = 0; + tx_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; /* init port */ RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", 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); + } + 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); + } ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -149,6 +163,7 @@ struct ring_thresh tx_thresh = { /* init one RX queue */ fflush(stdout); + rx_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size, rte_eth_dev_socket_id(portid), &rx_conf, mp); if (ret < 0) @@ -158,6 +173,7 @@ struct ring_thresh tx_thresh = { /* init one TX queue */ fflush(stdout); + tx_conf.offloads = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, 0, (uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf); if (ret < 0) -- 1.8.3.1