From patchwork Wed Apr 10 11:18:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52567 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 424935689; Wed, 10 Apr 2019 13:18:44 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790077.outbound.protection.outlook.com [40.107.79.77]) by dpdk.org (Postfix) with ESMTP id 1FD305592 for ; Wed, 10 Apr 2019 13:18:42 +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=fEN/3aV1EOskfOINKeraXqm36dkydOJYkOhDOnQa2wM=; b=e+qeoLfGUxmhYou0eGAnz8S+JrRTYEG37HPR/gz7aAgDxMVBGFX4qWWFboRzJs50jeErT5TOZuOa6ElKLPnJBIKBhVARj4XvUfLQkRWsj081aFeylMUMqGHN86BHaikyfael9lrFjcyDdhiK0GyE3hWj57asJycE9plRa+CDs7g= 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:40 +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:40 +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 01/10] ethdev: introduce MACSEC device ops Thread-Index: AQHU748mXHLLDK9oYE6FEmEkoBUS2w== Date: Wed, 10 Apr 2019 11:18:40 +0000 Message-ID: <69b3fcf19cb3e11fae93281f40a1bbc0ec5a2e38.1554894242.git.igor.russkikh@aquantia.com> 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: fa3dd50a-de3a-4242-b206-08d6bda64886 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: aBqlm+3kEcbHpT/YoIkKTtHiX4FkKQe0ydqw8lwDR050/lTSmKHCVbR3CzZqm/J6J+D/BW2LmY9SaqrRhJqmE3NKMe0QWO+zwBPxFPNW3y6s1i9okwMqhYjeJh2tV65WiT89QBs1E/9g9JsTiYlkFEt00eUihdYsCVR1JFpCMDN8hn6jH2zDfxPlt/xZWxr2jGU2KtzZW7buEOs+mC/E4ZxoLer35ibvkA3vSYY7cwKj1tK3WHD5RM2Ao/S9lQ/Ar+sMh5ueIoPNSGq63ZQMXTuG4pIUvFXcymKV4vZ5/FCwa7aO/MfAj3XEslUuYLuFDG5szrKBMurZGQcTZziOFb89XfeA8SyprTjh8KCHdjoJG0xmWrThOUR1lkLp4usqNVZHYwNvuzKWXChpeWQfTYfOpsuBKhXqAF+rxfTn57Q= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa3dd50a-de3a-4242-b206-08d6bda64886 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:18:40.2504 (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 01/10] ethdev: introduce MACSEC device ops 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" MACSEC related device ops, API and parameters are taken from the existing ixgbe PMD ops Signed-off-by: Igor Russkikh --- lib/librte_ethdev/rte_ethdev.c | 87 +++++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 115 ++++++++++++++++++++++++++++ lib/librte_ethdev/rte_ethdev_core.h | 23 ++++++ 3 files changed, 225 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 243beb4dd5ef..315c31dc667d 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -4367,6 +4367,93 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) return (*dev->dev_ops->pool_ops_supported)(dev, pool); } +int +rte_eth_macsec_enable(uint16_t port_id, + uint8_t encr, uint8_t repl_prot) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->macsec_enable, -ENOTSUP); + return eth_err(port_id, (*dev->dev_ops->macsec_enable) + (dev, encr, repl_prot)); +} + +int +rte_eth_macsec_disable(uint16_t port_id) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->macsec_disable, -ENOTSUP); + return eth_err(port_id, (*dev->dev_ops->macsec_disable) + (dev)); +} + +int +rte_eth_macsec_config_rxsc(uint16_t port_id, + uint8_t *mac, uint16_t pi) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->macsec_config_rxsc, -ENOTSUP); + return eth_err(port_id, (*dev->dev_ops->macsec_config_rxsc) + (dev, mac, pi)); +} + +int +rte_eth_macsec_config_txsc(uint16_t port_id, + uint8_t *mac) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->macsec_config_txsc, -ENOTSUP); + return eth_err(port_id, (*dev->dev_ops->macsec_config_txsc) + (dev, mac)); +} + +int +rte_eth_macsec_select_rxsa(uint16_t port_id, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->macsec_select_rxsa, -ENOTSUP); + return eth_err(port_id, (*dev->dev_ops->macsec_select_rxsa) + (dev, idx, an, pn, key)); +} + +int +rte_eth_macsec_select_txsa(uint16_t port_id, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->macsec_select_txsa, -ENOTSUP); + return eth_err(port_id, (*dev->dev_ops->macsec_select_txsa) + (dev, idx, an, pn, key)); +} + + + /** * A set of values to describe the possible states of a switch domain. */ diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 40a068fe8337..0e4e889653ad 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -3872,6 +3872,121 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool); void * rte_eth_dev_get_sec_ctx(uint16_t port_id); +/** + * Enable MACsec offload. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param encr + * 1 - Enable encryption (encrypt and add integrity signature). + * 0 - Disable encryption (only add integrity signature). + * @param repl_prot + * 1 - Enable replay protection. + * 0 - Disable replay protection. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if hardware doesn't support this feature. + */ +int +rte_eth_macsec_enable(uint16_t port_id, + uint8_t encr, uint8_t repl_prot); + +/** + * Disable MACsec offload. + * + * @param port_id + * The port identifier of the Ethernet device. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if hardware doesn't support this feature. + */ +int +rte_eth_macsec_disable(uint16_t port_id); + +/** + * Configure Rx SC (Secure Connection). + * + * @param port_id + * The port identifier of the Ethernet device. + * @param mac + * The MAC address on the remote side. + * @param pi + * The PI (port identifier) on the remote side. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if hardware doesn't support this feature. + */ +int +rte_eth_macsec_config_rxsc(uint16_t port_id, + uint8_t *mac, uint16_t pi); + +/** + * Configure Tx SC (Secure Connection). + * + * @param port_id + * The port identifier of the Ethernet device. + * @param mac + * The MAC address on the local side. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if hardware doesn't support this feature. + */ +int +rte_eth_macsec_config_txsc(uint16_t port_id, + uint8_t *mac); + +/** + * Enable Rx SA (Secure Association). + * + * @param port_id + * The port identifier of the Ethernet device. + * @param idx + * The SA to be enabled (0 or 1) + * @param an + * The association number on the remote side. + * @param pn + * The packet number on the remote side. + * @param key + * The key on the remote side. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if hardware doesn't support this feature. + * - (-EINVAL) if bad parameter. + */ +int +rte_eth_macsec_select_rxsa(uint16_t port_id, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); + +/** + * Enable Tx SA (Secure Association). + * + * @param port_id + * The port identifier of the Ethernet device. + * @param idx + * The SA to be enabled (0 or 1). + * @param an + * The association number on the local side. + * @param pn + * The packet number on the local side. + * @param key + * The key on the local side. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if hardware doesn't support this feature. + * - (-EINVAL) if bad parameter. + */ +int +rte_eth_macsec_select_txsa(uint16_t port_id, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); + #include diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 8f03f83f62cf..6434a9065756 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -377,6 +377,20 @@ typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev, const char *pool); /**< @internal Test if a port supports specific mempool ops */ +typedef int (*eth_macsec_enable_t)(struct rte_eth_dev *dev, + uint8_t encr, uint8_t repl_prot); +typedef int (*eth_macsec_disable_t)(struct rte_eth_dev *dev); +typedef int (*eth_macsec_config_rxsc_t)(struct rte_eth_dev *dev, + uint8_t *mac, uint16_t pi); +typedef int (*eth_macsec_config_txsc_t)(struct rte_eth_dev *dev, + uint8_t *mac); +typedef int (*eth_macsec_select_rxsa_t)(struct rte_eth_dev *dev, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); +typedef int (*eth_macsec_select_txsa_t)(struct rte_eth_dev *dev, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); + /** * @internal A structure containing the functions exported by an Ethernet driver. */ @@ -509,6 +523,15 @@ struct eth_dev_ops { eth_pool_ops_supported_t pool_ops_supported; /**< Test if a port supports specific mempool ops */ + + eth_macsec_enable_t macsec_enable; /** macsec function enable */ + eth_macsec_disable_t macsec_disable; /** macsec function disable */ + eth_macsec_config_rxsc_t macsec_config_rxsc; /** macsec configure rx */ + eth_macsec_config_txsc_t macsec_config_txsc; /** macsec configure tx */ + eth_macsec_select_rxsa_t macsec_select_rxsa; + /** macsec select rx security association */ + eth_macsec_select_txsa_t macsec_select_txsa; + /** macsec select tx security association */ }; /** From patchwork Wed Apr 10 11:18:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52568 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 248B458CB; Wed, 10 Apr 2019 13:18:48 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790073.outbound.protection.outlook.com [40.107.79.73]) by dpdk.org (Postfix) with ESMTP id 180D756A1 for ; Wed, 10 Apr 2019 13:18:46 +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=J11C+mo7XHreX3ZBaPv19Chh6VjRQzY/yBBvi1DDCUQ=; b=fM0xKFGB3cIgb3YvULiiBq4RjUfrX3WxaaRfHd+U6DM1TmzWbZovVLO/UTOE3TFWOCubkuS5aOU4yFb781Snbs19wO7tCvJ1b6hB7Vnoi5ki2lJgA5X0VAcrciDHKg/Z5fFBsSD/udB0J6bNNTXvPf2hp4Fvx8EYP7hXOHndTd4= 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:44 +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:44 +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 02/10] app/testpmd: use generic MACSEC API calls Thread-Index: AQHU748oEXpx8Dpp7Uy3q8NBnBnfSg== Date: Wed, 10 Apr 2019 11:18:44 +0000 Message-ID: <123a93a371be657e3e8481379db6f151350d4f90.1554894242.git.igor.russkikh@aquantia.com> 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: d9fc63da-4a23-45f2-a5f9-08d6bda64b21 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)(8676002)(81166006)(25786009)(256004)(6116002)(5660300002)(71190400001)(1730700003)(5640700003)(2906002)(66066001)(6512007)(478600001)(6486002)(50226002)(305945005)(97736004)(4326008)(3846002)(36756003)(6436002)(86362001)(41533002); 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: SCF1n4+9s8pxas+rTyUoxB2daKDXT16L2kg9Te7BeDdPCSEufR0Tj1OBM7LkNKwx/wUiCnNcm2cvWbn/ZpVI2XxrScg2jl2bI4qJNBtoq5AH+FUUjKmNhfYnN+pK9ex2jlgp9VBEcUESnSzff/sengK8urYgHn+xJ/e2Mflryv2JllMlZbkNaUK5llyHQaeU+x/EXVy8q8OepCCPRDcpNMcf8kD4Gx3trbc6imvzHyMaJyBrWptB4F8fVgxbBsXr/WqxInii1M6+U1TgOiCeEm4v0aZpoVvdpXOk4z9BjjtI5nbJ2SR09tzmSPVThFNiTIT8lwqL+gFC0ZWIz75hNOvnw1gIRh7kzlkDk6cY92Jhc4eLaclgk21VOQ/KaSYgCOMkrJb2vxqlgB4RhQ1tlcrfuIxOkcLH8AmbB+esqYQ= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9fc63da-4a23-45f2-a5f9-08d6bda64b21 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:18:44.5293 (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 02/10] app/testpmd: use generic MACSEC API calls 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" Here we do repace testpmd direct usage of IXGBE driver calls with generic ethdev macsec API calls Signed-off-by: Igor Russkikh --- app/test-pmd/cmdline.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 2ab03c111316..1730c76fe65c 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -13958,9 +13958,7 @@ cmd_set_macsec_offload_on_parsed( rte_eth_dev_info_get(port_id, &dev_info); if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) { -#ifdef RTE_LIBRTE_IXGBE_PMD - ret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp); -#endif + ret = rte_eth_macsec_enable(port_id, en, rp); } RTE_SET_USED(en); RTE_SET_USED(rp); @@ -14052,9 +14050,7 @@ cmd_set_macsec_offload_off_parsed( rte_eth_dev_info_get(port_id, &dev_info); if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) { -#ifdef RTE_LIBRTE_IXGBE_PMD - ret = rte_pmd_ixgbe_macsec_disable(port_id); -#endif + ret = rte_eth_macsec_disable(port_id); } switch (ret) { case 0: @@ -14138,13 +14134,11 @@ cmd_set_macsec_sc_parsed( int ret = -ENOTSUP; int is_tx = (strcmp(res->tx_rx, "tx") == 0) ? 1 : 0; -#ifdef RTE_LIBRTE_IXGBE_PMD ret = is_tx ? - rte_pmd_ixgbe_macsec_config_txsc(res->port_id, + rte_eth_macsec_config_txsc(res->port_id, res->mac.addr_bytes) : - rte_pmd_ixgbe_macsec_config_rxsc(res->port_id, + rte_eth_macsec_config_rxsc(res->port_id, res->mac.addr_bytes, res->pi); -#endif RTE_SET_USED(is_tx); switch (ret) { @@ -14257,13 +14251,11 @@ cmd_set_macsec_sa_parsed( key[i] = (uint8_t) ((xdgt0 * 16) + xdgt1); } -#ifdef RTE_LIBRTE_IXGBE_PMD ret = is_tx ? - rte_pmd_ixgbe_macsec_select_txsa(res->port_id, + rte_eth_macsec_select_txsa(res->port_id, res->idx, res->an, res->pn, key) : - rte_pmd_ixgbe_macsec_select_rxsa(res->port_id, + rte_eth_macsec_select_rxsa(res->port_id, res->idx, res->an, res->pn, key); -#endif RTE_SET_USED(is_tx); RTE_SET_USED(key); 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"); From patchwork Wed Apr 10 11:18:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52570 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 E24A25F0D; Wed, 10 Apr 2019 13:18:56 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790077.outbound.protection.outlook.com [40.107.79.77]) by dpdk.org (Postfix) with ESMTP id 2369F5B40 for ; Wed, 10 Apr 2019 13:18:55 +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=vFby3ITODIio0JwNMsmgYlR7gKfO1p3o6nBzNwyOUUQ=; b=kvSJUxY3Hd87BTCv1/egR6GRmvrrw2nzzRakiVgcL3RS2BW820e6Ki7IqqaknIMrXU0qxyhCEUzgd72TM7Qxr3G6s81oHKuYXhQylc+ist/C+kpvNw+Wg32JMPXodt7JxWop91ksmlF0Bpcv8isLG9qZq2v5arAn7pDJ199abiI= 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:53 +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:53 +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 04/10] net/atlantic: macsec hardware structures declaration Thread-Index: AQHU748ub4X5ms1SVUKFEthV1/z/Ig== Date: Wed, 10 Apr 2019 11:18:53 +0000 Message-ID: <478e2875b86b3b097d152ac6a72fca6bc49e4aff.1554894242.git.igor.russkikh@aquantia.com> 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: 14c17447-1c14-45b8-dd61-08d6bda6507f 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: ylgMxDCZJ7ZHyc6xC9nMY3YdbRFAJHhfW2pKSSw2SxZc5E1yuy9ahQZ5mJduskBMjHmHyM7iAepd59km1bzQ3QXQBCYWuIGYnkwrAQy5ES9BEeiBJZmuZVJc8LtGjGx6E+NVlf86RYwGP+Yw91LGQZUcrknq/Pc2XFJvynPn5EE2X8y1otvcoJjhRn0Onu8wsRwoAJ36eFvKv5/tKb3n9rmxYd6iXZ+jpdOzNBPSnfXAXiAIGXZyZtsTaCG4kLc08JvuX+IgoJaPDxHEAKK7PWiTSl4kzajmFiQx/7LY8zY0SDzvGVvJLApYQE5laUO4EkHFtM7s9GDAL+RCvkJVwYHBpDam6hc0pgD6VPnCnVY5TLz2gKUkDi/eg4Qx1yCau0jA4sX7CDCJbuKeU7/2Dpcho8WVyGSM4zV4CbZv/TQ= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14c17447-1c14-45b8-dd61-08d6bda6507f X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:18:53.5423 (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 04/10] net/atlantic: macsec hardware structures declaration 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" From: Pavel Belous Here we define hardware and software configuration structures for macsec interface. MACSEC itself is implemented in Phy module, but its configuration is done via firmware interface Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_types.h | 37 ++++++ drivers/net/atlantic/hw_atl/hw_atl_utils.h | 148 +++++++++++++++++++++ 2 files changed, 185 insertions(+) diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h index 3edaf0c7c047..3cc9e96089e8 100644 --- a/drivers/net/atlantic/atl_types.h +++ b/drivers/net/atlantic/atl_types.h @@ -59,6 +59,39 @@ struct aq_rss_parameters { u8 indirection_table[HW_ATL_B0_RSS_REDIRECTION_MAX]; }; +/* Macsec stuff */ +struct aq_macsec_config { + struct { + u32 macsec_enabled; + u32 encryption_enabled; + u32 replay_protection_enabled; + } common; + + struct { + u32 idx; + u32 mac[2]; /* 6 bytes */ + } txsc; + + struct { + u32 idx; + u32 an; /* association number on the local side */ + u32 pn; /* packet number on the local side */ + u32 key[4]; /* 128 bit key */ + } txsa; + + struct { + u32 mac[2]; /* 6 bytes */ + u32 pi; + } rxsc; + + struct { + u32 idx; + u32 an; /* association number on the remote side */ + u32 pn; /* packet number on the remote side */ + u32 key[4]; /* 128 bit key */ + } rxsa; +}; + struct aq_hw_cfg_s { bool is_lro; bool is_rss; @@ -75,6 +108,7 @@ struct aq_hw_cfg_s { uint32_t flow_control; struct aq_rss_parameters aq_rss; + struct aq_macsec_config aq_macsec; }; struct aq_hw_s { @@ -143,6 +177,9 @@ struct aq_fw_ops { int (*set_eeprom)(struct aq_hw_s *self, int dev_addr, u32 *data, u32 len); + int (*send_macsec_req)(struct aq_hw_s *self, + struct macsec_msg_fw_request *req, + struct macsec_msg_fw_response *response); }; struct atl_sw_stats { diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/atlantic/hw_atl/hw_atl_utils.h index f2a87826c0d1..b7c531573623 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils.h +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.h @@ -351,6 +351,154 @@ struct smbus_write_request { u32 length; } __attribute__((__packed__)); +enum macsec_msg_type { + macsec_cfg_msg = 0, + macsec_add_rx_sc_msg, + macsec_add_tx_sc_msg, + macsec_add_rx_sa_msg, + macsec_add_tx_sa_msg, + macsec_get_stats_msg, +}; + +struct macsec_cfg { + uint32_t enabled; + uint32_t egress_threshold; + uint32_t ingress_threshold; + uint32_t interrupts_enabled; +} __attribute__((__packed__)); + +struct add_rx_sc { + uint32_t index; + uint32_t pi; /* Port identifier */ + uint32_t sci[2]; /* Secure Channel identifier */ + uint32_t sci_mask; /* 1: enable comparison of SCI, 0: don't care */ + uint32_t tci; + uint32_t tci_mask; + uint32_t mac_sa[2]; + uint32_t sa_mask; /* 0: ignore mac_sa */ + uint32_t mac_da[2]; + uint32_t da_mask; /* 0: ignore mac_da */ + uint32_t validate_frames; /* 0: strict, 1:check, 2:disabled */ + uint32_t replay_protect; /* 1: enabled, 0:disabled */ + uint32_t anti_replay_window; /* default 0 */ + /* 1: auto_rollover enabled (when SA next_pn is saturated */ + uint32_t an_rol; +} __attribute__((__packed__)); + +struct add_tx_sc { + uint32_t index; + uint32_t pi; /* Port identifier */ + uint32_t sci[2]; /* Secure Channel identifier */ + uint32_t sci_mask; /* 1: enable comparison of SCI, 0: don't care */ + uint32_t tci; /* TCI value, used if packet is not explicitly tagged */ + uint32_t tci_mask; + uint32_t mac_sa[2]; + uint32_t sa_mask; /* 0: ignore mac_sa */ + uint32_t mac_da[2]; + uint32_t da_mask; /* 0: ignore mac_da */ + uint32_t protect; + uint32_t curr_an; /* SA index which currently used */ +} __attribute__((__packed__)); + +struct add_rx_sa { + uint32_t index; + uint32_t next_pn; + uint32_t key[4]; /* 128 bit key */ +} __attribute__((__packed__)); + +struct add_tx_sa { + uint32_t index; + uint32_t next_pn; + uint32_t key[4]; /* 128 bit key */ +} __attribute__((__packed__)); + +struct get_stats { + uint32_t version_only; + uint32_t ingress_sa_index; + uint32_t egress_sa_index; + uint32_t egress_sc_index; +} __attribute__((__packed__)); + +struct macsec_stats { + uint32_t api_version; + /* Ingress Common Counters */ + uint64_t in_ctl_pkts; + uint64_t in_tagged_miss_pkts; + uint64_t in_untagged_miss_pkts; + uint64_t in_notag_pkts; + uint64_t in_untagged_pkts; + uint64_t in_bad_tag_pkts; + uint64_t in_no_sci_pkts; + uint64_t in_unknown_sci_pkts; + uint64_t in_ctrl_prt_pass_pkts; + uint64_t in_unctrl_prt_pass_pkts; + uint64_t in_ctrl_prt_fail_pkts; + uint64_t in_unctrl_prt_fail_pkts; + uint64_t in_too_long_pkts; + uint64_t in_igpoc_ctl_pkts; + uint64_t in_ecc_error_pkts; + uint64_t in_unctrl_hit_drop_redir; + + /* Egress Common Counters */ + uint64_t out_ctl_pkts; + uint64_t out_unknown_sa_pkts; + uint64_t out_untagged_pkts; + uint64_t out_too_long; + uint64_t out_ecc_error_pkts; + uint64_t out_unctrl_hit_drop_redir; + + /* Ingress SA Counters */ + uint64_t in_untagged_hit_pkts; + uint64_t in_ctrl_hit_drop_redir_pkts; + uint64_t in_not_using_sa; + uint64_t in_unused_sa; + uint64_t in_not_valid_pkts; + uint64_t in_invalid_pkts; + uint64_t in_ok_pkts; + uint64_t in_late_pkts; + uint64_t in_delayed_pkts; + uint64_t in_unchecked_pkts; + uint64_t in_validated_octets; + uint64_t in_decrypted_octets; + + /* Egress SA Counters */ + uint64_t out_sa_hit_drop_redirect; + uint64_t out_sa_protected2_pkts; + uint64_t out_sa_protected_pkts; + uint64_t out_sa_encrypted_pkts; + + /* Egress SC Counters */ + uint64_t out_sc_protected_pkts; + uint64_t out_sc_encrypted_pkts; + uint64_t out_sc_protected_octets; + uint64_t out_sc_encrypted_octets; + + /* SA Counters expiration info */ + uint32_t egress_threshold_expired; + uint32_t ingress_threshold_expired; + uint32_t egress_expired; + uint32_t ingress_expired; +} __attribute__((__packed__)); + +struct macsec_msg_fw_request { + uint32_t offset; /* not used */ + uint32_t msg_type; + + union { + struct macsec_cfg cfg; + struct add_rx_sc rxsc; + struct add_tx_sc txsc; + struct add_rx_sa rxsa; + struct add_tx_sa txsa; + struct get_stats stats; + }; +} __attribute__((__packed__)); + +struct macsec_msg_fw_response { + uint32_t result; + struct macsec_stats stats; +} __attribute__((__packed__)); + #define HAL_ATLANTIC_UTILS_CHIP_MIPS 0x00000001U #define HAL_ATLANTIC_UTILS_CHIP_TPO2 0x00000002U #define HAL_ATLANTIC_UTILS_CHIP_RPF2 0x00000004U From patchwork Wed Apr 10 11:18:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52571 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 B3BBD5F14; Wed, 10 Apr 2019 13:19:01 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790052.outbound.protection.outlook.com [40.107.79.52]) by dpdk.org (Postfix) with ESMTP id 7274E5F14 for ; Wed, 10 Apr 2019 13:18:59 +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=TAU4QqAneoiLAZuDzhjiczJqo5UnGW969KjMuFmWrVo=; b=JNwLqp3zGGfzl4fb+e/ivhHKo8+XqXvyu6bBOAKrkUUs0epVndF9RqNa7TaRqXd+MaR6uFvfO5LlvzkIIuE9iWEtRP9uKJwr3+2bKJ3SKBQ3vUCVrcaT3iTnakdhSt5tAExMaDIi0womZfO+8KcWDA50LBHcIi3XDqsiFoidpkE= 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:58 +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:58 +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 05/10] net/atlantic: macsec configuration code Thread-Index: AQHU748wESZ28zL9VkOgPhS73FnaAQ== Date: Wed, 10 Apr 2019 11:18:57 +0000 Message-ID: <9ac2dcf2607b5eafff3e08d54e5236b12900ed38.1554894242.git.igor.russkikh@aquantia.com> 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: cd096549-7dbb-47d8-058f-08d6bda6530a 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: fVyVuV/8gcMsVsctxxE7F7l4BXB5Of5nrn13v/+W6wUi02mcIISXNxSW4tOFXRvB+LR5WAWz30M/TWxlXR7l1Ft8GdUZcqScUupVz85q5nu0GoXVLudT7BqM53eUsaP/3KaDn35KWBcxvaHiEHaPdP1PbvuVb41fSsr1JQFfaCBvvYVzyZ5KldU3PN/OptBqGoCsp+NjO2hce45mpbbzTinyzxK3Vro2ywv7s50mKGogKsFrWcMgnu4fd6nribq3pyX0SIhipmWpSCK+3az8NFO/qn5kTU6gVEQtahuZ4CX7K2XHvjm0K3SQfbMJbROCCA7x5ik9Nt2TvMqAvcOjwxNUa8mVHjN4RVegR1S98/XLlBX38QPDKlTeD4hc5foNNXMUen0VkiAdBqlgSkHTwu33Ty0hArbbsDtNbFlwJEg= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd096549-7dbb-47d8-058f-08d6bda6530a X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:18:57.8362 (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 05/10] net/atlantic: macsec configuration code 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" From: Pavel Belous This is a driver side of macsec configuration routines. It fills in config structures and sends requests to FW for configuration activities. We also declare macsec offload bits in DPDK offload capabilities Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 220 ++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 8327863cd9b6..502ef5308b4d 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -122,6 +122,18 @@ static int eth_atl_pci_remove(struct rte_pci_device *pci_dev); static void atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); +static int atl_macsec_enable(struct rte_eth_dev *dev, uint8_t encr, + uint8_t repl_prot); +static int atl_macsec_disable(struct rte_eth_dev *dev); +static int atl_macsec_config_txsc(struct rte_eth_dev *dev, uint8_t *mac); +static int atl_macsec_config_rxsc(struct rte_eth_dev *dev, + uint8_t *mac, uint16_t pi); +static int atl_macsec_select_txsa(struct rte_eth_dev *dev, uint8_t idx, + uint8_t an, uint32_t pn, uint8_t *key); + +static int atl_macsec_select_rxsa(struct rte_eth_dev *dev, uint8_t idx, + uint8_t an, uint32_t pn, uint8_t *key); + int atl_logtype_init; int atl_logtype_driver; @@ -167,6 +179,7 @@ static struct rte_pci_driver rte_atl_pmd = { | DEV_RX_OFFLOAD_UDP_CKSUM \ | DEV_RX_OFFLOAD_TCP_CKSUM \ | DEV_RX_OFFLOAD_JUMBO_FRAME \ + | DEV_RX_OFFLOAD_MACSEC_STRIP \ | DEV_RX_OFFLOAD_VLAN_FILTER) #define ATL_TX_OFFLOADS (DEV_TX_OFFLOAD_VLAN_INSERT \ @@ -174,6 +187,7 @@ static struct rte_pci_driver rte_atl_pmd = { | DEV_TX_OFFLOAD_UDP_CKSUM \ | DEV_TX_OFFLOAD_TCP_CKSUM \ | DEV_TX_OFFLOAD_TCP_TSO \ + | DEV_TX_OFFLOAD_MACSEC_INSERT \ | DEV_TX_OFFLOAD_MULTI_SEGS) static const struct rte_eth_desc_lim rx_desc_lim = { @@ -295,6 +309,13 @@ static const struct eth_dev_ops atl_eth_dev_ops = { .reta_query = atl_reta_query, .rss_hash_update = atl_rss_hash_update, .rss_hash_conf_get = atl_rss_hash_conf_get, + + .macsec_enable = atl_macsec_enable, + .macsec_disable = atl_macsec_disable, + .macsec_config_rxsc = atl_macsec_config_rxsc, + .macsec_config_txsc = atl_macsec_config_txsc, + .macsec_select_rxsa = atl_macsec_select_rxsa, + .macsec_select_txsa = atl_macsec_select_txsa, }; static inline int32_t @@ -698,6 +719,205 @@ atl_dev_reset(struct rte_eth_dev *dev) return ret; } +static int +atl_dev_configure_macsec(struct rte_eth_dev *dev) +{ + struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct aq_hw_cfg_s *cf = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + struct aq_macsec_config *aqcfg = &cf->aq_macsec; + struct macsec_msg_fw_request msg_macsec; + struct macsec_msg_fw_response response; + + if (!aqcfg->common.macsec_enabled || + hw->aq_fw_ops->send_macsec_req == NULL) + return 0; + + memset(&msg_macsec, 0, sizeof(msg_macsec)); + + /* Creating set of sc/sa structures from parameters provided by DPDK */ + + /* Configure macsec */ + msg_macsec.msg_type = macsec_cfg_msg; + msg_macsec.cfg.enabled = aqcfg->common.macsec_enabled; + msg_macsec.cfg.interrupts_enabled = 1; + + hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response); + + if (response.result) + return -1; + + memset(&msg_macsec, 0, sizeof(msg_macsec)); + + /* Configure TX SC */ + + msg_macsec.msg_type = macsec_add_tx_sc_msg; + msg_macsec.txsc.index = 0; /* TXSC always one (??) */ + msg_macsec.txsc.protect = aqcfg->common.encryption_enabled; + + /* MAC addr for TX */ + msg_macsec.txsc.mac_sa[0] = rte_bswap32(aqcfg->txsc.mac[1]); + msg_macsec.txsc.mac_sa[1] = rte_bswap32(aqcfg->txsc.mac[0]); + msg_macsec.txsc.sa_mask = 0x3f; + + msg_macsec.txsc.da_mask = 0; + msg_macsec.txsc.tci = 0x0B; + msg_macsec.txsc.curr_an = 0; /* SA index which currently used */ + + /* + * Creating SCI (Secure Channel Identifier). + * SCI constructed from Source MAC and Port identifier + */ + uint32_t sci_hi_part = (msg_macsec.txsc.mac_sa[1] << 16) | + (msg_macsec.txsc.mac_sa[0] >> 16); + uint32_t sci_low_part = (msg_macsec.txsc.mac_sa[0] << 16); + + uint32_t port_identifier = 1; + + msg_macsec.txsc.sci[1] = sci_hi_part; + msg_macsec.txsc.sci[0] = sci_low_part | port_identifier; + + hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response); + + if (response.result) + return -1; + + memset(&msg_macsec, 0, sizeof(msg_macsec)); + + /* Configure RX SC */ + + msg_macsec.msg_type = macsec_add_rx_sc_msg; + msg_macsec.rxsc.index = aqcfg->rxsc.pi; + msg_macsec.rxsc.replay_protect = + aqcfg->common.replay_protection_enabled; + msg_macsec.rxsc.anti_replay_window = 0; + + /* MAC addr for RX */ + msg_macsec.rxsc.mac_da[0] = rte_bswap32(aqcfg->rxsc.mac[1]); + msg_macsec.rxsc.mac_da[1] = rte_bswap32(aqcfg->rxsc.mac[0]); + msg_macsec.rxsc.da_mask = 0;//0x3f; + + msg_macsec.rxsc.sa_mask = 0; + + hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response); + + if (response.result) + return -1; + + memset(&msg_macsec, 0, sizeof(msg_macsec)); + + /* Configure RX SC */ + + msg_macsec.msg_type = macsec_add_tx_sa_msg; + msg_macsec.txsa.index = aqcfg->txsa.idx; + msg_macsec.txsa.next_pn = aqcfg->txsa.pn; + + msg_macsec.txsa.key[0] = rte_bswap32(aqcfg->txsa.key[3]); + msg_macsec.txsa.key[1] = rte_bswap32(aqcfg->txsa.key[2]); + msg_macsec.txsa.key[2] = rte_bswap32(aqcfg->txsa.key[1]); + msg_macsec.txsa.key[3] = rte_bswap32(aqcfg->txsa.key[0]); + + hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response); + + if (response.result) + return -1; + + memset(&msg_macsec, 0, sizeof(msg_macsec)); + + /* Configure RX SA */ + + msg_macsec.msg_type = macsec_add_rx_sa_msg; + msg_macsec.rxsa.index = aqcfg->rxsa.idx; + msg_macsec.rxsa.next_pn = aqcfg->rxsa.pn; + + msg_macsec.rxsa.key[0] = rte_bswap32(aqcfg->rxsa.key[3]); + msg_macsec.rxsa.key[1] = rte_bswap32(aqcfg->rxsa.key[2]); + msg_macsec.rxsa.key[2] = rte_bswap32(aqcfg->rxsa.key[1]); + msg_macsec.rxsa.key[3] = rte_bswap32(aqcfg->rxsa.key[0]); + + hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response); + + if (response.result) + return -1; + + return 0; +} + +static int atl_macsec_enable(struct rte_eth_dev *dev, + uint8_t encr, uint8_t repl_prot) +{ + struct aq_hw_cfg_s *cfg = + ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + cfg->aq_macsec.common.macsec_enabled = 1; + cfg->aq_macsec.common.encryption_enabled = encr; + cfg->aq_macsec.common.replay_protection_enabled = repl_prot; + + return 0; +} + +static int atl_macsec_disable(struct rte_eth_dev *dev) +{ + struct aq_hw_cfg_s *cfg = + ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + cfg->aq_macsec.common.macsec_enabled = 0; + + return 0; +} + +static int atl_macsec_config_txsc(struct rte_eth_dev *dev, uint8_t *mac) +{ + struct aq_hw_cfg_s *cfg = + ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + memset(&cfg->aq_macsec.txsc.mac, 0, sizeof(cfg->aq_macsec.txsc.mac)); + memcpy((uint8_t *)&cfg->aq_macsec.txsc.mac + 2, mac, ETHER_ADDR_LEN); + + return 0; +} + +static int atl_macsec_config_rxsc(struct rte_eth_dev *dev, + uint8_t *mac, uint16_t pi) +{ + struct aq_hw_cfg_s *cfg = + ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + memset(&cfg->aq_macsec.rxsc.mac, 0, sizeof(cfg->aq_macsec.rxsc.mac)); + memcpy((uint8_t *)&cfg->aq_macsec.rxsc.mac + 2, mac, ETHER_ADDR_LEN); + cfg->aq_macsec.rxsc.pi = pi; + + return 0; +} + +static int atl_macsec_select_txsa(struct rte_eth_dev *dev, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key) +{ + struct aq_hw_cfg_s *cfg = + ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + cfg->aq_macsec.txsa.idx = idx; + cfg->aq_macsec.txsa.pn = pn; + cfg->aq_macsec.txsa.an = an; + + memcpy(&cfg->aq_macsec.txsa.key, key, 16); + return 0; +} + +static int atl_macsec_select_rxsa(struct rte_eth_dev *dev, + uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key) +{ + struct aq_hw_cfg_s *cfg = + ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + cfg->aq_macsec.rxsa.idx = idx; + cfg->aq_macsec.rxsa.pn = pn; + cfg->aq_macsec.rxsa.an = an; + + memcpy(&cfg->aq_macsec.rxsa.key, key, 16); + return 0; +} static int atl_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) From patchwork Wed Apr 10 11:19:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52572 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 2148F5F36; Wed, 10 Apr 2019 13:19:08 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820073.outbound.protection.outlook.com [40.107.82.73]) by dpdk.org (Postfix) with ESMTP id 0BDB65F1B for ; Wed, 10 Apr 2019 13:19:04 +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=lYw3S5LZLGZXtSmBSnIuE+fgw76YLxEkEYe+YMVtQqQ=; b=kaN+Y7XMrcuej01svcRBYoBhSyzvgNmrOFdIfhLxnUy6fp9H/7ft4m1/30rWe9Exz6Qz2LOmz1VWh3i/OSnnviE468DYRKpZRgULNirogS1QKCruxxTaFRPr87oGx+JcKJuct0burWamGtNltdSgWh98K5QXTYmZ+GWx/JlsNTY= 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:19:02 +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:19:02 +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 06/10] net/atlantic: macsec firmware interface Thread-Index: AQHU748zQ9psX1HDFE+0FODu/zRypQ== Date: Wed, 10 Apr 2019 11:19:02 +0000 Message-ID: <43e5c460000d04f7f8875189d746da05ab75e50a.1554894242.git.igor.russkikh@aquantia.com> 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: 22c5dad4-ac72-48a0-bf92-08d6bda6559a 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: PF5JezSs03qCSZQsSUNbk3R+W7xg7DBcjxhSDhSJ6cweLtR8AfDYqDDK0RUOKfIs38WUu/A46tD0ssiTqRQGnKvX8RhU89rVPXS6RnBmjzyXJFnXvYzgvkkQxiKkha6IClbWMSRbGgr8tkranv6QR3tfQkMBj0jxLupo9uga7Lk/4GoeFsuAOE6jE1GukRkZbDHeyh6wOa5oZ1S6LV/Q7caEixFqXgQ8kEb1/oGj/ZTQgeGI13Bz9VhCAuNZWlTo0U43Zn/qgMFNX4pH/QynvxaTLkwVZcJctMi0GtsDrr78czxcwKvM/1zHjZZC0YNYOtF5CMBBG+uYVub/SWOoLxpuI1+0K1DftotvnaIKKAf7a07UyuO/17XalCVFbHUoPMXeNVTuqSnKq+XZYG2ucegKMWUgGkWurEKSy7Kfm7o= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22c5dad4-ac72-48a0-bf92-08d6bda6559a X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:19:02.1632 (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 06/10] net/atlantic: macsec firmware interface 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" From: Pavel Belous Implementation of firmware interface for macsec configuration. Structure with config data is written into FW memory, then we trigger FW to execute the request and wait for result. Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_types.h | 2 + .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h index 3cc9e96089e8..dbaf2c635f50 100644 --- a/drivers/net/atlantic/atl_types.h +++ b/drivers/net/atlantic/atl_types.h @@ -128,6 +128,8 @@ struct aq_hw_s { struct hw_atl_stats_s last_stats; struct aq_stats_s curr_stats; + u32 caps_lo; + u64 speed; unsigned int chip_features; u32 fw_ver_actual; diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c index f215ceb70435..89a3759b89b4 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c @@ -62,6 +62,7 @@ static int aq_fw2x_set_state(struct aq_hw_s *self, static int aq_fw2x_init(struct aq_hw_s *self) { int err = 0; + struct hw_aq_atl_utils_mbox mbox; /* check 10 times by 1ms */ AQ_HW_WAIT_FOR(0U != (self->mbox_addr = @@ -70,6 +71,12 @@ static int aq_fw2x_init(struct aq_hw_s *self) AQ_HW_WAIT_FOR(0U != (self->rpc_addr = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_RPC_ADDR)), 1000U, 100U); + + /* Read caps */ + hw_atl_utils_mpi_read_stats(self, &mbox); + + self->caps_lo = mbox.info.caps_lo; + return err; } @@ -623,6 +630,49 @@ static int aq_fw2x_set_eeprom(struct aq_hw_s *self, int dev_addr, return 0; } +static int aq_fw2x_send_macsec_request(struct aq_hw_s *self, + struct macsec_msg_fw_request *req, + struct macsec_msg_fw_response *response) +{ + int err = 0; + u32 mpi_opts = 0; + + if (!response || !response) + return 0; + + if ((self->caps_lo & BIT(CAPS_LO_MACSEC)) == 0) + return -EOPNOTSUPP; + + /* Write macsec request to cfg memory */ + err = hw_atl_utils_fw_upload_dwords(self, self->rpc_addr, + (u32 *)(void *)req, + RTE_ALIGN(sizeof(*req) / sizeof(u32), sizeof(u32))); + + if (err < 0) + return err; + + /* Toggle 0x368.CAPS_LO_MACSEC bit */ + mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL_ADDR); + mpi_opts ^= BIT(CAPS_LO_MACSEC); + + aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL_ADDR, mpi_opts); + + /* Wait until REQUEST_BIT matched in 0x370 */ + AQ_HW_WAIT_FOR((aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE_ADDR) & + BIT(CAPS_LO_MACSEC)) == (mpi_opts & BIT(CAPS_LO_MACSEC)), + 1000U, 10000U); + + if (err < 0) + return err; + + /* Read status of write operation */ + err = hw_atl_utils_fw_downld_dwords(self, self->rpc_addr + sizeof(u32), + (u32 *)(void *)response, + RTE_ALIGN(sizeof(*response) / sizeof(u32), sizeof(u32))); + + return err; +} + const struct aq_fw_ops aq_fw_2x_ops = { .init = aq_fw2x_init, .deinit = aq_fw2x_deinit, @@ -641,4 +691,5 @@ const struct aq_fw_ops aq_fw_2x_ops = { .led_control = aq_fw2x_led_control, .get_eeprom = aq_fw2x_get_eeprom, .set_eeprom = aq_fw2x_set_eeprom, + .send_macsec_req = aq_fw2x_send_macsec_request, }; From patchwork Wed Apr 10 11:19:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52573 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 3469D5F3B; Wed, 10 Apr 2019 13:19:11 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820058.outbound.protection.outlook.com [40.107.82.58]) by dpdk.org (Postfix) with ESMTP id 3A64B5F3B for ; Wed, 10 Apr 2019 13:19:08 +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=udffeqgbtO0LympPSHEp25yMitGXwIuFX+5JC1ih4YI=; b=bAhleyRW0N39WFLkrN+PTwIHMO4jpmUoBZC9okzx29gbhGaNdHH+5cp3jtY3J8czFXYMr4SImJp/fzZMYwIIr7d88Nl65OcOm/U4eVLr9vFz3kYnHmDyGO/I2gsuOTL+oSyRQsWvMk7zeMtrdVWcbmg/5mZgkmT0Yi8PzhKAO4c= 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:19:06 +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:19:06 +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 07/10] net/atlantic: interrupt handling of macsec events Thread-Index: AQHU7482sZt/+MRXU0u99ZqemArkog== Date: Wed, 10 Apr 2019 11:19:06 +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: 6599ff26-e09c-46e9-0a8c-08d6bda65832 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: Q4lhObe/fgAHG6q0p7A8NIuOnHsnIc38xX14MzIWTB5SwKJfyKXgrMYlh1T7yjA8kxcydQcXkTApt6ygUMdPBrJIat5dIOBpPBYKskWuzx0JQ3Aci9lY3t7U2q4gxk2WcfS2o7zrntTx5xkooJ6wTmx2Rb2DbKmHdetWMwDX+QJHE8BVV7NrSMGK7YN9I1QU4DNkQLjZOiNEQ6k0q/Dal2gTKEwuY/1mTe5LBUJEhq54jErVb6Xy/VPTCYz9ddvfBgcvvPTcyRSLcia970PTaOzE7g5sl3tfLOrBXQWvH8epA32riMnPbBgT53dAAKBINkGmAqwSPnXw+fd3anlwnusP/vaRGG9Iv7/KR+ko+Rbu2F8M4qkyspWoAqqVElp4fhY2bp+OxGmQpqxGImr+39+Y2Y6airQtW3Fwo8O4bhY= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6599ff26-e09c-46e9-0a8c-08d6bda65832 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:19:06.7163 (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 07/10] net/atlantic: interrupt handling of macsec events 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" From: Pavel Belous MACSEC should be configured only after link up event, thus we use link interrupt to file an alarm for configuration. FW also uses link interrupt line to indicate incoming events from MACSEC. These may include key expiration, packet counter wrap, etc. We pass these events to the upper layers. Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 66 ++++++++++++++++++++++++++----- drivers/net/atlantic/atl_ethdev.h | 2 +- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 502ef5308b4d..4a6975dcf104 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -4,6 +4,7 @@ #include #include +#include #include "atl_ethdev.h" #include "atl_common.h" @@ -1089,13 +1090,20 @@ atl_dev_supported_ptypes_get(struct rte_eth_dev *dev) return NULL; } +static void +atl_dev_delayed_handler(void *param) +{ + struct rte_eth_dev *dev = (struct rte_eth_dev *)param; + + atl_dev_configure_macsec(dev); +} + + /* return 0 means link status changed, -1 means not changed */ static int atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) { struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct atl_interrupt *intr = - ATL_DEV_PRIVATE_TO_INTR(dev->data->dev_private); struct rte_eth_link link, old; int err = 0; @@ -1122,8 +1130,6 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) return 0; } - intr->flags &= ~ATL_FLAG_NEED_LINK_CONFIG; - link.link_status = ETH_LINK_UP; link.link_duplex = ETH_LINK_FULL_DUPLEX; link.link_speed = hw->aq_link_status.mbps; @@ -1133,6 +1139,10 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) if (link.link_status == old.link_status) return -1; + if (rte_eal_alarm_set(1000 * 1000, + atl_dev_delayed_handler, (void *)dev) < 0) + PMD_DRV_LOG(ERR, "rte_eal_alarm_set fail"); + return 0; } @@ -1210,8 +1220,9 @@ atl_dev_interrupt_get_status(struct rte_eth_dev *dev) hw_atl_b0_hw_irq_read(hw, &cause); atl_disable_intr(hw); - intr->flags = cause & BIT(ATL_IRQ_CAUSE_LINK) ? - ATL_FLAG_NEED_LINK_UPDATE : 0; + + if (cause & BIT(ATL_IRQ_CAUSE_LINK)) + intr->flags |= ATL_FLAG_NEED_LINK_UPDATE; return 0; } @@ -1276,15 +1287,50 @@ atl_dev_interrupt_action(struct rte_eth_dev *dev, { struct atl_interrupt *intr = ATL_DEV_PRIVATE_TO_INTR(dev->data->dev_private); + struct atl_adapter *adapter = + (struct atl_adapter *)dev->data->dev_private; + struct aq_hw_s *hw = &adapter->hw; + + if (!(intr->flags & ATL_FLAG_NEED_LINK_UPDATE)) + goto done; - if (intr->flags & ATL_FLAG_NEED_LINK_UPDATE) { - atl_dev_link_update(dev, 0); - intr->flags &= ~ATL_FLAG_NEED_LINK_UPDATE; + intr->flags &= ~ATL_FLAG_NEED_LINK_UPDATE; + + /* Notify userapp if link status changed */ + if (!atl_dev_link_update(dev, 0)) { atl_dev_link_status_print(dev); _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); + } else { + if (hw->aq_fw_ops->send_macsec_req == NULL) + goto done; + + /* Check macsec Keys expired */ + struct get_stats req = { 0 }; + struct macsec_msg_fw_request msg = { 0 }; + struct macsec_msg_fw_response resp = { 0 }; + + req.ingress_sa_index = 0x0; + req.egress_sc_index = 0x0; + req.egress_sa_index = 0x0; + msg.msg_type = macsec_get_stats_msg; + msg.stats = req; + + int err = hw->aq_fw_ops->send_macsec_req(hw, &msg, &resp); + if (err) { + PMD_DRV_LOG(ERR, "send_macsec_req fail"); + goto done; + } + if (resp.stats.egress_threshold_expired || + resp.stats.ingress_threshold_expired || + resp.stats.egress_expired || + resp.stats.ingress_expired) { + PMD_DRV_LOG(INFO, "RTE_ETH_EVENT_MACSEC"); + _rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_MACSEC, NULL); + } } - +done: atl_enable_intr(dev); rte_intr_enable(intr_handle); diff --git a/drivers/net/atlantic/atl_ethdev.h b/drivers/net/atlantic/atl_ethdev.h index 1e29999b539c..cdb48e79472d 100644 --- a/drivers/net/atlantic/atl_ethdev.h +++ b/drivers/net/atlantic/atl_ethdev.h @@ -34,7 +34,7 @@ (&((struct atl_adapter *)adapter)->hw_cfg) #define ATL_FLAG_NEED_LINK_UPDATE (uint32_t)(1 << 0) -#define ATL_FLAG_NEED_LINK_CONFIG (uint32_t)(4 << 0) +#define ATL_FLAG_MACSEC (uint32_t)(4 << 0) struct atl_interrupt { uint32_t flags; From patchwork Wed Apr 10 11:19:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52574 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 CBE8069D4; Wed, 10 Apr 2019 13:19:14 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790058.outbound.protection.outlook.com [40.107.79.58]) by dpdk.org (Postfix) with ESMTP id B94936904 for ; Wed, 10 Apr 2019 13:19:12 +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=zUdD0xlwxJqxhsANchdPnsSpb5XueKDnJDs3SWLIyeI=; b=Q25M9O920y/Y73oLpub7B6Pp+suirJKFCkXWSbVVys6TqFlVgNf7dlo7BHbZC9jeJ/riTiv7hOaxT14XNsJaU/Bp+zun5vc/6HsTv/M5YQAsU+OmCLJDd0gGBrOol2flVEm5LQUn3KVHgH8iRD9/6FYXmyNIw9C8DKbpihqEcvA= 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:19:11 +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:19:11 +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 08/10] net/atlantic: implement macsec statistics Thread-Index: AQHU7484q6ACtC8G9k6GdvkqdWVZ5w== Date: Wed, 10 Apr 2019 11:19:10 +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: 9daf6084-5b5b-42f6-bff0-08d6bda65ae3 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: qF1aWz/kpEPogmjuvhqWoZu9q62fLqTgFksrol9+lR3b7m57ZI6pRXjiJ7gA6qtbjCwOZAYUNnEVnOrY4VuWmUP2nnmGIV6EZtkmgs2G8uKnvz/elbTKjSFZrp9S7HCCVWrrKLifIftqYAIv0c8rcedE4eg/cKpSCfs7YV9YuL2TON7OXsMF2gjgQhan50SuLvzRuacKWDsBNMzxHhlXoXaBJ6uCYVTQGtjEE+kVFaD84fGYjckFcEJpEqlYSaP/6BdKTNi0iQDu3e4Dkx5tNm6LsPLe+WEg+uFPd+CH8/8fzlsvVpUIsotSEG3sf6L+P87JH6RC22Ej5jZ9xsOGSDnPy89+SH9/uFcmtI5CYV5TkpHTTny1nEgYmlVgupG1qvuQoXyIKLmcFEVwyBxAgaiETeyJk74PUymdz3o+nmY= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9daf6084-5b5b-42f6-bff0-08d6bda65ae3 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:19:10.9682 (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 08/10] net/atlantic: implement macsec statistics 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" From: Pavel Belous We add extra xstat fields to include macsec counters and stats Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 82 +++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 5 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 4a6975dcf104..439a165664af 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -205,14 +205,27 @@ static const struct rte_eth_desc_lim tx_desc_lim = { .nb_mtu_seg_max = ATL_TX_MAX_SEG, }; +enum atl_xstats_type { + XSTATS_TYPE_MSM = 0, + XSTATS_TYPE_MACSEC, +}; + #define ATL_XSTATS_FIELD(name) { \ #name, \ - offsetof(struct aq_stats_s, name) \ + offsetof(struct aq_stats_s, name), \ + XSTATS_TYPE_MSM \ +} + +#define ATL_MACSEC_XSTATS_FIELD(name) { \ + #name, \ + offsetof(struct macsec_stats, name), \ + XSTATS_TYPE_MACSEC \ } struct atl_xstats_tbl_s { const char *name; unsigned int offset; + enum atl_xstats_type type; }; static struct atl_xstats_tbl_s atl_xstats_tbl[] = { @@ -230,6 +243,38 @@ static struct atl_xstats_tbl_s atl_xstats_tbl[] = { ATL_XSTATS_FIELD(mbtc), ATL_XSTATS_FIELD(bbrc), ATL_XSTATS_FIELD(bbtc), + /* Ingress Common Counters */ + ATL_MACSEC_XSTATS_FIELD(in_ctl_pkts), + ATL_MACSEC_XSTATS_FIELD(in_tagged_miss_pkts), + ATL_MACSEC_XSTATS_FIELD(in_untagged_miss_pkts), + ATL_MACSEC_XSTATS_FIELD(in_notag_pkts), + ATL_MACSEC_XSTATS_FIELD(in_untagged_pkts), + ATL_MACSEC_XSTATS_FIELD(in_bad_tag_pkts), + ATL_MACSEC_XSTATS_FIELD(in_no_sci_pkts), + ATL_MACSEC_XSTATS_FIELD(in_unknown_sci_pkts), + /* Ingress SA Counters */ + ATL_MACSEC_XSTATS_FIELD(in_untagged_hit_pkts), + ATL_MACSEC_XSTATS_FIELD(in_not_using_sa), + ATL_MACSEC_XSTATS_FIELD(in_unused_sa), + ATL_MACSEC_XSTATS_FIELD(in_not_valid_pkts), + ATL_MACSEC_XSTATS_FIELD(in_invalid_pkts), + ATL_MACSEC_XSTATS_FIELD(in_ok_pkts), + ATL_MACSEC_XSTATS_FIELD(in_unchecked_pkts), + ATL_MACSEC_XSTATS_FIELD(in_validated_octets), + ATL_MACSEC_XSTATS_FIELD(in_decrypted_octets), + /* Egress Common Counters */ + ATL_MACSEC_XSTATS_FIELD(out_ctl_pkts), + ATL_MACSEC_XSTATS_FIELD(out_unknown_sa_pkts), + ATL_MACSEC_XSTATS_FIELD(out_untagged_pkts), + ATL_MACSEC_XSTATS_FIELD(out_too_long), + /* Egress SC Counters */ + ATL_MACSEC_XSTATS_FIELD(out_sc_protected_pkts), + ATL_MACSEC_XSTATS_FIELD(out_sc_encrypted_pkts), + /* Egress SA Counters */ + ATL_MACSEC_XSTATS_FIELD(out_sa_hit_drop_redirect), + ATL_MACSEC_XSTATS_FIELD(out_sa_protected2_pkts), + ATL_MACSEC_XSTATS_FIELD(out_sa_protected_pkts), + ATL_MACSEC_XSTATS_FIELD(out_sa_encrypted_pkts), }; static const struct eth_dev_ops atl_eth_dev_ops = { @@ -987,19 +1032,46 @@ static int atl_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats, unsigned int n) { - struct atl_adapter *adapter = ATL_DEV_TO_ADAPTER(dev); + struct atl_adapter *adapter = + (struct atl_adapter *)dev->data->dev_private; struct aq_hw_s *hw = &adapter->hw; + struct get_stats req = { 0 }; + struct macsec_msg_fw_request msg = { 0 }; + struct macsec_msg_fw_response resp = { 0 }; + int err = -1; unsigned int i; if (!stats) return 0; + if (hw->aq_fw_ops->send_macsec_req != NULL) { + req.ingress_sa_index = 0xff; + req.egress_sc_index = 0xff; + req.egress_sa_index = 0xff; + + msg.msg_type = macsec_get_stats_msg; + msg.stats = req; + + err = hw->aq_fw_ops->send_macsec_req(hw, &msg, &resp); + } + for (i = 0; i < n && i < RTE_DIM(atl_xstats_tbl); i++) { stats[i].id = i; - stats[i].value = *(u64 *)((uint8_t *)&hw->curr_stats + - atl_xstats_tbl[i].offset); - } + switch (atl_xstats_tbl[i].type) { + case XSTATS_TYPE_MSM: + stats[i].value = *(u64 *)((uint8_t *)&hw->curr_stats + + atl_xstats_tbl[i].offset); + break; + case XSTATS_TYPE_MACSEC: + if (err) + goto done; + stats[i].value = *(u64 *)((uint8_t *)&resp.stats + + atl_xstats_tbl[i].offset); + break; + } + } +done: return i; } From patchwork Wed Apr 10 11:19:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52575 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 615DF7D52; Wed, 10 Apr 2019 13:19:18 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820072.outbound.protection.outlook.com [40.107.82.72]) by dpdk.org (Postfix) with ESMTP id B788C6CD8 for ; Wed, 10 Apr 2019 13:19:16 +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=ENsDmGX6Zf81SOkdv+o1e2F44nQsqOR82Uzj7v+rlTo=; b=W2aulKURznEwb0FjfqBA2gvkGcS6VHj7bDhe9SNtwDozoXyAhaAoyrXLgjoOdv48FkBYFbqekxfJf9KA1FCTAPX/OLjd2ajFPS7aNhJkG04ifP/T6v6YGpzccyABG/L6S4c21GYDOC/oDpPqKC9IbPBsMfcI2SFdZIft5jsgxo8= 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:19:15 +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:19:15 +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 09/10] net/atlantic: bump internal driver version Thread-Index: AQHU7487lkdOOReBKEuq0K83fHq4sg== Date: Wed, 10 Apr 2019 11:19:15 +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: 5f7929ba-bcf4-40f0-c601-08d6bda65d6b 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)(4744005)(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: y3S5QY88vuamkgg6Oe8BoxnFDun8KqVrCpDFNP0EiN7+Wb6jUeB3/WbSGAIXTwqGrU61NRWTclcSwnSnqQ6tvEmXALup/G2qFETNrd4N4Ogi/PC2NtTMgmNNv5LHWUg3w/6uvDcd6BanUCZRjTviG8JA6fv02SYO5m2t60boIErA/1GE4Y3PaxHNwnwrXRuqol+ciZCDngAIm0SsNooF8KJiVTN5caqTAFJeE+PdtxvEZrX22xq5pnpWBXfll83CnU/YTldH0oL2KYqkuBycWVHAVkIZ9h29+wwht/5Y8FjbJILXsIYjZZHKoefKEtrFGqOz61VknVDTh2dOM2dF+Wc5sUoK81fwDS1+R2s69GZmkosgqg4ygD5racIeoCx6+GgoYYW0aeuZXjn/jSd6kkvwhn/2tXDYT0RtIfN+J+Y= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f7929ba-bcf4-40f0-c601-08d6bda65d6b X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:19:15.3291 (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 09/10] net/atlantic: bump internal driver version 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" From: Pavel Belous Version is synced with internal Aquantia's driver versioning Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/atlantic/atl_common.h b/drivers/net/atlantic/atl_common.h index b3a0aa5cd212..54b3a3934044 100644 --- a/drivers/net/atlantic/atl_common.h +++ b/drivers/net/atlantic/atl_common.h @@ -5,7 +5,7 @@ #ifndef AQ_COMMON_H #define AQ_COMMON_H -#define ATL_PMD_DRIVER_VERSION "0.4.1" +#define ATL_PMD_DRIVER_VERSION "0.6.7" #define PCI_VENDOR_ID_AQUANTIA 0x1D6A From patchwork Wed Apr 10 11:19:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 52576 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 35C8E5592; Wed, 10 Apr 2019 13:19:23 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820083.outbound.protection.outlook.com [40.107.82.83]) by dpdk.org (Postfix) with ESMTP id 16B011B0F8 for ; Wed, 10 Apr 2019 13:19:21 +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=RmidBFayj40a/ND2aQ2E31ZbNQcU7vzW08tArQNaOSc=; b=QWhL5Ryo7HcYYiHUsFnAnkMTHUTjGpygZDNvgve7Nar6mvKURWgou69aB/DM7+jwEIviQJGakVQDOkiUSG4XCyOlx67euGXqkLmxvsoEsb3VJfDLkEvWlRZQZJlWDjz3a7Vi5S4wFd113KbqrKCtctM51v3Qy8TBpgF/zg8p2AM= 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:19:19 +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:19:19 +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 10/10] net/atlantic: indicate macsec in NIC docs Thread-Index: AQHU7489RHvs2O64OkmTHVSNa2oj4A== Date: Wed, 10 Apr 2019 11:19:19 +0000 Message-ID: <5e1fe1945684628179266635695babae4daf15e4.1554894242.git.igor.russkikh@aquantia.com> 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: 87919e2b-c3c9-4b9b-0d29-08d6bda66005 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)(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: NkRV5/iJi9n63LZs0nG6kOc+iG+2KdcE5G6cLpGz2J9lN3c3NNkMcrNxQXDO12xaY/0guF3T3B5JcrR7W02rR0Sn8zWR0LJRyS+srhyL36vGDsIghp7BKxGVIAGgfiCzh2YdSZf5ZfM42f2ugCFd8vHdmbWtKqmTfKSw0Efx4Fnh9lD9BeXTPFcjdZf4BiwPSMT7fYY0jDBePpdgWA1Hupok8ifyeABQF2Q3Eun65nPgfQJcriVVYqGX2CxuJNa7g8tU7senYSIJRaRK4/SxiqMlpyDifLg3fpM9DiagRSLywrOCsXs1j4lA2Q4wmFK5xzYBjORqXumBzbK1qgsSvHQbqf7aoa1LWKqKZZ+rLOxvVhRQqhzDJq66SHrdVmLDuiykkF51R7cZ55gPqzJe/i6OidVJAA0ajOuVqJO5WF0= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87919e2b-c3c9-4b9b-0d29-08d6bda66005 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 11:19:19.6591 (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 10/10] net/atlantic: indicate macsec in NIC docs 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" From: Pavel Belous Features matrix updated, RST doc is updated with macsec Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh --- doc/guides/nics/atlantic.rst | 1 + doc/guides/nics/features/atlantic.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/guides/nics/atlantic.rst b/doc/guides/nics/atlantic.rst index 80591b13c185..bb7e9525c93b 100644 --- a/doc/guides/nics/atlantic.rst +++ b/doc/guides/nics/atlantic.rst @@ -19,6 +19,7 @@ Supported features - RSS (Receive Side Scaling) - Checksum offload - Jumbo Frame upto 16K +- MACSEC offload Configuration Information ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/guides/nics/features/atlantic.ini b/doc/guides/nics/features/atlantic.ini index 5ed095b14323..2bb8ecc01789 100644 --- a/doc/guides/nics/features/atlantic.ini +++ b/doc/guides/nics/features/atlantic.ini @@ -20,6 +20,7 @@ VLAN filter = Y Flow control = Y CRC offload = Y VLAN offload = Y +MACsec offload = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y