From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF97CA04C0; Mon, 28 Sep 2020 09:07:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA2F81C1FD; Mon, 28 Sep 2020 09:07:17 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id CE9AB1C137 for ; Mon, 28 Sep 2020 09:07:10 +0200 (CEST) IronPort-SDR: 69QjGpjV1ZrWz7UFQ/hPwIUni7yU5Fw/bOw4HRT8sOk0GZdu2MbGn3WlhRiOkTrVujGNWy7FHm hzir/6naS5Kg== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="141966830" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="141966830" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 00:07:10 -0700 IronPort-SDR: qSVj7mM6EtT1AOrMA4Y1oDrn0pWYB3Idf4XBXZmUeiCrPQiCQN55P83KCGq7mFSB1jbn2XolT4 c8DwxMehqzdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="414895760" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2020 00:07:02 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, konstantin.ananyev@intel.com, SteveX Yang Date: Mon, 28 Sep 2020 06:55:38 +0000 Message-Id: <20200928065541.7520-3-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200928065541.7520-1-stevex.yang@intel.com> References: <20200923040909.73418-1-stevex.yang@intel.com> <20200928065541.7520-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 2/5] net/igc: fix max mtu size packets with vlan tag cannot be received by default 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" testpmd will initialize default max packet length to 1518 which doesn't include vlan tag size in ether overheader. Once, send the max mtu length packet with vlan tag, the max packet length will exceed 1518 that will cause packets dropped directly from NIC hw side. igc can support single vlan tag that need more 4 bytes for max packet size, so, configures the correct max packet size in dev_config ops. Fixes: a5aeb2b9e225 ("net/igc: support Rx and Tx") Signed-off-by: SteveX Yang --- drivers/net/igc/igc_ethdev.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index 810568bc5..f47ea3e64 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -337,11 +337,22 @@ static int eth_igc_configure(struct rte_eth_dev *dev) { struct igc_interrupt *intr = IGC_DEV_PRIVATE_INTR(dev); + uint32_t frame_size = dev->data->mtu + IGC_ETH_OVERHEAD; int ret; PMD_INIT_FUNC_TRACE(); - ret = igc_check_mq_mode(dev); + /** + * Considering vlan tag packet, max frame size should be equal or + * larger than total size of MTU and Ether overhead. + */ + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { + ret = eth_igc_mtu_set(dev, dev->data->mtu); + if (ret != 0) + return ret; + } + + ret = igc_check_mq_mode(dev); if (ret != 0) return ret; -- 2.17.1