From nobody Sun Sep 14 22:46:33 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA2CFC6FA82 for ; Tue, 13 Sep 2022 14:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231800AbiIMOl4 (ORCPT ); Tue, 13 Sep 2022 10:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbiIMOlU (ORCPT ); Tue, 13 Sep 2022 10:41:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07F126D548; Tue, 13 Sep 2022 07:21:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8746BB80E22; Tue, 13 Sep 2022 14:20:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF0E5C433C1; Tue, 13 Sep 2022 14:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078848; bh=1YAUVoJiaBM2z0aMDJb9X1mdQ/VLtl3bWK1JdV6kSm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f39p8ooJ3kIjZqx5GDdT6RLmDQOoWSHqrk+2O1C0vMiFnvCDTaRsxvSLDUawhRn++ PnELaDZAY6LvqYJ0PO7uIsgWIa6HAWOvJUVXs/BSp2eMyZhYnwKu9BcS1peRlf/k81 rnzRNfVy0U0cKwOAfYkGDbuUVMIh3PC6qZ/hwgAs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Przemyslaw Patynowski , Jan Sokolowski , Bharathi Sreenivas , Tony Nguyen , Sasha Levin Subject: [PATCH 5.15 106/121] i40e: Fix ADQ rate limiting for PF Date: Tue, 13 Sep 2022 16:04:57 +0200 Message-Id: <20220913140401.901940819@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140357.323297659@linuxfoundation.org> References: <20220913140357.323297659@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Przemyslaw Patynowski [ Upstream commit 45bb006d3c924b1201ed43c87a96b437662dcaa8 ] Fix HW rate limiting for ADQ. Fallback to kernel queue selection for ADQ, as it is network stack that decides which queue to use for transmit with ADQ configured. Reset PF after creation of VMDq2 VSIs required for ADQ, as to reprogram TX queue contexts in i40e_configure_tx_ring. Without this patch PF would limit TX rate only according to TC0. Fixes: a9ce82f744dc ("i40e: Enable 'channel' mode in mqprio for TC configs") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Jan Sokolowski Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++ drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethe= rnet/intel/i40e/i40e_main.c index f373072dd3b30..ce6eea7a60027 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -6517,6 +6517,9 @@ static int i40e_configure_queue_channels(struct i40e_= vsi *vsi) vsi->tc_seid_map[i] =3D ch->seid; } } + + /* reset to reconfigure TX queue contexts */ + i40e_do_reset(vsi->back, I40E_PF_RESET_FLAG, true); return ret; =20 err_free: diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethe= rnet/intel/i40e/i40e_txrx.c index d3a4a33977ee8..326fd25d055f8 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -3651,7 +3651,8 @@ u16 i40e_lan_select_queue(struct net_device *netdev, u8 prio; =20 /* is DCB enabled at all? */ - if (vsi->tc_config.numtc =3D=3D 1) + if (vsi->tc_config.numtc =3D=3D 1 || + i40e_is_tc_mqprio_enabled(vsi->back)) return netdev_pick_tx(netdev, skb, sb_dev); =20 prio =3D skb->priority; --=20 2.35.1