Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3675817lfo; Mon, 23 May 2022 11:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2VfvtlWLy6VGkyNKiblUW0qm+mAh3EA5EiDXoKeay9wU/Xa8YqHxbbHbtebOicr7FD2ZI X-Received: by 2002:a63:4e25:0:b0:3f6:8:8c04 with SMTP id c37-20020a634e25000000b003f600088c04mr20888489pgb.458.1653329142227; Mon, 23 May 2022 11:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653329142; cv=none; d=google.com; s=arc-20160816; b=gCXwsyxzToodxe/6PMpmXekNAZiliBpSdchuukrSUn3/3SwKU4uGShykPbpvgL9O/2 90eg/vd7vfMJ/5l6T/lOI+2NvORSaCGSjSmGwfjJoTQ0V+IzcALrObiVCUr9zlgmhQJZ cKesuPLwHAKTi740MKZODwFdAE7UAGPwAaKhGyLuDTgZ7cgKFhGYVg1EANVr3EqFl901 fL1cUHK8wiVMC1kaqk3+YiP2sFM8hkkMqG1KmOaHLG3DD6WQQgV6ZX5y4fs6Ck5Erp90 5qa8iGXYDA2DAL3CAqf4HPmtEqiExmxVGltZU1CYIawhrUi74TpLbkqCpA9StKyIkJP5 fb5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1eT31vDkEawtkHiANuMeOZpxcmBgrWaaVYyNohNuP7o=; b=07sY4I9QDE+4t40KJYre7P1Uit7fgtIKJ+vb9eXZ53Jlsw+wVqMIh2GZdGm8QDKunE h+2eQGlr2j2YOhMESYnIMSy3xsVRTP+g1E4YwNbTd67ft4Wgg/F/Coe/zdOlBd7nbQEf Upp1JeCIsRvtDH05KkXtVCMgqjmw/dYCYxuuafciv9XlZHI+ERPizMaDzlbWgMUrdCTO +qSJh3cdwZcwLrt+R5j5G/5g/GDBL3fsZS17VdTHpiNaveSQmheo3n7gSdlVOIQP6/1q 97YUUPWfJc51oe/qJcxGH6L3aBGsdPciYG9Ezfof7mraryFbUigxqp+PDL5UxkJJ8/4W MYdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="zxT4/8Dp"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id iw22-20020a170903045600b00161cdf431e1si9873348plb.50.2022.05.23.11.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:05:42 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="zxT4/8Dp"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5364A1339E9; Mon, 23 May 2022 11:03:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243420AbiEWR4x (ORCPT + 99 others); Mon, 23 May 2022 13:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240318AbiEWRZ3 (ORCPT ); Mon, 23 May 2022 13:25:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3697282168; Mon, 23 May 2022 10:20:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B4147610E8; Mon, 23 May 2022 17:20:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDE4BC385A9; Mon, 23 May 2022 17:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326452; bh=VJK7TwURwrK0TLfXEBbhNwto/77OQeC3hI0AX6HaA5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zxT4/8DpmMnJnPp/puMFT5p97iVPSckChdMDo2cJFOOSos+z2b6qLydEO5K8tbxhQ tNuqql1GGy2d+UIQZX4qNdKTci63TkXnybqZyEaWceFElFKMCflC+vgy5V56nP/J2C 7RO8ouHQTnNfxu87sVKYE9Urpa8Aewkzmt6/7Uws= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Wilczynski , Tony Nguyen , Sasha Levin , Gurucharan Subject: [PATCH 5.15 086/132] ice: Fix interrupt moderation settings getting cleared Date: Mon, 23 May 2022 19:04:55 +0200 Message-Id: <20220523165837.348246556@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165823.492309987@linuxfoundation.org> References: <20220523165823.492309987@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Wilczynski [ Upstream commit bf13502ed5f941b0777b3fd1e24dac5d93f3886c ] Adaptive-rx and Adaptive-tx are interrupt moderation settings that can be enabled/disabled using ethtool: ethtool -C ethX adaptive-rx on/off adaptive-tx on/off Unfortunately those settings are getting cleared after changing number of queues, or in ethtool world 'channels': ethtool -L ethX rx 1 tx 1 Clearing was happening due to introduction of bit fields in ice_ring_container struct. This way only itr_setting bits were rebuilt during ice_vsi_rebuild_set_coalesce(). Introduce an anonymous struct of bitfields and create a union to refer to them as a single variable. This way variable can be easily saved and restored. Fixes: 61dc79ced7aa ("ice: Restore interrupt throttle settings after VSI rebuild") Signed-off-by: Michal Wilczynski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_lib.c | 16 ++++++++-------- drivers/net/ethernet/intel/ice/ice_txrx.h | 11 ++++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 653996e8fd30..4417238b0e64 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -2980,8 +2980,8 @@ ice_vsi_rebuild_get_coalesce(struct ice_vsi *vsi, ice_for_each_q_vector(vsi, i) { struct ice_q_vector *q_vector = vsi->q_vectors[i]; - coalesce[i].itr_tx = q_vector->tx.itr_setting; - coalesce[i].itr_rx = q_vector->rx.itr_setting; + coalesce[i].itr_tx = q_vector->tx.itr_settings; + coalesce[i].itr_rx = q_vector->rx.itr_settings; coalesce[i].intrl = q_vector->intrl; if (i < vsi->num_txq) @@ -3037,21 +3037,21 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi, */ if (i < vsi->alloc_rxq && coalesce[i].rx_valid) { rc = &vsi->q_vectors[i]->rx; - rc->itr_setting = coalesce[i].itr_rx; + rc->itr_settings = coalesce[i].itr_rx; ice_write_itr(rc, rc->itr_setting); } else if (i < vsi->alloc_rxq) { rc = &vsi->q_vectors[i]->rx; - rc->itr_setting = coalesce[0].itr_rx; + rc->itr_settings = coalesce[0].itr_rx; ice_write_itr(rc, rc->itr_setting); } if (i < vsi->alloc_txq && coalesce[i].tx_valid) { rc = &vsi->q_vectors[i]->tx; - rc->itr_setting = coalesce[i].itr_tx; + rc->itr_settings = coalesce[i].itr_tx; ice_write_itr(rc, rc->itr_setting); } else if (i < vsi->alloc_txq) { rc = &vsi->q_vectors[i]->tx; - rc->itr_setting = coalesce[0].itr_tx; + rc->itr_settings = coalesce[0].itr_tx; ice_write_itr(rc, rc->itr_setting); } @@ -3065,12 +3065,12 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi, for (; i < vsi->num_q_vectors; i++) { /* transmit */ rc = &vsi->q_vectors[i]->tx; - rc->itr_setting = coalesce[0].itr_tx; + rc->itr_settings = coalesce[0].itr_tx; ice_write_itr(rc, rc->itr_setting); /* receive */ rc = &vsi->q_vectors[i]->rx; - rc->itr_setting = coalesce[0].itr_rx; + rc->itr_settings = coalesce[0].itr_rx; ice_write_itr(rc, rc->itr_setting); vsi->q_vectors[i]->intrl = coalesce[0].intrl; diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.h b/drivers/net/ethernet/intel/ice/ice_txrx.h index 69f78a1c234f..4adc3dff04ba 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.h +++ b/drivers/net/ethernet/intel/ice/ice_txrx.h @@ -345,9 +345,14 @@ struct ice_ring_container { /* this matches the maximum number of ITR bits, but in usec * values, so it is shifted left one bit (bit zero is ignored) */ - u16 itr_setting:13; - u16 itr_reserved:2; - u16 itr_mode:1; + union { + struct { + u16 itr_setting:13; + u16 itr_reserved:2; + u16 itr_mode:1; + }; + u16 itr_settings; + }; enum ice_container_type type; }; -- 2.35.1