From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D612C3B19D for ; Fri, 14 Feb 2020 15:03:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 207BB24654 for ; Fri, 14 Feb 2020 15:03:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="g46Bhnvh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729509AbgBNPDV (ORCPT ); Fri, 14 Feb 2020 10:03:21 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:15014 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729491AbgBNPDT (ORCPT ); Fri, 14 Feb 2020 10:03:19 -0500 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01EF15gD013950; Fri, 14 Feb 2020 07:03:15 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=MPJ2Jc8JIu3IUHuXoKb4GJJz6+JkH21/Rg7fBYqashw=; b=g46BhnvhnExTmKhHz/GaepQNLOu9KU3ACkEEtmaja+9mzaiYV2HZXgeCu2Vz+5XrCS5q e5jBOmYvmcgCZ1+sjrbX+B2n+zWocydMqYs20ERDkg2LzX4c98OVL1FwpLyLPVzXf/t+ 1jeB0+r+NzDmymfEKRPLffrk+1cjR5vzOVO+fK1e3alyvQseLZDijiQLVlKgeMvAgd5F LH8+g+XrCeRLL+HVh2+YW0xUvB33hCRQcTk21qlmQXMDqP15oSUVr/9JZP9TMQlV1FN6 7d+1lUyx0XiodLhcbdLI5ULiv6kOABRpvoqxhOGaUVLWw0tbX7wQAUCBIF8hN5mzQuX2 Xg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2y4j5k3gr5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 14 Feb 2020 07:03:15 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Feb 2020 07:03:13 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Feb 2020 07:03:12 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 14 Feb 2020 07:03:12 -0800 Received: from NN-LT0019.rdc.aquantia.com (unknown [10.9.16.63]) by maili.marvell.com (Postfix) with ESMTP id DF03F3F703F; Fri, 14 Feb 2020 07:03:10 -0800 (PST) From: Igor Russkikh To: CC: "David S . Miller" , Antoine Tenart , Mark Starovoytov , Dmitry Bogdanov , Igor Russkikh Subject: [RFC 02/18] net: add a reference to MACsec ops in net_device Date: Fri, 14 Feb 2020 18:02:42 +0300 Message-ID: <20200214150258.390-3-irusskikh@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200214150258.390-1-irusskikh@marvell.com> References: <20200214150258.390-1-irusskikh@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-14_04:2020-02-12,2020-02-14 signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Antoine Tenart This patch adds a reference to MACsec ops to the net_device structure, allowing net device drivers to implement offloading operations for MACsec. Signed-off-by: Antoine Tenart Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh --- include/linux/netdevice.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a9c6b5c61d27..01b90c290779 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -53,6 +53,8 @@ struct netpoll_info; struct device; struct phy_device; struct dsa_port; +struct macsec_context; +struct macsec_ops; struct sfp_bus; /* 802.11 specific */ @@ -1802,6 +1804,8 @@ enum netdev_priv_flags { * that follow this device when it is moved * to another network namespace. * + * @macsec_ops: MACsec offloading ops + * * FIXME: cleanup struct net_device such that network protocol info * moves out. */ @@ -2096,6 +2100,11 @@ struct net_device { unsigned wol_enabled:1; struct list_head net_notifier_list; + +#if IS_ENABLED(CONFIG_MACSEC) + /* MACsec management functions */ + const struct macsec_ops *macsec_ops; +#endif }; #define to_net_dev(d) container_of(d, struct net_device, dev) -- 2.17.1