From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f42.google.com (mail-vk0-f42.google.com [209.85.213.42]) by dpdk.org (Postfix) with ESMTP id DD3AA2C5A for ; Tue, 19 Apr 2016 22:16:37 +0200 (CEST) Received: by mail-vk0-f42.google.com with SMTP id t129so34055323vkg.2 for ; Tue, 19 Apr 2016 13:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infinite-io.20150623.gappssmtp.com; s=20150623; h=mime-version:date:message-id:subject:from:to; bh=5icbxqBfsohCDhsFSK1fpn5vhcDKMo2RxQoqmhQrWcY=; b=vR5riqRnMVL3aYmKAEBU2J+5iK32rar8Lg5j/j+K0RlHGTJ9nwwyQadAgjDSoGt9Zl zhaApsE0jJNZ5ai1Jthku2Y/bv43lOwvYtnhjspKNeuM4LGWu3vI8RaTipHepoRtKs25 htSRlr5bqX8nrRK4kv7ct0b5Pm6gNpbiiR4cRcb3UMhCAfufXtUYj5Y2506Lw8Kr6B4p GApXmsQLYMDmHRQ9daS0xjvYX0/M8bOhJp/Qf+2oJ4ACe81dKSp++pNM4Wj7RWU3wOlv SnQOoK3s9gZENHJl2uWNQWrgAa7HCx9qyb26PQ0993JNyJnOPV8T1/BXgqGBjJPIlhjI rSTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=5icbxqBfsohCDhsFSK1fpn5vhcDKMo2RxQoqmhQrWcY=; b=UdToR5k62Mv2SnbKOhhjrdX7jh8Yerc7ycrFND4aYeODg37Ic/bLDY5JAA9AZG2vH7 Eb0QI3t8FRYjfCy1++Esnt1g9bX++q4FZpNYTpM7LlX0nymt3Wj+lFK4/cmmfy/t84xT AKCdLPdQg4xVx6OAeGDSwqFrvnsfeKTFjMIcrs0jVHt2rlN9//IlZjVjD2ULM91QoOWf By+gzMbjswjktC5R1ZoDvSQ9SjV+vlvXoHPBPknX1+WM2DCPuVilSuMG2hEb8D2wzkOu W8swMDZHjnvfbl6JH3yvO8Tu58QpErYilE3B/ro0joxwIDmQwmDEiZZDEmQDnPu9vZWO h1bg== X-Gm-Message-State: AOPr4FUo66lrlLpWt6v9vSTwqQ0BvmKYJwPo/fcdCKStXSmnP/trvhK5vVdlylcy+//wZiB/n8uwxvj5A1qxOA== MIME-Version: 1.0 X-Received: by 10.159.54.239 with SMTP id p102mr2403496uap.99.1461096997239; Tue, 19 Apr 2016 13:16:37 -0700 (PDT) Received: by 10.103.86.14 with HTTP; Tue, 19 Apr 2016 13:16:37 -0700 (PDT) Date: Tue, 19 Apr 2016 15:16:37 -0500 Message-ID: From: Jay Rolette To: DPDK Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Couple of PMD questions 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: Tue, 19 Apr 2016 20:16:38 -0000 In ixgbe_dev_rx_init(), there is this bit of code: /* * Configure the RX buffer size in the BSIZEPACKET field of * the SRRCTL register of the queue. * The value is in 1 KB resolution. Valid values can be from * 1 KB to 16 KB. */ buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) - RTE_PKTMBUF_HEADROOM); srrctl |= ((buf_size >> IXGBE_SRRCTL_BSIZEPKT_SHIFT) & IXGBE_SRRCTL_BSIZEPKT_MASK); IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxq->reg_idx), srrctl); buf_size = (uint16_t) ((srrctl & IXGBE_SRRCTL_BSIZEPKT_MASK) << IXGBE_SRRCTL_BSIZEPKT_SHIFT); /* It adds dual VLAN length for supporting dual VLAN */ if (dev->data->dev_conf.rxmode.max_rx_pkt_len + 2 * IXGBE_VLAN_TAG_SIZE > buf_size) dev->data->scattered_rx = 1; Couple of questions I have about it: 1) If the caller configured the MBUF memory pool data room size to be something other than a multiple of 1K (+ RTE_PKTMBUF_HEADROOM), then the driver ends up silently programming the NIC to use a smaller max RX size than the caller specified. Should the driver error out in that case instead of only "sort of" working? If not, it seems like it should be logging an error message. 2) Second question is about the "/* It adds dual VLAN length for supporting dual VLAN */" bit... As I understand it, dev_conf.rxmode.max_rx_pkt_len is supposed to be set to the max frame size you support (although it says it's only used if jumbo frame is enabled). That same value is generally used when calculating the size that mbuf elements should be created at. The description for the data_room_size parameter of rte_pktmbuf_pool_create(): "Size of data buffer in each mbuf, including RTE_PKTMBUF_HEADROOM." If I support a max frame size of 9216 bytes (exactly a 1K multiple to make the NIC happy), then max_rx_pkt_len is going to be 9216 and data_room_size will be 9216 + RTE_PKTMBUF_HEADROOM. ixgbe_dev_rx_init() will calculate normalize that back to 9216, which will fail the dual VLAN length check. The really nasty part about that is it has a side-effect of enabling scattered RX regardless of the fact that I didn't enable scattered RX in dev_conf.rxmode. The code in the e1000 PMD is similar, so nothing unique to ixgbe. Is that check correct? It seems wrong to be adding space for q-in-q on top of your specified max frame size... Thanks, Jay