From patchwork Mon Nov 2 08:52:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 83365 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1F51A04E7; Mon, 2 Nov 2020 09:54:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 66CA1BBB4; Mon, 2 Nov 2020 09:54:09 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id CEBF7BBA4 for ; Mon, 2 Nov 2020 09:54:06 +0100 (CET) IronPort-SDR: B+pUcTsX2Jxxs2uqP8+cj0EXVVLpZydxx/shPwtlfpOx16+vLj2iGEd8wOybJorwUSe8Yjci5M Z/3PmoQiKtkA== X-IronPort-AV: E=McAfee;i="6000,8403,9792"; a="253562017" X-IronPort-AV: E=Sophos;i="5.77,444,1596524400"; d="scan'208";a="253562017" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 00:54:06 -0800 IronPort-SDR: ETc+/n8yy2utQ4CYRfH+c0Y3ajKr2OB+LWZ2RRsjz71p95/pIZLfCc7V6SuITxet20/YFrHMXR YkHpBQ8ddD5A== X-IronPort-AV: E=Sophos;i="5.77,444,1596524400"; d="scan'208";a="537939364" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 00:54:02 -0800 From: SteveX Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, konstantin.ananyev@intel.com, beilei.xing@intel.com, wenzhuo.lu@intel.com, bernard.iremonger@intel.com, qiming.yang@intel.com, mdr@ashroe.eu, nhorman@tuxdriver.com, SteveX Yang Date: Mon, 2 Nov 2020 08:52:33 +0000 Message-Id: <20201102085234.72779-2-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201102085234.72779-1-stevex.yang@intel.com> References: <20201028030334.30300-1-stevex.yang@intel.com> <20201102085234.72779-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v8 1/2] app/testpmd: fix max rx packet length for VLAN packets 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" When the max rx packet length is smaller than the sum of mtu size and ether overhead size, it should be enlarged, otherwise the VLAN packets will be dropped. Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines") Signed-off-by: SteveX Yang Reviewed-by: Ferruh Yigit --- app/test-pmd/testpmd.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 33fc0fddf..c263121a9 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1421,6 +1421,7 @@ init_config(void) struct rte_gro_param gro_param; uint32_t gso_types; uint16_t data_size; + uint16_t overhead_len; bool warning = 0; int k; int ret; @@ -1457,6 +1458,28 @@ init_config(void) rte_exit(EXIT_FAILURE, "rte_eth_dev_info_get() failed\n"); + /* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */ + if (port->dev_info.max_rx_pktlen && port->dev_info.max_mtu) + overhead_len = port->dev_info.max_rx_pktlen - + port->dev_info.max_mtu; + else + overhead_len = RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; + + port->dev_conf.rxmode.max_rx_pkt_len = + RTE_ETHER_MTU + overhead_len; + + /* + * This is workaround to avoid resize max rx packet len. + * Ethdev assumes jumbo frame size must be greater than + * RTE_ETHER_MAX_LEN, and will resize 'max_rx_pkt_len' to + * default value when it is greater than RTE_ETHER_MAX_LEN + * for normal frame. + */ + if (port->dev_conf.rxmode.max_rx_pkt_len > RTE_ETHER_MAX_LEN) { + port->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + } + if (!(port->dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)) port->dev_conf.txmode.offloads &= From patchwork Mon Nov 2 08:52:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 83366 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 93D0DA04E7; Mon, 2 Nov 2020 09:54:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 712E7BE4B; Mon, 2 Nov 2020 09:54:12 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C6C89BC66 for ; Mon, 2 Nov 2020 09:54:10 +0100 (CET) IronPort-SDR: rpHRW56w/vyPveZJi+91EJfyXn2hSgvfGrMdy5VV16wnX7WXPdJ6wFUB612DgopC5xDwlXDVZE rtWD06nQRO1g== X-IronPort-AV: E=McAfee;i="6000,8403,9792"; a="253562021" X-IronPort-AV: E=Sophos;i="5.77,444,1596524400"; d="scan'208";a="253562021" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 00:54:10 -0800 IronPort-SDR: SdcMGVq5vWmG89gIKwojCaFdlNcLhzERDuDMNQjrriAeOqGAy+NW2Om7+GUvfAY1aGJy2tszl8 jVh164qQPbbA== X-IronPort-AV: E=Sophos;i="5.77,444,1596524400"; d="scan'208";a="537939387" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 00:54:06 -0800 From: SteveX Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, konstantin.ananyev@intel.com, beilei.xing@intel.com, wenzhuo.lu@intel.com, bernard.iremonger@intel.com, qiming.yang@intel.com, mdr@ashroe.eu, nhorman@tuxdriver.com, SteveX Yang Date: Mon, 2 Nov 2020 08:52:34 +0000 Message-Id: <20201102085234.72779-3-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201102085234.72779-1-stevex.yang@intel.com> References: <20201028030334.30300-1-stevex.yang@intel.com> <20201102085234.72779-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v8 2/2] doc: annouce deprecation of jumbo frame flag condition 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" Annouce to replace 'RTE_ETHER_MAX_LEN' with 'RTE_ETHER_MTU' as type condition of jumbo frame. Involved scopes: - rte_ethdev; - app, e.g.: test-pmd, test-eventdev; - examples, e.g.: ipsec-secgw, l3fwd, vhost; - net PMDs which support VLAN tag(s) within overhead, e.g.: i40e, ixgbe; Signed-off-by: SteveX Yang Reviewed-by: Ferruh Yigit --- doc/guides/rel_notes/deprecation.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 2e082499b..fae139f01 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -138,6 +138,18 @@ Deprecation Notices will be limited to maximum 256 queues. Also compile time flag ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` will be removed. +* ethdev: Offload flag ``DEV_RX_OFFLOAD_JUMBO_FRAME`` will be set according to + ``RTE_ETHER_MTU`` in next release. Currently, the jumbo frame uses the + ``RTE_ETHER_MAX_LEN`` as boundary condition. When the MTU (1500) set, the + frame type of rx packet will be different if used different overhead, it will + cause the consistency issue. Hence, using fixed value ``RTE_ETHER_MTU`` can + avoid this issue. + Following scopes will be changed: + - ``rte_ethdev`` + - ``app``, e.g.: ``test-pmd``, ``test-eventdev``; + - ``examples``, e.g.: ``ipsec-secgw``, ``l3fwd``, ``vhost``; + - net PMDs which support VLAN tag(s) within overhead, e.g.: ``i40e``; + * cryptodev: support for using IV with all sizes is added, J0 still can be used but only when IV length in following structs ``rte_crypto_auth_xform``, ``rte_crypto_aead_xform`` is set to zero. When IV length is greater or equal