From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C3DCE5965 for ; Wed, 21 May 2014 17:31:13 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 21 May 2014 08:31:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,880,1392192000"; d="scan'208";a="535510755" Received: from shilc102.sh.intel.com ([10.239.39.44]) by fmsmga001.fm.intel.com with ESMTP; 21 May 2014 08:31:22 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shilc102.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s4LFVIB0006154; Wed, 21 May 2014 23:31:20 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s4LFVFSH005178; Wed, 21 May 2014 23:31:17 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s4LFVFqS005174; Wed, 21 May 2014 23:31:15 +0800 From: Helin Zhang To: dev@dpdk.org Date: Wed, 21 May 2014 23:30:21 +0800 Message-Id: <1400686221-4696-23-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1400686221-4696-1-git-send-email-helin.zhang@intel.com> References: <1400686221-4696-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH 22/22] ethdev: support setting maximum packet length to less than 1518 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 15:31:14 -0000 In ethdev, it will ignore setting maximum packet length to less than 1518. The changes is to fix it and let less than 1518 can be really set for maximum packet length. Signed-off-by: Helin Zhang Signed-off-by: Mark Chen --- lib/librte_ether/rte_ethdev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 1e2a16e..daa191b 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -553,9 +553,13 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, (unsigned)ETHER_MIN_LEN); return (-EINVAL); } - } else - /* Use default value */ - dev->data->dev_conf.rxmode.max_rx_pkt_len = ETHER_MAX_LEN; + } else { + if (dev_conf->rxmode.max_rx_pkt_len < ETHER_MIN_LEN || + dev_conf->rxmode.max_rx_pkt_len > ETHER_MAX_LEN) + /* Use default value */ + dev->data->dev_conf.rxmode.max_rx_pkt_len = + ETHER_MAX_LEN; + } /* multipe queue mode checking */ diag = rte_eth_dev_check_mq_mode(port_id, nb_rx_q, nb_tx_q, dev_conf); -- 1.8.1.4