From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0062.outbound.protection.outlook.com [104.47.36.62]) by dpdk.org (Postfix) with ESMTP id 8B8501B53 for ; Thu, 23 Mar 2017 18:06:33 +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=xui4EOy+8yuFvAh2/2NHu4KvUGdasqR0/RExXV9dewM=; b=B5C17k2xJ3wWTm0seCvZSy7lxTaNRtuRi8GtR1oOLsYlk6xFehJaRQJSdAzPFVTUILNw+QtKknQRQdHmKzyZ7md0XiJQ4/chyGZwPEULru7bXL7jIzzxhbIQ2k19MMiDtSj7yen/RAUukQkjGrm686PKCsTcGDO53x8pLlrYZFE= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=cavium.com; Received: from b.semihalf.local (31.172.191.173) by DM2PR0701MB1036.namprd07.prod.outlook.com (10.160.25.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Thu, 23 Mar 2017 17:06:30 +0000 From: Andriy Berestovskyy To: dev@dpdk.org Date: Thu, 23 Mar 2017 18:06:08 +0100 Message-Id: <1490288768-8114-1-git-send-email-Andriy.Berestovskyy@cavium.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1P195CA0009.EURP195.PROD.OUTLOOK.COM (10.175.187.19) To DM2PR0701MB1036.namprd07.prod.outlook.com (10.160.25.144) X-MS-Office365-Filtering-Correlation-Id: df017f47-fcc7-4603-95fa-08d4720ef3b6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0701MB1036; X-Microsoft-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+m4JAfRlYk7Hfek9RoJYhOXq7zCAgIPS68eU6Wf7ZDvaAjLMYMZrI=; 20:bZZHKWMa7wX7oIwrADSw01DF9Cgde5l2KBI30+fEmDzWMeiVPU/7FeNx1YVM7J/VO5drQNNUyh4U072IadvPriFaAP8OyxHR/bN/YlU42tMPCsryxe93pnPwyIL5l0VCwwiUy3BW+TiMAvbu4rrQE4mTSeXO7oMyu4fjYylozCrqtWaiuY0cxrx6xsj8+SKPOoEFhV1hnWan9iwanX9fI+c3FuBWOSaxZo1G/9M0FFsG6HnlPWC4ZPzvCRX42YAo+Rx0XYvagUfNODKgiWqDgb7BwZNDspKO68MrA6K39+sdl1iMLRVAs8a+dmKkVnzTwtetuXH4ff3sRE2TuWY9s2R+s/K/KuGwDpmooBvL889fCqKcIwG2y6VeuAjlG1RonBX8q0QgQfwZC7WZKglCNY/EJnduXnFGTbG2jPYYGcN+y/q5vc+TdZsi1VqfUaD/iD408s88ldFIaAfmf33KgcPbtYXErz5Wo6PNbfTwOGONHzdBoxuHd9GPPFpDweJg 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)(10201501046)(3002001)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(20161123558025)(6072148); SRVR:DM2PR0701MB1036; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0701MB1036; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1036; 4:2ZiFCnrgL7PujgvW/r5fnSvzKZcQWC9yjTxbtMrIDbINlEhef3iiZDLo+kIz2rmjGqNqFh5GxqxWmBslK8A5TNxvcvh7C7BRHdMo4dJYPQE2gDO7itlNonhlNouu+rje4EeO2Lx/YyJ+YXhbD6ii/vdjB+ISYMeBQ3BpgCeEyKOh1DkTHSfxPVd3DWZUeWtQ7bfO3oRXSCePDErI+OPi5WlQ2OAunP7w1LCq4A/NnhWIipTcCfOnhICuW0k6PsPj2RhpOZcDTKsrHWeDvivNTP4UoBFvDAvIazbkH20y0RNTL1EcxjSNERcaVXfOT+1vlIj5w36hTu7pR3ImwCZqZwPBQZ7OViCLdhOmljQPII+K7xMuaQrwviSz9vrjv4HxtoPavIKPUoqQd6s0w6VXuoqU3ZiV9J3aEvTgl8Fs5JDhYMlu2V8VcYAE3I9x9XTtk8LtkRom+RVyq9ZhqG14JbdLzFGzsnDTGgQTZpPQuCofGWtLJOywGzEH9VamI9Du/njOYK/G2gL+77nur+KQkz6QLJqzsBcq/5pPOrqua93qaL2BfKxXNrkxJ20X5wHZYm7irzOF/fyN6qSib61rJs5A+Gughwhh6b6dEFwmYhw= X-Forefront-PRVS: 0255DF69B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39830400002)(39450400003)(47776003)(66066001)(36756003)(5003940100001)(6506006)(42186005)(6666003)(189998001)(6486002)(6916009)(86362001)(575784001)(50986999)(7736002)(305945005)(3846002)(6116002)(2351001)(8676002)(81166006)(50226002)(2361001)(38730400002)(110136004)(53936002)(6512007)(25786009)(2906002)(48376002)(50466002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0701MB1036; H:b.semihalf.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1036; 23:bpjL1hSDCmxdZ42+ethOhIQFEYcE47Y5Ohd0b7pvuOmz7HBweDxhusXpEDWOOmRfKJO3uufw2l1aOkyPNiLAdb/gedEC381YB8hhuEonXUefuB2mZtYdHU2sc4zNWui1sd+e7JN7JLvhv907SAZTC960MWWYu5m7hQCvECwd1g1KTIwXzZQAPh/UsuziWDLtuO2SPeUuwECO5BJEuzUK/OVbF8WtRmdyc2/+y9ps1zD9iAy3F5r38UdwhUIK6+gzzvcLwuWBglSfQ0f4apyWNIuk6hUlmLwd5j8oNoqPG6u9kpfi3t4Bjf+jhGFW2hPySt5N0YKd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2X3aAYRndyuVAnxU8ASBkJgAYGalvhDHaFB/7gO6eiKwzQ64EP5itZZl6Pi1Sz84cZGrAHGaTMXqE4M2nu7kEmG00UmXZBQyRcuTYNiKpHgyC8hDyEcnVwhjl0u61bvAyDFTwTAKBc2A==; 24:1aKsj2hQjNSvPsOFUexjCAUWXpcbrEwwWZN+p7e+2tWd5KzRRCteD4sP5NQ1UpuBJMqlnO6Ruxb+9YA/i8AaEW8GV0a2nojM+fnA3ht6FAI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1036; 7:AFDcux/Tn3M0ZuQUTdTljh6Lal4oXWXY+3aPPwxxPhNKQdZ065dt+B9bxnkts+gipLw8Z64ZqFHZtlxDhnAGcnoTpXNHLF1SBzz+1/DeAsLW4K9adwXsFVasJqR3kSL11THAuboe2otz5bB1IDjJGbpx11iuawt6FlIELrYp0HCr8oUiEnyI5s0QF/ny/NMAHcu0iTQdgRFIGlLSpfbS2g4iEBCehI6HACZNbu3vZinGVoAoDc79He9NNQF8T0aWzFcmXFt4w/PsZOhusxhCbp2jqTjbOfPA5caqJG9rIJuwg7+4zdzbe1HR3194Z+njyOmPR7nptTyaGoLX2UI64A== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2017 17:06:30.5489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1036 Subject: [dpdk-dev] [PATCH] ether: fix configure() to use a default for max_rx_pkt_len 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 Mar 2017 17:06:34 -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 --- 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