From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0089.outbound.protection.outlook.com [104.47.42.89]) by dpdk.org (Postfix) with ESMTP id 4AFF15681 for ; Fri, 7 Sep 2018 17:23:26 +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=4iDG+QM/9j33IzhgoZeKaoADkx48bjEylvtEN9si9d0=; b=pBuigOrObOAQusH027W1WM0ONYVY7Ibum56LCietUZXS7kuGHy2TqviMKpzLaqt3tKkr/HnVLOod29SpBeui3q1rudhKteWdYMmpGZtZ6jhYDXwBEy8zelmwMN5EFk61Lj+6m7KXz18fMKluQuaif9d4vCAqU9ijEwE9XhCHLaM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 15:23:21 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, Nadezhda.Krupnina@aquantia.com, igor.russkikh@aquantia.com, Simon.Edelhaus@aquantia.com, Corey Melton , Ashish Kumar Date: Fri, 7 Sep 2018 18:21:49 +0300 Message-Id: <1536333719-32155-12-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com> References: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: BN6PR20CA0060.namprd20.prod.outlook.com (2603:10b6:404:151::22) To BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f303440-0bb2-430b-37a7-08d614d5d9a9 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1652; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 3:f50FVU4+jXPytVf1cdxszDVaxThBVBcoqlCoBJfKBSpLYwzysHpz8gBW7IEVhFuSm1LYhDMafYiLETWd2r0e/mxWjoVUAASLBfFKSF5opA0OmO0KdovdcJdnW4+/E84qzyD7MGZUOt05htzEZVEYxauZ94kHYrKBOQS7Z/8qB6wwaNVYLP7CIIqD+m9TgZtf5cnjikBHCXzIQyZgpz+7w8TX1/s5ARbOVVtT8rBzINbKPRobk3M8y1Mn4bSL0LEd; 25:ktqQgue3nsyO+dyxzLzHLPDgZJ5M4HBHpvENV0ok4v6GHEgP1J9cK6pCRnOc2pKMenlbk2nwdIDs36GA3hosYbhq2CgTDTeZKrwXfmgMTgVeHpPEezy0ta/i6v8RnZIiwq6SpqMedZqoPh9lNAJSRMS6DPD10jbAkMIlAoAAxsEXkPoPl0Yi/w1WAEqF3vPfaGF3raztOlxuN2IKy23UmbX/Ydzf7nwxrT944d76Fmj93apGthJCxbDi16mPytliq7boBb43zUmRemnu4gVkW3JoSF9nZeH0Xhz52w0EED9aOfN6A3wblmtSvfkXsjDLwkOpn6vdPlryiFizoFVhpg==; 31:0sPNA4wD80OOe9gmj8TouumtotOsqoSMJFAp4wzzlyWBjtMTx1f/V1S135TVz3KEVfFuQJ7lvFTeIsMbySpz+NEjVNR3lp/VAWtgPX6dHNRGabjm3Em+hr1mbAEE3NptG6p8OtXVyCCFPhC1/+kGWLemi2Fwuu5tx0icGh15/XJ/DtBqg4MCHtfKPcYnM2v91/W8UfUw2LWLiMXJ3ks0HllRuW7USdp0QK4y3nmIGjA= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1652: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 20:7q7LdP2RITifBZh1QwSmD+cZ0boX7NMx7fTLRxn+KSF4kdE8dXSa5PODHp1PBrkSuC/dydyt3KRq4Q4kCc85+GCyOmQVyVIVXoIclMVSDzujxX/O7/b6S2huSabkjMBaoPR2b8hjMhdKvFbdFkJN9MAYlitqx3ZAcae2weFiuarH1zi+IiHOStO7+tSn3UEfWM7Ak5mQap+lGA8NuNcTAps2iWHQF7pAoZ0lsACj1eSxlRrnmE4djQOEorcUIuUocSbpjkAcVGsev+lK6/BwVNirCWxXsrRxYNI7j2CpJ0xMp4bzFtW7jD7jYKZOUt9TCyD1rk92cZGph6MzpJyi54pQx3medeCccfAvJEJVaEZYrTMoUSbBV1+3PdZNonErN6eukSmcL2Oq4tD+oWT7yaY5xROyMDFnzvsXFcOISGJRwOViIh6AvmSU1VAagl7PZfV4pWbenluWDmckMp2iR4WbkaNmRj80FHonFpMfryU9RHWMX3j9fU8p7Z3qy7yJ; 4:96dR2bW40hvfSfaY7+SrI5NF4ZcbOC4XCId/xMsCJG1ij7ULje9l6Qpyz5pwNrC83IWLW9qdsFEg20wrYxm6tK34k6lEMX99y5a4Cv/WyzSu6YXV07LN8thewHfvPWtDExbPbUCSUswuiv4f4bMnHCRU7P59MRAL49obcoaucWSUOARTROmS5ISNrxasbF49nEgifv3k4w88PfaxvFH0znj4StN5F4RO01+s3ATInelbzYcaRolWS7ZuP0qoj2P+hSJJ6IVJoQKrUwmNPG0MDg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:BLUPR0701MB1652; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1652; X-Forefront-PRVS: 07880C4932 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(376002)(366004)(346002)(136003)(189003)(199004)(81156014)(81166006)(44832011)(8936002)(2351001)(486006)(106356001)(2361001)(105586002)(446003)(2906002)(50226002)(476003)(11346002)(956004)(2616005)(305945005)(7736002)(16586007)(316002)(54906003)(14444005)(16526019)(66066001)(26005)(7696005)(52116002)(8676002)(51416003)(76176011)(186003)(386003)(68736007)(478600001)(6666003)(6916009)(6486002)(5660300001)(53936002)(47776003)(4326008)(25786009)(86362001)(48376002)(50466002)(575784001)(72206003)(6116002)(97736004)(36756003)(3846002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1652; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1652; 23:qsMVV3J8TBANz37xYMG61hJyTiXKUoQqaD5CoZm?= =?us-ascii?Q?mJRyNF6O0Eb5fDByjV3k0NVvjHnxEBsvxmM5nLAb11AN+4C81ojkbQl/TGf0?= =?us-ascii?Q?wO/okMvXgQ3KsWsOxZA+4fqNx5lssfsYAC1J5zv883YaZ5/Ohlr1XVQbxSO1?= =?us-ascii?Q?ukMAu0gniakC9bL7lKjb/QszW0MnSUgMbZiBGZtsBuUkisd7mByQcXNfh02x?= =?us-ascii?Q?Fqjdk8IovSQXUnrw6gaLOeZYt2xnvkBTEYq93d2sIZRR+SaD/DDbih2oNFiZ?= =?us-ascii?Q?/lHQpsvx+2ka2cHYXHL1t1BZDz9LvdAN3GlEhjuT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ODUmoAngrlxOIoV6O2nzz5IQnIJde2GUrpgqgGMobBNsIXqGJqGDt23xBTjoZLHG3lv/UBAIKluPu4B6aAeWxGxzkQdq+YFllsgKDHWtFTGCbQPvgpxmL8zPR/4iHjN0Zc8kDNgsULM7k=; 7:Pawjr7xjw01UrF6Qb1Byv1i6cV+0GFc0ltVjoS8225Ikk/5q7ODA5bkUhf8kL0nwQifv8H7xuCP7mlp/yWobzSsjWLiew5O6bu/NlgtXAvTiGbdIyRVZhhPC3HsyH7w5PGEamYF7visZPWC5lo1SNJ61XVwR+grBwvM9X7BuomUUBfC3/BPSi0h5mVtfi6hG+osdpd7ttshwNpVaKbZGPpaCvK6cHOQqbeX3KgpprAFdSn1Kn7qaJVM/u/opfqGY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 15:23:21.8418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f303440-0bb2-430b-37a7-08d614d5d9a9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1652 Subject: [dpdk-dev] [PATCH 11/21] net/atlantic: RSS and RETA manipulation API 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: , X-List-Received-Date: Fri, 07 Sep 2018 15:23:27 -0000 Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 93 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 6dda8280a..ec1c22886 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -75,6 +75,19 @@ static int atl_dev_interrupt_action(struct rte_eth_dev *dev, static void atl_dev_interrupt_handler(void *param); +/* RSS */ +static int atl_reta_update(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size); +static int atl_reta_query(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size); +static int atl_rss_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf); +static int atl_rss_hash_conf_get(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf); + + static int eth_atl_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev); static int eth_atl_pci_remove(struct rte_pci_device *pci_dev); @@ -143,6 +156,12 @@ static const struct eth_dev_ops atl_eth_dev_ops = { .dev_reset = atl_dev_reset, /* Link */ .link_update = atl_dev_link_update, + + .reta_update = atl_reta_update, + .reta_query = atl_reta_query, + .rss_hash_update = atl_rss_hash_update, + .rss_hash_conf_get = atl_rss_hash_conf_get, + }; /** @@ -796,6 +815,80 @@ atl_dev_interrupt_handler(void *param) atl_dev_interrupt_action(dev, dev->intr_handle); } + +static int +atl_reta_update(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size) +{ + int i; + struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct aq_hw_cfg_s *cfg = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + for (i = 0; i < reta_size && i < cfg->aq_rss.indirection_table_size; i++) + cfg->aq_rss.indirection_table[i] = min(reta_conf->reta[i], dev->data->nb_rx_queues - 1); + + hw_atl_b0_hw_rss_set(hw, &cfg->aq_rss); + return 0; +} + +static int +atl_reta_query(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size) +{ + int i; + struct aq_hw_cfg_s *cfg = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + for (i = 0; i < reta_size && i < cfg->aq_rss.indirection_table_size; i++) + reta_conf->reta[i] = cfg->aq_rss.indirection_table[i]; + reta_conf->mask = ~0U; + return 0; +} + +static int +atl_rss_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct aq_hw_cfg_s *cfg = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + static u8 def_rss_key[40] = { + 0x1e, 0xad, 0x71, 0x87, 0x65, 0xfc, 0x26, 0x7d, + 0x0d, 0x45, 0x67, 0x74, 0xcd, 0x06, 0x1a, 0x18, + 0xb6, 0xc1, 0xf0, 0xc7, 0xbb, 0x18, 0xbe, 0xf8, + 0x19, 0x13, 0x4b, 0xa9, 0xd0, 0x3e, 0xfe, 0x70, + 0x25, 0x03, 0xab, 0x50, 0x6a, 0x8b, 0x82, 0x0c + }; + + cfg->is_rss = !!rss_conf->rss_hf; + if (rss_conf->rss_key) { + memcpy(cfg->aq_rss.hash_secret_key, rss_conf->rss_key, rss_conf->rss_key_len); + cfg->aq_rss.hash_secret_key_size = rss_conf->rss_key_len; + }else{ + memcpy(cfg->aq_rss.hash_secret_key, def_rss_key, sizeof(def_rss_key)); + cfg->aq_rss.hash_secret_key_size = sizeof(def_rss_key); + } + + hw_atl_b0_hw_rss_set(hw, &cfg->aq_rss); + hw_atl_b0_hw_rss_hash_set(hw, &cfg->aq_rss); + return 0; +} + +static int +atl_rss_hash_conf_get(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + struct aq_hw_cfg_s *cfg = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private); + + rss_conf->rss_hf = cfg->is_rss ? ATL_RSS_OFFLOAD_ALL : 0; + if (rss_conf->rss_key) { + rss_conf->rss_key_len = cfg->aq_rss.hash_secret_key_size; + memcpy(rss_conf->rss_key, cfg->aq_rss.hash_secret_key, rss_conf->rss_key_len); + } + + return 0; +} + RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map); RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic"); -- 2.13.3.windows.1