From patchwork Tue Oct 4 04:44:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Ruffell X-Patchwork-Id: 1685757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=ZxltfHGw; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhQ9Z73BLz23jM for ; Tue, 4 Oct 2022 15:45:05 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ofZnX-0005WP-Lt; Tue, 04 Oct 2022 04:44:51 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ofZnW-0005Vx-1H for kernel-team@lists.ubuntu.com; Tue, 04 Oct 2022 04:44:50 +0000 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D08E240795 for ; Tue, 4 Oct 2022 04:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664858689; bh=IclXFzVDaBEGCnjCqFBP2Y0ANZgZctqD9pEBtMxE3SQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZxltfHGw6/WbLNBIF4etkBLcoWBLCSg2UyuLCZz3gb0ukqkN+gO2VUlG/S+Nr7JtF ZI1ZoL+Eh6qEXfoGtpqrF7CpWwcIRSz0Gj0fUg+iBMaKjjlD9kQT0EVm4flJCC2TDe Mq/dgExMTUI2b+ifO8lIHS0jVdoSo2fj9pkJyHo5KqRSR9JDng1JkS09f0QrNlAu9/ z30xqa3fysgyp3tqK+/lhSvpTVkBUrNXC2pmHE6bIiMkEnzK8zsVPPK1Q6ocyYGu5Q oy10QLf+NDS5exqyBVYkEh8YuNblzZJElIt4AryjFEdRKANXOgW52EMOgjkj1t3UAA Q5AXs8lZUjGuA== Received: by mail-pl1-f200.google.com with SMTP id c12-20020a170903234c00b0017f695bf8f0so2095527plh.6 for ; Mon, 03 Oct 2022 21:44:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=IclXFzVDaBEGCnjCqFBP2Y0ANZgZctqD9pEBtMxE3SQ=; b=R1clGQdRBrs8dEM4MyA5eMlhpD2sOIAWMjil2Rix2svJRmsN0mSJaP07NwAZx1Pcvy bJKDbpqDMoMjcs+RblYARr3Nq8G59uNg5HHowLUE1zko/cfuYIPpXtefqINWItXbQDqp mjSlsDE3CyXZgZMac+oJtjonHZwbeCkzrcieZ4wOV84T/dUxj52q52kjalmalMFO5XL0 lkiZlyMlsXeypXtzxJUD1w64LapaaZ9bqBf32MQhoiJRhO0bZN/VyiPjIs4ZrU48wFMr 5zuypTrjb06opwVH6ElM2TGJ/9wo0RMuA0K0sc3FDeLU0nsYACwYt/CcawTJHdWGXHQs PxPg== X-Gm-Message-State: ACrzQf1lqoGmhU1+IkKm6hn8wj3+l6drI+9zeFDmLninsGRqmqdgqh+s XOgP2fvUDuxWwuKLnbramhaZXnCaeqLihGKZNFkM8+JMfi1DQVjQNcJEsGO635UMDHNTXW51HmU q0CjAlWfc5Cs+jKXSqs3CP5FuWyMhLSpaPx61FU/jpg== X-Received: by 2002:a63:86c7:0:b0:454:a7fa:275e with SMTP id x190-20020a6386c7000000b00454a7fa275emr2010143pgd.93.1664858688543; Mon, 03 Oct 2022 21:44:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7x5QE20xlh6AqzS3LDpzICfB14n61E4mfDxojjfF6gn0pbyy+kqAjRBYm3F67lspKhA7bybw== X-Received: by 2002:a63:86c7:0:b0:454:a7fa:275e with SMTP id x190-20020a6386c7000000b00454a7fa275emr2010124pgd.93.1664858688240; Mon, 03 Oct 2022 21:44:48 -0700 (PDT) Received: from desktop.. (125-239-70-54-fibre.sparkbb.co.nz. [125.239.70.54]) by smtp.gmail.com with ESMTPSA id a2-20020aa78e82000000b00561642b6903sm3341433pfr.120.2022.10.03.21.44.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 21:44:47 -0700 (PDT) From: Matthew Ruffell To: kernel-team@lists.ubuntu.com Subject: [SRU][F][J][K][PATCH 2/2] i40e: Fix VF set max MTU size Date: Tue, 4 Oct 2022 17:44:36 +1300 Message-Id: <20221004044436.15046-3-matthew.ruffell@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004044436.15046-1-matthew.ruffell@canonical.com> References: <20221004044436.15046-1-matthew.ruffell@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Michal Jaron BugLink: https://bugs.launchpad.net/bugs/1983656 Max MTU sent to VF is set to 0 during memory allocation. It cause that max MTU on VF is changed to IAVF_MAX_RXBUFFER and does not depend on data from HW. Set max_mtu field in virtchnl_vf_resource struct to inform VF in GET_VF_RESOURCES msg what size should be max frame. Fixes: dab86afdbbd1 ("i40e/i40evf: Change the way we limit the maximum frame size for Rx") Signed-off-by: Michal Jaron Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen (cherry picked from commit 372539def2824c43b6afe2403045b140f65c5acc) Signed-off-by: Arif Ali Signed-off-by: Trent Lloyd Signed-off-by: Matthew Ruffell --- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 86b0f21287dc..67fbaaad3985 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -2038,6 +2038,25 @@ static void i40e_del_qch(struct i40e_vf *vf) } } +/** + * i40e_vc_get_max_frame_size + * @vf: pointer to the VF + * + * Max frame size is determined based on the current port's max frame size and + * whether a port VLAN is configured on this VF. The VF is not aware whether + * it's in a port VLAN so the PF needs to account for this in max frame size + * checks and sending the max frame size to the VF. + **/ +static u16 i40e_vc_get_max_frame_size(struct i40e_vf *vf) +{ + u16 max_frame_size = vf->pf->hw.phy.link_info.max_frame_size; + + if (vf->port_vlan_id) + max_frame_size -= VLAN_HLEN; + + return max_frame_size; +} + /** * i40e_vc_get_vf_resources_msg * @vf: pointer to the VF info @@ -2139,6 +2158,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf; vfres->rss_key_size = I40E_HKEY_ARRAY_SIZE; vfres->rss_lut_size = I40E_VF_HLUT_ARRAY_SIZE; + vfres->max_mtu = i40e_vc_get_max_frame_size(vf); if (vf->lan_vsi_idx) { vfres->vsi_res[0].vsi_id = vf->lan_vsi_id;