From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2B020A0C4E; Fri, 15 Oct 2021 16:06:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16822411CB; Fri, 15 Oct 2021 16:06:27 +0200 (CEST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 59238410F1 for ; Fri, 15 Oct 2021 16:06:25 +0200 (CEST) Received: by mail-wr1-f44.google.com with SMTP id v17so26674381wrv.9 for ; Fri, 15 Oct 2021 07:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=7A15o9I082zljNJinzP+TI8pPsIQjFaOKW69QvwQOHA=; b=CPK+i15841CWY4V3/kCp6l8AQ5ZlIXtnaEeCdo8Qw6q2TcYZbiuGSq4HzN7WuvVuWB EKOxuSryxN9flhQSaGraTFRymplyXOw9tmWfDc+Ai2BkXUkyGxdn7t885dZUDeJg2aqV jnvApthGw2Pdh9aG5oTG6kbJhMwzxUgEQgP1WqkKbhxVcwKHWmKD8pEglkMIYe3hkXLL fP2gAzOgsFs8vBQDNlookEX95zkJSLLXGlO1TcFpUsHASlZT4ySu/Ngqe88kvddOeCj0 rZ2gJ0auUU/2Xvv69Ww9IzPJncAeIIvid286LK8wiQ8IebZAWs35c2znW66rcItEuRSY AzSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7A15o9I082zljNJinzP+TI8pPsIQjFaOKW69QvwQOHA=; b=1JpHZ7YrJfCQjf9y09wnJgctE0a4rfnCQVMhuF+Y6dgvKp3TBS8ly6CjnzeoolQhbM k7hBwzvzXCnqaLe/e6vKsWYqCLyvhLH5TPVradYep/qAnMhCFOiQ70h+T0vAna0NCBW0 2Ht8ws7dqckNx7r3c1VK7v9eHPSMSCFFZJFjp5apCK5My1lAo2AKBxKA8XE1cUGU8XJv hsyYUVlNHw+1NvstLsNaQEwp0PVbCPdCr1F6Ytxczg0WhaIQgd9Tne5EA36zQR7DuyQk QlEbUNKZlWD4pD/gh5NXVUrXn2lkuCGrPHuRbRf7e+f9Yt/j+Xu5U5zb+ft+YpnoZXRC TDNQ== X-Gm-Message-State: AOAM533WJtE+/ZJAgqAWg4fDi/VGfXqG3vhdRqyq8f6ye+AoNmu4LPmk u0F62dM69AXbvCY8EIO28H5tMLYzsj+NJg== X-Google-Smtp-Source: ABdhPJxFt89bNr4UGojv1pGM+NdGxaz92UvHXsmXvLowKAwCDM82c6aIk8M8hqkuZUIY0hNK9X0rPA== X-Received: by 2002:adf:bc52:: with SMTP id a18mr14830131wrh.245.1634306785118; Fri, 15 Oct 2021 07:06:25 -0700 (PDT) Received: from tucornea-dev-machine.localdomain ([193.226.172.42]) by smtp.gmail.com with ESMTPSA id k10sm10462453wmr.32.2021.10.15.07.06.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Oct 2021 07:06:24 -0700 (PDT) From: Tudor Cornea To: qi.z.zhang@intel.com Cc: alvinx.zhang@intel.com, haiyue.wang@intel.com, dev@dpdk.org, Tudor Cornea Date: Fri, 15 Oct 2021 17:06:09 +0300 Message-Id: <1634306769-20123-1-git-send-email-tudor.cornea@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] net/ixgbe: initialize max_rx_pkt_len if rlpml_set_vf fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" It seems that if the call to ixgbevf_rlpml_set_vf fails, we will not initialize dev_conf.rxmode.max_rx_pkt_len correctly anymore. This happens with a 82599EB NIC and a VMware ESXI 6.0 setup, and is causing VF the ports to fail to initialize We see the following error: ixgbevf_dev_rx_init(): Set max packet length to 1518 failed. Investigating over DPDK 19.11, it seems that the call still fails, but it doesn't exit prematurely, and max_rx_pkt_len is initialized in the respective case. On the ESXi server, we seem to have the following driver net-ixgbe: 3.7.13.7.14iov-20vmw.600.0.0.2494585 It seems that the behavior related to MTU setting has changed since the following commit: commit c77866a16904 ("net/ixgbe: detect failed VF MTU set") We would like to still be able to support older setups if possible, as we might have customers running ESXi 6.0 or 6.5, and these seem to have an older version of the PF driver as default. Signed-off-by: Tudor Cornea --- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++-- drivers/net/ixgbe/ixgbe_rxtx.c | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 4dbe049..4301dfd 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -6369,6 +6369,9 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) return -EINVAL; } + /* update max frame size */ + dev->data->dev_conf.rxmode.max_rx_pkt_len = max_frame; + /* * When supported by the underlying PF driver, use the IXGBE_VF_SET_MTU * request of the version 2.0 of the mailbox API. @@ -6381,8 +6384,6 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) if (ixgbevf_rlpml_set_vf(hw, max_frame)) return -EINVAL; - /* update max frame size */ - dev->data->dev_conf.rxmode.max_rx_pkt_len = max_frame; return 0; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 0ac89cb..02d9809 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -5677,7 +5677,6 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) (uint16_t)dev->data->dev_conf.rxmode.max_rx_pkt_len)) { PMD_INIT_LOG(ERR, "Set max packet length to %d failed.", dev->data->dev_conf.rxmode.max_rx_pkt_len); - return -EINVAL; } /* -- 2.7.4