From patchwork Wed Apr 10 11:18:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52569 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F3555B34; Wed, 10 Apr 2019 13:18:52 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820077.outbound.protection.outlook.com [40.107.82.77]) by dpdk.org (Postfix) with ESMTP id B249F5A6A for ; Wed, 10 Apr 2019 13:18:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ehBEgR/WIV8FEHxz8tIzG3cNPNpzm69SEibHFVy2Oqk=; b=jj3A8oR7TRKfzABBYgm9v5dbu7V9txWqd8n0EZkl5lyjNjgSygDx+mI6rJmBsohmZ9T/rCa0FROffExby5pKIrmgZrZSqFEhZ7+JFSmPDYnbzlnp1pt4TZrpFtH2yrSBZviLuKPp6C+KuxYf+QKuiFbmCdxtP86WLvihdDOVbm8= Received: from BN8PR11MB3618.namprd11.prod.outlook.com (20.178.219.85) by BN8PR11MB3540.namprd11.prod.outlook.com (20.178.218.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.21; Wed, 10 Apr 2019 11:18:49 +0000 Received: from BN8PR11MB3618.namprd11.prod.outlook.com ([fe80::9d38:1845:842d:a489]) by BN8PR11MB3618.namprd11.prod.outlook.com ([fe80::9d38:1845:842d:a489%3]) with mapi id 15.20.1771.016; Wed, 10 Apr 2019 11:18:49 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , Konstantin Ananyev , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Igor Russkikh Thread-Topic: [PATCH 03/10] net/ixgbe: macsec callbacks implementation Thread-Index: AQHU748rw4mX9nTMW0aqxtX0SimoHw== Date: Wed, 10 Apr 2019 11:18:49 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR05CA0061.namprd05.prod.outlook.com (2603:10b6:a03:74::38) To BN8PR11MB3618.namprd11.prod.outlook.com (2603:10b6:408:85::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 921a561f-d133-450e-455d-08d6bda64de8 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020); SRVR:BN8PR11MB3540; x-ms-traffictypediagnostic: BN8PR11MB3540: x-microsoft-antispam-prvs: x-forefront-prvs: 00032065B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39850400004)(376002)(366004)(136003)(346002)(199004)(189003)(486006)(107886003)(6506007)(316002)(2616005)(386003)(54906003)(7416002)(53936002)(8936002)(68736007)(446003)(6916009)(476003)(72206003)(2501003)(105586002)(11346002)(44832011)(99286004)(2351001)(52116002)(186003)(26005)(118296001)(106356001)(14454004)(102836004)(76176011)(71200400001)(81156014)(7736002)(14444005)(8676002)(81166006)(25786009)(256004)(6116002)(5660300002)(71190400001)(1730700003)(5640700003)(2906002)(66066001)(6512007)(478600001)(6486002)(50226002)(305945005)(97736004)(4326008)(3846002)(36756003)(6436002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR11MB3540; H:BN8PR11MB3618.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: zmOlVYBrMWlhvkG0jRxmHx/6OBiHlY3LHEjBGk3nsMal94oVB2rBhAI6RqbAjeNll+bkISpr95CKlgcyCpoi55hzR9zrWFArXIxIMJSW3334dB8yx/QZ7vtBiB7/mnierQKg1sdV7PaGm5XOe6hqhiNT0apaL2l4nCEy2tQMiqjAVyMC+fuPinf3a58+vYAUjXRUUvIv5SwtXabd28OQ/7PqVnPpwHGfdAkRAFUS5od2rd/XH88Imzn/Yna5gYXY+e86t5A5be3Y7U+ie6lSGSQ9WxZAZq3VHMQtAz8X8aBy870OX2symufLxJCwnRKDo+j46E9UXO5l7o4Udatl3UHIbEnxpLW1nsGnKyGisTn2lCD27anSHtOmAz8IfTp5Yux6T7PXyvW6T0G+IOb9fq+yvdpl6YyzKDDRc71wsM4= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 921a561f-d133-450e-455d-08d6bda64de8 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:18:49.2945 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3540 Subject: [dpdk-dev] [PATCH 03/10] net/ixgbe: macsec callbacks implementation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add new macsec generic callbacks to ixgbe driver. Reuse existing rte_pmd_ driver API, keeping it to preserve backward API compatibility Signed-off-by: Igor Russkikh --- drivers/net/ixgbe/ixgbe_ethdev.c | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 975fa474ce83..e2123062c185 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -46,6 +46,7 @@ #include "base/ixgbe_type.h" #include "base/ixgbe_phy.h" #include "ixgbe_regs.h" +#include "rte_pmd_ixgbe.h" /* * High threshold controlling when to start sending XOFF frames. Must be at @@ -370,6 +371,17 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, static int ixgbe_filter_restore(struct rte_eth_dev *dev); static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev); +static int ixgbe_macsec_enable(struct rte_eth_dev *dev, + uint8_t encr, uint8_t repl_prot); +static int ixgbe_macsec_disable(struct rte_eth_dev *dev); +static int ixgbe_macsec_config_txsc(struct rte_eth_dev *dev, uint8_t *mac); +static int ixgbe_macsec_config_rxsc(struct rte_eth_dev *dev, + uint8_t *mac, uint16_t pi); +static int ixgbe_macsec_select_txsa(struct rte_eth_dev *dev, uint8_t idx, + uint8_t an, uint32_t pn, uint8_t *key); +static int ixgbe_macsec_select_rxsa(struct rte_eth_dev *dev, uint8_t idx, + uint8_t an, uint32_t pn, uint8_t *key); + /* * Define VF Stats MACRO for Non "cleared on read" register */ @@ -581,6 +593,12 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = { .udp_tunnel_port_add = ixgbe_dev_udp_tunnel_port_add, .udp_tunnel_port_del = ixgbe_dev_udp_tunnel_port_del, .tm_ops_get = ixgbe_tm_ops_get, + .macsec_enable = ixgbe_macsec_enable, + .macsec_disable = ixgbe_macsec_disable, + .macsec_config_rxsc = ixgbe_macsec_config_rxsc, + .macsec_config_txsc = ixgbe_macsec_config_txsc, + .macsec_select_rxsa = ixgbe_macsec_select_rxsa, + .macsec_select_txsa = ixgbe_macsec_select_txsa, }; /* @@ -8652,6 +8670,43 @@ ixgbe_clear_all_l2_tn_filter(struct rte_eth_dev *dev) return 0; } +static int ixgbe_macsec_enable(struct rte_eth_dev *dev, + uint8_t encr, uint8_t repl_prot) +{ + return rte_pmd_ixgbe_macsec_enable(dev->data->port_id, + encr, repl_prot); +} + +static int ixgbe_macsec_disable(struct rte_eth_dev *dev) +{ + return rte_pmd_ixgbe_macsec_disable(dev->data->port_id); +} + +static int ixgbe_macsec_config_txsc(struct rte_eth_dev *dev, uint8_t *mac) +{ + return rte_pmd_ixgbe_macsec_config_txsc(dev->data->port_id, mac); +} + +static int ixgbe_macsec_config_rxsc(struct rte_eth_dev *dev, + uint8_t *mac, uint16_t pi) +{ + return rte_pmd_ixgbe_macsec_config_rxsc(dev->data->port_id, mac, pi); +} + +static int ixgbe_macsec_select_txsa(struct rte_eth_dev *dev, uint8_t idx, + uint8_t an, uint32_t pn, uint8_t *key) +{ + return rte_pmd_ixgbe_macsec_select_txsa(dev->data->port_id, idx, an, + pn, key); +} + +static int ixgbe_macsec_select_rxsa(struct rte_eth_dev *dev, uint8_t idx, + uint8_t an, uint32_t pn, uint8_t *key) +{ + return rte_pmd_ixgbe_macsec_select_txsa(dev->data->port_id, idx, an, + pn, key); +} + RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map); RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio-pci");