Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp271539lqt; Mon, 18 Mar 2024 07:31:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbrnHPqXIa3VyK2+uh4yngNRr4Xul2+P0h43FJhOeJbv0K950oZ+RYdFRcNbaFcrtt7ljv1DFNPCw3aKUPaB5IouMjDd0QqffFngjMSA== X-Google-Smtp-Source: AGHT+IEGJhZeDpq5Z2ZQiit12aRt/7ZICXBC7W197B3Sy7/AlP7cQQ7RPDa3Win4ulL7jKoKcGXq X-Received: by 2002:a05:6871:2887:b0:222:6240:6e72 with SMTP id bq7-20020a056871288700b0022262406e72mr14800539oac.0.1710772302937; Mon, 18 Mar 2024 07:31:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710772302; cv=pass; d=google.com; s=arc-20160816; b=AZksoOjNtzw/mV0wpECMGAFySNvegOVLrKmPXjJKTNmB2SxXCUCeTuIzb7ufnnClEo JvShdsMvskn89p3P+M3vC021Lwdly6EkxDJa9wZEax6+eHNzNIUu9cRPng3Tw5cQRpYm SeIvM19PZ0n0cv2HVXsmdBYpr8zVFe2EassxZXvQRSX89DkTuZVkREj/dPc770f7EMKC o219KYl7z9+t/PI3q/UplDFHwSi8nzdS0FX5+eO9lTlKD/2rBefZBcTf53yANcI7Pch0 UzYr6Ev/G0weYKC3D7m0XBki3901V9ZFE2FLYSQCOY3DO98hKS+5JBqTCjUQkLBmt6XN ogmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=d0V2E1kngfnLqowcJFq7tFYHYBfwlXhf2dkqPd2bLfA=; fh=SVRNHM571WgfhsgYmjgXjOIMrO1aq9fhLcRYgtPEP4g=; b=g5tKmYqwuy70uaat+GraEj7EBZgfPn+rJBplCM4uHAHaASuMJfEhxso4IosjpnNvEo q/U4whasnQjfoO626q91iFpSG0r9J8NwIbSosqMwFxweA5TkDVH0XKbm+UNEM+Q7+eAF bIuqbjhrgVVEKyGgoCINEPostiBIJEzwqSwEr9mPRQjDzWZrEKyQufbWGn+0/QM+bsh4 ibJhLDHWoKmI3MjT4ic71HxO8I35Vfbxqr2b/v1SK+zOyuDF1nNjZV72xFFZRE23N7Pu tvJsoKvIKa4sgGSE27S3kiPbM3u6sDcBJoiI+V2f8rhZ3ZI552lsxB0uqgyBwk3RL0+J IgJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SmJFgttZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-106225-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i22-20020a63e916000000b005e2c2fc5125si8109699pgh.249.2024.03.18.07.31.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 07:31:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106225-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SmJFgttZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-106225-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9412D2812C6 for ; Mon, 18 Mar 2024 14:31:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C1EB4EB56; Mon, 18 Mar 2024 14:31:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SmJFgttZ" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C7824E1D1 for ; Mon, 18 Mar 2024 14:31:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710772276; cv=none; b=AQFLzIy4MnzS2qQ/WA4wY98tVq9HaBP5yJMwO/47s2jwXC0J7lN0BFsbe75BFmbq1ijnwbuPoVWPOc8PcND9eZwgVHPKs9cfFOUYIBxB/1MfKFFD/bQPeYOhfSoFhLV3JP7h9zu7z4buyiuYexh6XxfCnwMejBoB9PUCEF0NLpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710772276; c=relaxed/simple; bh=ZQ1J9630h+b1Rs4MW7FevvPyNKg2w6k6R13hIGERPnM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iAWpFKAHUMdF/VRLR4V/RtP/iBQa+R9iYKuH0OHwuDjTH5PGfNQWEUJ4DHqvSQVt9z8cLtvOkkUiigu+3yF5E0vyZu8FGN6XwZRPY9byip4LhhqFo/pbFby0VWvNH7eYkUyRMSEL92Yb9817b/AmfdjG87OCpJY+hrskG1PbfYI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SmJFgttZ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710772273; 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: in-reply-to:in-reply-to:references:references; bh=d0V2E1kngfnLqowcJFq7tFYHYBfwlXhf2dkqPd2bLfA=; b=SmJFgttZ5OiHMOecb+qKRuFg09qRPdC78I/Pr96iOE4+v7tThFWqOrFYyGgA1czx8kQo4w rN7NZ5OQi/X0zns0HFB8RSjZAB6AZUQ+eanV3uhk6lXwXSxmLv8rn0eGVwh6cvMAoBrpRY qriB/evj2zIrdbrgmwFUbkBkyXsVNxU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-696-cs1PbpODOVSYw6pl8Bi2Vg-1; Mon, 18 Mar 2024 10:31:09 -0400 X-MC-Unique: cs1PbpODOVSYw6pl8Bi2Vg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 14AC128EC100; Mon, 18 Mar 2024 14:31:09 +0000 (UTC) Received: from p1.luc.cera.cz (unknown [10.45.224.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id B05A8111F3C6; Mon, 18 Mar 2024 14:31:07 +0000 (UTC) From: Ivan Vecera To: intel-wired-lan@lists.osuosl.org Cc: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH iwl-next 2/7] i40e: Change argument of several client notification functions Date: Mon, 18 Mar 2024 15:30:46 +0100 Message-ID: <20240318143058.287014-3-ivecera@redhat.com> In-Reply-To: <20240318143058.287014-1-ivecera@redhat.com> References: <20240318143058.287014-1-ivecera@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Commit 0ef2d5afb12d ("i40e: KISS the client interface") simplified the client interface so in practice it supports only one client per i40e netdev. But we have still 2 notification functions that uses as parameter a pointer to VSI of netdevice associated with the client. After the mentioned commit only possible and used VSI is the main (LAN) VSI. So change these functions so they are called with PF pointer argument and the associated VSI (LAN) is taken inside them. Signed-off-by: Ivan Vecera --- drivers/net/ethernet/intel/i40e/i40e.h | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_client.c | 20 +++++++++---------- drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +++++------ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 5248e78f7849..0792c7324527 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -1236,8 +1236,8 @@ static inline void i40e_dbg_exit(void) {} int i40e_lan_add_device(struct i40e_pf *pf); int i40e_lan_del_device(struct i40e_pf *pf); void i40e_client_subtask(struct i40e_pf *pf); -void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi); -void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset); +void i40e_notify_client_of_l2_param_changes(struct i40e_pf *pf); +void i40e_notify_client_of_netdev_close(struct i40e_pf *pf, bool reset); void i40e_notify_client_of_vf_enable(struct i40e_pf *pf, u32 num_vfs); void i40e_notify_client_of_vf_reset(struct i40e_pf *pf, u32 vf_id); void i40e_client_update_msix_info(struct i40e_pf *pf); diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index b32071ee84af..93e52138826e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -101,25 +101,26 @@ i40e_notify_client_of_vf_msg(struct i40e_vsi *vsi, u32 vf_id, u8 *msg, u16 len) /** * i40e_notify_client_of_l2_param_changes - call the client notify callback - * @vsi: the VSI with l2 param changes + * @pf: PF device pointer * - * If there is a client to this VSI, call the client + * If there is a client, call its callback **/ -void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi) +void i40e_notify_client_of_l2_param_changes(struct i40e_pf *pf) { - struct i40e_pf *pf = vsi->back; struct i40e_client_instance *cdev = pf->cinst; + struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; struct i40e_params params; if (!cdev || !cdev->client) return; if (!cdev->client->ops || !cdev->client->ops->l2_param_change) { - dev_dbg(&vsi->back->pdev->dev, + dev_dbg(&pf->pdev->dev, "Cannot locate client instance l2_param_change routine\n"); return; } if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { - dev_dbg(&vsi->back->pdev->dev, "Client is not open, abort l2 param change\n"); + dev_dbg(&pf->pdev->dev, + "Client is not open, abort l2 param change\n"); return; } memset(¶ms, 0, sizeof(params)); @@ -157,20 +158,19 @@ static void i40e_client_release_qvlist(struct i40e_info *ldev) /** * i40e_notify_client_of_netdev_close - call the client close callback - * @vsi: the VSI with netdev closed + * @pf: PF device pointer * @reset: true when close called due to a reset pending * * If there is a client to this netdev, call the client with close **/ -void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset) +void i40e_notify_client_of_netdev_close(struct i40e_pf *pf, bool reset) { - struct i40e_pf *pf = vsi->back; struct i40e_client_instance *cdev = pf->cinst; if (!cdev || !cdev->client) return; if (!cdev->client->ops || !cdev->client->ops->close) { - dev_dbg(&vsi->back->pdev->dev, + dev_dbg(&pf->pdev->dev, "Cannot locate client instance close routine\n"); return; } diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 2f1604ae78c7..7fed7fb69d4e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11283,14 +11283,12 @@ static void i40e_service_task(struct work_struct *work) i40e_fdir_reinit_subtask(pf); if (test_and_clear_bit(__I40E_CLIENT_RESET, pf->state)) { /* Client subtask will reopen next time through. */ - i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], - true); + i40e_notify_client_of_netdev_close(pf, true); } else { i40e_client_subtask(pf); if (test_and_clear_bit(__I40E_CLIENT_L2_CHANGE, pf->state)) - i40e_notify_client_of_l2_param_changes( - pf->vsi[pf->lan_vsi]); + i40e_notify_client_of_l2_param_changes(pf); } i40e_sync_filters_subtask(pf); } else { @@ -16228,7 +16226,7 @@ static void i40e_remove(struct pci_dev *pdev) /* Client close must be called explicitly here because the timer * has been stopped. */ - i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false); + i40e_notify_client_of_netdev_close(pf, false); i40e_fdir_teardown(pf); @@ -16487,7 +16485,7 @@ static void i40e_shutdown(struct pci_dev *pdev) /* Client close must be called explicitly here because the timer * has been stopped. */ - i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false); + i40e_notify_client_of_netdev_close(pf, false); if (test_bit(I40E_HW_CAP_WOL_MC_MAGIC_PKT_WAKE, pf->hw.caps) && pf->wol_en) @@ -16541,7 +16539,7 @@ static int i40e_suspend(struct device *dev) /* Client close must be called explicitly here because the timer * has been stopped. */ - i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false); + i40e_notify_client_of_netdev_close(pf, false); if (test_bit(I40E_HW_CAP_WOL_MC_MAGIC_PKT_WAKE, pf->hw.caps) && pf->wol_en) -- 2.43.0