From patchwork Fri Feb 4 08:02:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 12734869 X-Patchwork-Delegate: kuba@kernel.org 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 6D5AFC433F5 for ; Fri, 4 Feb 2022 08:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236018AbiBDIDJ (ORCPT ); Fri, 4 Feb 2022 03:03:09 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:58500 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232004AbiBDIDJ (ORCPT ); Fri, 4 Feb 2022 03:03:09 -0500 From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643961788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1Q9w9cCPiizS9c08viXczkQ5y2iVATK7Ure0+P8y1WA=; b=ljChLCBbv7pau6AmdP7lrZKgMaXOBH5xuPDQSv6n5Cxlvl7kOFDnMh4+NcPTLcyPE50T0H OHaKZJTqyDObo1ihgDWeO9g1ozkEh1AlkIN+kCl3EGUa0j/uMDg/35fl8Kzzc3ABqZJib0 rsuM5DRLRPIy3Vtu66zrC599ckiBvmG6aLpYg+zr5BcUvRRQ+wY9Osmbwo6HD9xGNZbcaz cr5k25Cg4Qjnbdr2t7siEAC9Pkt0hBEB8vpTT/1ZmE5pzWfMjT6LszwOqPksez4/+xIju7 FLJ3Xkzljt5cD7jQZq+t4DfYn3/DAlGIpJYbkMnaza6XKISQ5icpY+2it3yeCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643961788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1Q9w9cCPiizS9c08viXczkQ5y2iVATK7Ure0+P8y1WA=; b=eLzMILb0aJ6QOt9v0QzfE+irTbFbevFZeS2k8zVF4bzdF3a3nQtm6s5bJ1Mcgqpf/Y2boP vHVy0UUAp7KLgWCw== To: Vinicius Costa Gomes , Jesse Brandeburg , Tony Nguyen Cc: "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andre Guedes , Maciej Fijalkowski , Jithu Joseph , Vedang Patel , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Kurt Kanzenbach Subject: [PATCH net] igc: Clear old XDP info when changing ring settings Date: Fri, 4 Feb 2022 09:02:17 +0100 Message-Id: <20220204080217.70054-1-kurt@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When changing ring sizes the driver triggers kernel warnings in XDP code. For instance, running 'ethtool -G $interface tx 1024 rx 1024' yields: |[ 754.838136] Missing unregister, handled but fix driver |[ 754.838143] WARNING: CPU: 4 PID: 704 at net/core/xdp.c:170 xdp_rxq_info_reg+0x7d/0xe0 The newly allocated ring is copied by memcpy() and still contains the old XDP information. Therefore, it has to be cleared before allocating new resources by igc_setup_rx_resources(). Igb does it the same way. Keep the code in sync. Fixes: 4609ffb9f615 ("igc: Refactor XDP rxq info registration") Signed-off-by: Kurt Kanzenbach --- drivers/net/ethernet/intel/igc/igc_ethtool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 8cc077b712ad..93839106504d 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -671,6 +671,10 @@ igc_ethtool_set_ringparam(struct net_device *netdev, memcpy(&temp_ring[i], adapter->rx_ring[i], sizeof(struct igc_ring)); + /* Clear copied XDP RX-queue info */ + memset(&temp_ring[i].xdp_rxq, 0, + sizeof(temp_ring[i].xdp_rxq)); + temp_ring[i].count = new_rx_count; err = igc_setup_rx_resources(&temp_ring[i]); if (err) {