From patchwork Wed Mar 25 12:52:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 221883 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.9 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 C2466C43331 for ; Wed, 25 Mar 2020 12:53:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8819120775 for ; Wed, 25 Mar 2020 12:53:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="IqdKhpP+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727456AbgCYMxE (ORCPT ); Wed, 25 Mar 2020 08:53:04 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:9848 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727400AbgCYMxD (ORCPT ); Wed, 25 Mar 2020 08:53:03 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02PCp3N3009882; Wed, 25 Mar 2020 05:53:01 -0700 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=9fs6nDV5mQA+2KJYT5Mllt00nd4z3LNGfsgoCjG2Wao=; b=IqdKhpP+Ppmc2rAXKIs3PTc6YU8JqKg+XipqMjCAeVTLNVzVb6SIXGJ5zcQhvSqtEiq9 c+gpq8c8lYiacIrOtqH7f2JEjq1zpZk9XjOFjnW2BLTuOx7cqmYmxWzQj0YHeGp7tcMh 85sdJORBwbaIWVs1M/oy1TA4Bm5hirdhDREpynfvAEdtPigIa9dB6pPM0mC00UYTOadw 7qw4to6Ed6vdHv9ks0IiZ0pZgOcCgBVaBD4J297un7XPi9MmDljqBWLpg8pR0pgIy6bA PhZ1wI59D8IoiZzQSPEp9iBg4LlRY3blYk2H+c1WTxDJD26GdfXEiCVUUNxyWcGEQH5i 2Q== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2ywg9nrgfu-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 25 Mar 2020 05:53:00 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 25 Mar 2020 05:52:59 -0700 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; Wed, 25 Mar 2020 05:52:59 -0700 Received: from localhost.localdomain (unknown [10.9.16.55]) by maili.marvell.com (Postfix) with ESMTP id D05AB3F7040; Wed, 25 Mar 2020 05:52:57 -0700 (PDT) From: Igor Russkikh To: CC: Mark Starovoytov , Sabrina Dubroca , Antoine Tenart , "Igor Russkikh" Subject: [PATCH v2 net-next 03/17] net: macsec: allow to reference a netdev from a MACsec context Date: Wed, 25 Mar 2020 15:52:32 +0300 Message-ID: <20200325125246.987-4-irusskikh@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200325125246.987-1-irusskikh@marvell.com> References: <20200325125246.987-1-irusskikh@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-25_05:2020-03-24,2020-03-25 signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Antoine Tenart This patch allows to reference a net_device from a MACsec context. This is needed to allow implementing MACsec operations in net device drivers. Signed-off-by: Antoine Tenart Signed-off-by: Mark Starovoytov Signed-off-by: Igor Russkikh --- include/net/macsec.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/net/macsec.h b/include/net/macsec.h index 2e4780dbf5c6..71de2c863df7 100644 --- a/include/net/macsec.h +++ b/include/net/macsec.h @@ -220,7 +220,10 @@ struct macsec_secy { * struct macsec_context - MACsec context for hardware offloading */ struct macsec_context { - struct phy_device *phydev; + union { + struct net_device *netdev; + struct phy_device *phydev; + }; enum macsec_offload offload; struct macsec_secy *secy;