From patchwork Thu Feb 13 08:49:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Loftus, Ciara" X-Patchwork-Id: 65782 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 4C0DCA0542; Thu, 13 Feb 2020 09:48:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6ACCA2BE9; Thu, 13 Feb 2020 09:48:04 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id F36351F28 for ; Thu, 13 Feb 2020 09:48:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2020 00:48:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,436,1574150400"; d="scan'208";a="313670529" Received: from silpixa00373417.ir.intel.com (HELO silpixa00373417.ger.corp.intel.com) ([10.237.223.96]) by orsmga001.jf.intel.com with ESMTP; 13 Feb 2020 00:48:00 -0800 From: Ciara Loftus To: dev@dpdk.org Cc: xiaolong.ye@intel.com, Ciara Loftus Date: Thu, 13 Feb 2020 08:49:11 +0000 Message-Id: <20200213084914.54755-1-ciara.loftus@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v4 0/3] AF_XDP PMD Fixes 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" This series introduces some fixes for the zero copy path of the AF_XDP. In zero copy, the mempool objects are mapped directly into the AF_XDP UMEM. Below depicts the layout of an object in a mempool. +-----+--------+------+------+-----+-------------+ | mp | struct | mbuf | mbuf | XDP | | | hdr | rte_ | priv | hr | hr | payload | | obj | mbuf | | | | | +-----+--------+------+------+-----+-------------+ 64 128 * 128 256 * <---------------- frame size --------------------> <---- frame hr -------------> 1: net/af_xdp: fix umem frame size & headroom calculations * The previous frame size calculation incorrectly used mb_pool->private_data_size and didn't include mb_pool->header_size. Instead of performing a manual calculation, use the rte_mempool_calc_obj_size API to determine the frame size. * The previous frame headroom calculation also incorrectly used mb_pool->private_data_size and didn't include mb_pool->header_size or the mbuf priv size. 2. net/af_xdp: use correct fill queue addresses The fill queue addresses should start at the beginning of the mempool object instead of the beginning of the mbuf. This is because the umem frame headroom includes the mp hdrobj size. Starting at this point ensures AF_XDP doesn't write past the available room in the frame, in the case of larger packets which are close to the size of the mbuf. 3. net/af_xdp: fix maximum MTU value The maximum MTU for af_xdp zero copy is equal to the page size less the frame overhead introduced by AF_XDP (XDP HR = 256) and DPDK (frame hr = 320). The patch updates this value to reflect this, and removes some unneeded constants for both zero-copy and copy mode. v4: * Deduct XDP_PACKET_HEADROOM from max mtu for copy mode. v3: * Fix send-email issue - use in-reply-to v2: * Include mbuf priv size in rx mbuf data_off calculation Ciara Loftus (3): net/af_xdp: fix umem frame size & headroom calculations net/af_xdp: use correct fill queue addresses net/af_xdp: fix maximum MTU value drivers/net/af_xdp/rte_eth_af_xdp.c | 61 +++++++++++++++++------------ 1 file changed, 36 insertions(+), 25 deletions(-)