From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0073.outbound.protection.outlook.com [104.47.40.73]) by dpdk.org (Postfix) with ESMTP id E412E2BE1 for ; Fri, 24 Mar 2017 12:52:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=O0tcbixxdIJxWL+SGFP/ZTwBCiCfLhHxh0VtBkOUv5E=; b=WGoc/EyzRIuMKpr3kOikQyGS3YsVE+fAPA/xlBijmtNl8UKPltFOMcoJyzIIrkBeY139r3+JYvi63C0QkikGDci6nM/sNLyDzHKbUvzj36AeU/NCIJKN0VsWebrDwNN037DzM/figwhxV+iaVJ3ujLbYlLG5NZrfP2Nm07eSpwk= Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from b.semihalf.local (31.172.191.173) by BLUPR0701MB1027.namprd07.prod.outlook.com (10.160.35.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Fri, 24 Mar 2017 11:52:20 +0000 From: Andriy Berestovskyy To: Thomas Monjalon Cc: dev@dpdk.org Date: Fri, 24 Mar 2017 12:52:05 +0100 Message-Id: <1490356325-15434-1-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490288768-8114-1-git-send-email-Andriy.Berestovskyy@cavium.com> References: <1490288768-8114-1-git-send-email-Andriy.Berestovskyy@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1PR0602CA0002.eurprd06.prod.outlook.com (10.175.26.140) To BLUPR0701MB1027.namprd07.prod.outlook.com (10.160.35.19) X-MS-Office365-Filtering-Correlation-Id: 4a86d6c3-30af-4cb1-7820-08d472ac3a5c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1027; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 3:IbYvyWgiidIGalCfFO767OffNd79fEUc2FO9sWyimqdw087ZUfuA9AkhDJAI9oKETjccJllaVVwUSB/WIhTxcqywyJN2FdqrneZTF+tSR/UgsRRNUfDQED0+NRGZvnYne2et/qf5qsB32ozzCbDRX67PomIpj7o0IARCrUdkDzvIu52AAfy+BtfGsR+xm78/TDqJCgoMBpnrT1hC4YOv4/Hh9vNQ9pU3Gf1bjrqmmnEo9Zi0tv1KxDYNTJzdIHqblpcqIdN6cod8X6BffpfMNQ==; 25:hZQiR0zDEry+sqcQmlR0rrPEMHBSK91iOTEeCS3PLc+a6Z5tonU3lFF7f3Y6w/6wLfQNQ8axEl+zXzmdqhvCSBGQSFF3mM0uN6f4JY1ucSQBfpixV2+ubrKwaDJYkNA8201Gzed1Bl+qhZvhYufzAxqgWt/04s7U2ErYslxFV9hJBZTcy7/X0rWZdi7XvRd2T5QNqz5280JMKX7/Cax6d6UeUUJxOafw4faVDbg33yt7wVUDKfvn1Qmb8D/dZNs0KrQJZjQan6loyZcNlBns75OZJdc3lI4MGEPtG8e+D1hNF2D4bK6+His+stJgW4V9hwQg3kjPIdSxsF2IF8dMkmOyJ8/rB5ofnLHzsCAFDuxDRjVzy7+arL4WXH6520HaJMo1cxnOAwYXdPYf2tjqd9KrnfX4xbQLZicZ1ul5rezub7tdW4HI7iBKPOdEFlNjkiuIg8biZ6qar1cM3Ay+Gw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 31:7e7BvF3aokUucVyYROjAIOpiWxp89e1u7lnmbMZWLB338EhFmaDKYuvEFBwEanIX0CX2xZc7O15twwb7GToqFfjLyrQR6lpaNfVY/Vr52Z8I8qg/WG2uuNa8fcHo0kqDqCAPkHVMSRpzRmD+wgkOMQwYFysG8cWESHUp2479tauDjnFcrGk9XED9m9T4HGXxi6sfN8rnE/ldTexYW+37YgrrdZPRDcCm1Zx9OXeR0SD8pFsCxVVctcE3jE2tRWTI2B0eD/k+q7HMxOotZqGK6w==; 20:xNFlzkdyoSuPrlzNd3zyC6ZA+PgPCw+SIoCpXWKEIYPBhVxwKUow99JMCGEi0YmKTcZwm/a1rmwie6qlfr0ZTHshX2AVaHVmknVBc1yCxQhPSkIZyve5bIzyvalOpTXcI8lgvzZ7h10zC3FUvwxUe5tphzFiEfsOng0f+zLwU+b2Xbc4UaY4A3FNPq7lUzlCqI4C02o7ezrJJF3zNGt4odV2y8lj/6vUkfp85p+MOyWZAR4r0Qdxf7WQCxD9dvgWSnvkt26/0oy3IOnsJ947wVtBAmkCbh9pujLWFBAmKEmfMF9gA01Kl3/itLRHQSQbXlcNHVhQgBVJ4TTMvjYNPgFuZMFEIwZ/E85Nqhw1vOE0anJd8ShMFSsPdewfjTh4w5ElkqM1kC5BEwcHhy1DZ9oqVH2mFE1O7fMcXuaUPnpDI6E66lR+OOCpffGuWkhVZh3BkSAOa+ArPbOgQBZADEEBNFQZOHFCBPFjkikph2pgh1TidnGoOdbWyjZqn6ZOM/HYXYxKsPsdIQCYU+4dfP0HWqYiEGxJoZ7iqW63CraePxtBG+DEJL0+UmS32lJgft69IKm2RkHGt8ZbT5zYsDcvLdOuNYjQWqOM9NGC+/U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123558025)(20161123564025)(6072148); SRVR:BLUPR0701MB1027; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1027; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 4:3h/vOoDgNItzQV2WNKRwCbqiy44LvZTF3qQwSEsUk37v9rxo3ySRHX8L7E7i7/QDZrZHBVD5Clauxm7prgJquffMMVulxmlRdiSZDVJ6uhILdTdKIc0ZUHyG/yBwovy+48cGo5yAdRPgUfv03X40WcBIt4Y3IvnT7MVZgcWIyN45ejHJdvzUol2Tnvq2m715qI6vmSMA7i4ob0d3VTyKTv0NFhmaOfqr4qV34TPWVuww3+2V1uRqsWe43RjMVXfPWM9nrTUgc0E7YDYZcThBL4zaahOiCswqL4vEvixVU9qLpBnEeChVJq+PlwzSk7fHbMUp0R55WhPC6frWnd+FbBW0yIvossqIWDvcjLpzdb+sUb9c4KMYEL8d4/I3ylAL0UfvZ6P4AHEM75YTSd2zYd4RH6aWdIigCLFew2FJGDqiKTi4sDLb+PJCw5wd3HM6qjaKfPVPVCrlKSCQLrXNpiIZ15JakJ1zAp9Q/2DdPcpZYhI8TcBQcSsBFDs6xyyIFVtEFsV5+SyvoBoRs2Lt9Cx4JRgNoEjgSUbPh7OjXmah6tfswrzjDlaoh2k2DmXKVz54Qwi7w9ijP3V3IS6uplbaYscYWV8hofqLy0dHedg= X-Forefront-PRVS: 0256C18696 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(6512007)(6116002)(6666003)(50226002)(3846002)(25786009)(189998001)(8676002)(50986999)(76176999)(4326008)(81166006)(575784001)(53936002)(5660300001)(42186005)(36756003)(2906002)(47776003)(38730400002)(110136004)(305945005)(48376002)(6916009)(7736002)(42882006)(2950100002)(50466002)(5003940100001)(6506006)(6486002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1027; H:b.semihalf.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 23:Tb6K9YhT0yWOjpnU9jww7RsQOQYa4WtRu3+90FnKfsXaM47xCIue5fsCqY9Tt8Ur2NTJQriPMW/8ccKo9/kG8TVTTRdru93qS0T28TGLhtcEvrKS2BR87ZHUvMF6M8SI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Z5mCCW0BgahenOBqwJdx6sk/fy+mv9OqVPf4RPsjs6MW0+Kzu0Lz3ZBt6tUyAbylBH7pQWcOOJoc0ND0PobNvAfa13eqf8dyDVKei7ue2Lp90vqyZzTYG3N7/tUcnAdELHQxuP24xxl6R9emc2g3yUtkg0+FcHCHB8HAEQoHxFbOgw2ddMjKfFRaMJNL0IfNQX/fAxPYxnU+NwmGQgtUuPDEmIgSgg==; 5:jpWoisdGECyszdwxYtuautssaSGVCPTioZKCclhyCJwMExdvFQ7rDqssMVyZiWH6p1q7wyuQgfsxpFDOOHDh9jPSHqURMRceTZrkbdpZI0RJUdNZsWJcXe6uGfyA+lUXN5yk4KTLAv3QGNcFbUPytA==; 24:wNS2mIF4aVMeq9H/xIsA4uxNR6/hJPEOMqeaUBTsIcNgW4bv2BPseZ3ETNw7ntzcVCPZma+CTL2Wnnu9jivJag6fMWG2d0Q/qQeNqqiN/z4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 7:tK3OeRf0w24YBiYH8N7Oz/vALk9SR5KtCzg9t9FuTMNpvOqV4m81RRYIKHzh8CespLkEPsAUZ8VDBWiCAwPuNk9cZyavIrbqkw5/ONWOm5Vmo6V01tQhijroyIc7yD1Gi6YSKL9LGq/JZ00JCb0BeJdwLfoPg+b0ERdw+P6hxzRe3WsUpkmzyokWuo2xzsD6n0gNsrcMVJd5Ywp+Iyj6Qo0C87JAiclR8DxJHw4puOEEuMg5JnpgNUzbyLrjfA/RiKG/snm3XEIubTMErpWcYW6jefPFfHNHCHuRc3zKPVFp/O5qA1+eAC7Zw6jv4CgjRZyKnY0Fkjvnanm1Hp1mUw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 11:52:20.0458 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1027 Subject: [dpdk-dev] [PATCH v2] ether: use a default for max Rx frame size in configure() 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: Fri, 24 Mar 2017 11:52:24 -0000 At the moment rte_eth_dev_configure() behaves inconsistent: - for normal frames: out of range max_rx_pkt_len uses a default - for jumbo frames: out of range max_rx_pkt_len gives an error This patch fixes this inconsistency by using a default value for max_rx_pkt_len both for normal and jumbo frames. Signed-off-by: Andriy Berestovskyy --- Notes: v2 changes: - reword the commit title according to the check-git-log.sh lib/librte_ether/rte_ethdev.c | 20 +++++--------------- lib/librte_ether/rte_ethdev.h | 6 +++++- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index eb0a94a..f560051 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -856,21 +856,11 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, * length is supported by the configured device. */ if (dev_conf->rxmode.jumbo_frame == 1) { - if (dev_conf->rxmode.max_rx_pkt_len > - dev_info.max_rx_pktlen) { - RTE_PMD_DEBUG_TRACE("ethdev port_id=%d max_rx_pkt_len %u" - " > max valid value %u\n", - port_id, - (unsigned)dev_conf->rxmode.max_rx_pkt_len, - (unsigned)dev_info.max_rx_pktlen); - return -EINVAL; - } else if (dev_conf->rxmode.max_rx_pkt_len < ETHER_MIN_LEN) { - RTE_PMD_DEBUG_TRACE("ethdev port_id=%d max_rx_pkt_len %u" - " < min valid value %u\n", - port_id, - (unsigned)dev_conf->rxmode.max_rx_pkt_len, - (unsigned)ETHER_MIN_LEN); - return -EINVAL; + if (dev_conf->rxmode.max_rx_pkt_len > dev_info.max_rx_pktlen || + dev_conf->rxmode.max_rx_pkt_len < ETHER_MIN_LEN) { + /* Use maximum frame size the NIC supports */ + dev->data->dev_conf.rxmode.max_rx_pkt_len = + dev_info.max_rx_pktlen; } } else { if (dev_conf->rxmode.max_rx_pkt_len < ETHER_MIN_LEN || diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 4be217c..2adfd77 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -349,7 +349,11 @@ enum rte_eth_tx_mq_mode { struct rte_eth_rxmode { /** The multi-queue packet distribution mode to be used, e.g. RSS. */ enum rte_eth_rx_mq_mode mq_mode; - uint32_t max_rx_pkt_len; /**< Only used if jumbo_frame enabled. */ + /** + * Desired maximum RX frame size. Too short or too long size will be + * substituted by a default value. + */ + uint32_t max_rx_pkt_len; uint16_t split_hdr_size; /**< hdr buf size (header_split enabled).*/ __extension__ uint16_t header_split : 1, /**< Header Split enable. */ -- 2.7.4