From patchwork Wed Jan 16 12:55:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ananyev, Konstantin" X-Patchwork-Id: 49882 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AF36A14EC; Wed, 16 Jan 2019 13:55:53 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2F33710A3 for ; Wed, 16 Jan 2019 13:55:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 04:55:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,486,1539673200"; d="scan'208";a="107026232" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by orsmga007.jf.intel.com with ESMTP; 16 Jan 2019 04:55:49 -0800 From: Konstantin Ananyev To: dev@dpdk.org Cc: Konstantin Ananyev Date: Wed, 16 Jan 2019 12:55:46 +0000 Message-Id: <1547643346-24486-1-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] examples/ip_fragmentation: fix fail to start on i40e 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" Previous commit sets mtu to the same value as max_rx_pkt_len. Though PMDs (at least Intel ones) consider MTU as max_rx_pkt_len minus ether header, crc bytes, vlan tags. Fixes: 73d2c1d3f33c ("examples/ip_fragmentation: support big packets") Signed-off-by: Konstantin Ananyev --- examples/ip_fragmentation/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8d789b417..e90a61e35 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -55,6 +55,13 @@ #define IPV4_MTU_DEFAULT ETHER_MTU #define IPV6_MTU_DEFAULT ETHER_MTU +/* + * The overhead from max frame size to MTU. + * We have to consider the max possible overhead. + */ +#define MTU_OVERHEAD \ + (ETHER_HDR_LEN + ETHER_CRC_LEN + 2 * sizeof(struct vlan_hdr)) + /* * Default payload in bytes for the IPv6 packet. */ @@ -938,7 +945,7 @@ main(int argc, char **argv) /* set the mtu to the maximum received packet size */ ret = rte_eth_dev_set_mtu(portid, - local_port_conf.rxmode.max_rx_pkt_len); + local_port_conf.rxmode.max_rx_pkt_len - MTU_OVERHEAD); if (ret < 0) { printf("\n"); rte_exit(EXIT_FAILURE, "Set MTU failed: "