From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0072.outbound.protection.outlook.com [104.47.32.72]) by dpdk.org (Postfix) with ESMTP id 306645B38 for ; Thu, 13 Sep 2018 13:36:14 +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=jPGXZhs59LQWRBtOPOBJj/Fo2VZoJLHficS0MkTP+jo=; b=DFq0JgMMaZgH+7+B6jHQtVrk5l9mdH4yCvLcM7PPjk+NdcC+vNrvzh3XPT8m4G+4x6R2exLmmjtDUtxIi1AjIm2WuF0nuhVBf6vkDUhREGfOJwv7G2qBUuw3gW9yjTOnin8F4/6YnqD3a7OHSkxr/XVDxLZ75bXAR3/e7c9QJrQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 11:36:12 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com Date: Thu, 13 Sep 2018 14:35:26 +0300 Message-Id: <1536838528-11800-19-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536838528-11800-1-git-send-email-igor.russkikh@aquantia.com> References: <1536838528-11800-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: VI1PR0202CA0026.eurprd02.prod.outlook.com (2603:10a6:803:14::39) To BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f322591-b77c-43a4-d9f7-08d6196d1bde X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 3:v4Kt2e/ooIhBAtn09Qp+JvwrmK/wgzuu1pFRfN5YhkBJQlQEAoOlf156NppeynHcghclqtWjqo0bUMHdcBi+0Th5RUbqd44ZfrkaIc3RU6Te9GgixU9CwFzoSCW4IrqA84el2AhTB33Nt5CQS73Col+7xV+JtHWWvpzb4vrecHBavsk0+XVWSUYNhm+oV8cuqOCpMFGUBDcXpZEPqv6b6oE/DCp4YsMdfpRJv5dS6R8VLRCz2LWcXAOnDF1xA2NA; 25:+XDTkRY56WX2ybVlw/sdYjEQygt1Xn9/iHKY3l88PqBrud1g7z2iWY+DX1JX6c7b42p0QhKtES1pkmk9yN6+m4g+FxcNLjMA2d0v6XYArHOzBS0jdhlmUyQWU9Ero9H/JFnCiiTUc5V/ywSkW5cCgdsRuFcwtHOMLpFTWIlWA/uGWMdOUJfjZx7s97yBoJrmaNKaW7GNhS6YHYfJvXv5Y67TagJGajTdT7OqdAM2ZzjvL+jLbAUgBQvft5eoucvzTQz6aBHpx3X7OleYwzxOHP1sYspCD2C2OEcdA3YK9fRMWMEXPLas8Sk+v0qz1lW0DqD4FVgvE5l9uqMln8RIFGKiiVeakPeN45VwArjhmOM=; 31:13AlrdBG8EwteZiifrn7zIGDyaOsubGRboq2nI5qAhC1154ae3ptpXoBRxcf9pymGz9Zcm66dA586O0nBRc6fbLD+NFt+XmixeFX6Xe0ALHo0tX/cfP8D2eDd3DzPEB2NGVuWJBZUWcaxuNKIOm01dx+1qNP4XhVnu2uqZHFeyqvJdlHwz1dPBVmAQumMY3smVIxyn7ZwA/gxE27Ro5Pc03/51afmS2aDEO7AM6rafY= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:F6q60sqbSnKOErkxpX+51tixPpsgl/YtY8gQRPSrQAmQfXKI+qibdKwzpVTd3rGvwcLvVsoCiyt1NYnfGkrTPzYoft2Zi9uLlQOpKiSNhfb7y/GmI7LgIgdpUgNhqQXy6/MGGQ3Z5EQJVvmasA+p0G3VpW/iSmp3LaBZqOgDqLKlYd5yqg0sakd+cQxLfQgUpOs+oiQD1S3QDb1tjE1/HsnnkqpaH2vhBXvxPNZ/h1rQYpYtNK0gP+hOc+Zmva9dlgbD8odfIlkqjiClzzx5Cph0V7KZHTlRDRFnh3Fz+5sEvbJtGzicuN6K6xbHwpXnT4laoqFn2cXhvLm7yg3/jPQaYT84rNut1fF+oX6/WH0/Jji8S2HWnty0oXYThf47JcYhtU8RXNEaoHOud0stqdPJnuBAHZvNGQ6xOxGW8yz2YjDX4NZI6NOONGeBaKrSDU4u8QpMmhH79ZjTrALS7vslBvgl9U8/YtTViQ7V1Zh0eq7zkjTtJws5xYhenWUm; 4:cBL9Aw8LI9P3u6WLNTpkYuexYdyCMq0vLPWqie5+ddLg42mejFj4xOpa6y4C9DJ9DoHzPCm4xIAh73aT/0DGbS4VIKrN1E4BZ8hCrlTL0Fw8kktRJ+g5HL3nK6xk3CV8E8nH1aRboew62c/ewXlmAh5uWM2xFqr2e37j6dX44lcAXfA9DoPs+SQWDO3+ag1SZoq1vK72zBgjWCx3X/mFZSlxpnQ8TmmG6U/p7kZae22Qtkzt+2Wl9kKr/ruFdB1Mb5EJzj8RBitvp97m+XrDXQ== 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)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(366004)(396003)(376002)(136003)(346002)(199004)(189003)(6666003)(6916009)(97736004)(8936002)(68736007)(25786009)(50226002)(81166006)(81156014)(4326008)(107886003)(6486002)(51416003)(2906002)(53936002)(5660300001)(36756003)(86362001)(316002)(52116002)(8676002)(16586007)(7736002)(305945005)(11346002)(446003)(476003)(956004)(47776003)(72206003)(66066001)(44832011)(478600001)(486006)(186003)(26005)(16526019)(14444005)(386003)(48376002)(2351001)(106356001)(2361001)(2616005)(3846002)(105586002)(50466002)(7696005)(6116002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:ubuntubox.rdc.aquantia.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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1650; 23:LDGQ40AqLVl11kQfiNSqsRBB8/HXy2E88USx7Oa?= =?us-ascii?Q?LXQnHxerB/K2l5tiSXHrUo44P2cveC6RMvbh9ED/xPdLgjpBMluIuPgSPrjb?= =?us-ascii?Q?mE30LdybfztYDef2aFv3FBVIrq5TWVsIv1jxksL5GQowXpPYMLUh7Ozf77Ny?= =?us-ascii?Q?f2SXJNOk3/wLxeiDRf+6ps24eNKj7z0p7neLSPZ4D/SrKaNZOhziYA0+90ZL?= =?us-ascii?Q?s6ZM4U8AYOsGCo2mFzIXoK+lriv/pxYLLNheNv3BBajPTVt36Ye+W7ky9GF7?= =?us-ascii?Q?VZFHFDnetqSjVq1GzwvBtTEkHxn4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5rSH4YX/z+qNjy2WdfrUrGf9DJHLzZm2EAqQUY8NJP/62Ln+4Iske0g6IpHWOZrPlpn9hMm5cgNlwLdlcY7iM/5VOvZIO+1QjAjpErbl/z+AVdaPyF/g9FRawgI8=; 7:RIBNmgdtHuCa5TNb/+21YgIIHlRjb5/Egx2aodZF8qELZoDs7J2HFyRNZYCaGHDz85Xaej6Jsyx44/BEm8WHrw12deamc4FsCfVKAUHUh3Z5sdCMo2V+4d796bjemymZSOWLD3GH/mtsPNjP0lTJCJ7K9B6ww4uKwFrzhpJQ+ROFlxLdB1tuor5Zam9IrIly/3xQp1hzpjvHmP52EcnwEHq+Ah7cMQHudwCo5PA7fRVAVu5VXfGrXmLGAaewQYK1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 11:36:12.0305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f322591-b77c-43a4-d9f7-08d6196d1bde X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1650 Subject: [dpdk-dev] [PATCH v2 19/21] net/atlantic: device MTU and statuses 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: Thu, 13 Sep 2018 11:36:14 -0000 From: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 162 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 7ff1126d7..01700b4ad 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -78,11 +78,15 @@ static int atl_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev, uint8_t is_rx); +static int atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version, + size_t fw_size); static void atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static const uint32_t *atl_dev_supported_ptypes_get(struct rte_eth_dev *dev); +static int atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); + /* VLAN stuff */ static int atl_vlan_filter_set(struct rte_eth_dev *dev, @@ -116,6 +120,9 @@ static int atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); static int atl_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); + +static void atl_dev_link_status_print(struct rte_eth_dev *dev); + /* Interrupts */ static int atl_dev_rxq_interrupt_setup(struct rte_eth_dev *dev); static int atl_dev_lsc_interrupt_setup(struct rte_eth_dev *dev, uint8_t on); @@ -195,6 +202,20 @@ static struct rte_pci_driver rte_atl_pmd = { .remove = eth_atl_pci_remove, }; +#define ATL_RX_OFFLOADS (DEV_RX_OFFLOAD_VLAN_STRIP \ + | DEV_RX_OFFLOAD_IPV4_CKSUM \ + | DEV_RX_OFFLOAD_UDP_CKSUM \ + | DEV_RX_OFFLOAD_TCP_CKSUM \ + | DEV_RX_OFFLOAD_JUMBO_FRAME \ + | DEV_RX_OFFLOAD_CRC_STRIP) + +#define ATL_TX_OFFLOADS (DEV_TX_OFFLOAD_VLAN_INSERT \ + | DEV_TX_OFFLOAD_IPV4_CKSUM \ + | DEV_TX_OFFLOAD_UDP_CKSUM \ + | DEV_TX_OFFLOAD_TCP_CKSUM \ + | DEV_TX_OFFLOAD_TCP_TSO \ + | DEV_TX_OFFLOAD_MULTI_SEGS) + static const struct rte_eth_desc_lim rx_desc_lim = { .nb_max = ATL_MAX_RING_DESC, .nb_min = ATL_MIN_RING_DESC, @@ -263,6 +284,12 @@ static const struct eth_dev_ops atl_eth_dev_ops = { .xstats_get_names = atl_dev_xstats_get_names, .stats_reset = atl_dev_stats_reset, .xstats_reset = atl_dev_xstats_reset, + .fw_version_get = atl_fw_version_get, + .dev_infos_get = atl_dev_info_get, + .dev_supported_ptypes_get = atl_dev_supported_ptypes_get, + + .mtu_set = atl_dev_mtu_set, + /* VLAN */ .vlan_filter_set = atl_vlan_filter_set, .vlan_offload_set = atl_vlan_offload_set, @@ -664,6 +691,7 @@ atl_dev_start(struct rte_eth_dev *dev) return 0; error: + PMD_INIT_LOG(ERR, "failure in atl_dev_start(): %d", err); atl_stop_queues(dev); return -EIO; } @@ -850,6 +878,95 @@ static void atl_dev_xstats_reset(struct rte_eth_dev *dev __rte_unused) { } + + +static int +atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size) +{ + struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint32_t fw_ver = 0; + unsigned int ret = 0; + + ret = hw_atl_utils_get_fw_version(hw, &fw_ver); + if (ret) + return 0; + + ret = snprintf(fw_version, fw_size, "%u.%u.%u", fw_ver >> 24, + (fw_ver >> 16) & 0xFFU, fw_ver & 0xFFFFU); + + ret += 1; /* add string null-terminator */ + + if (fw_size < ret) + return ret; + + return 0; +} + +static void +atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) +{ + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + + dev_info->max_rx_queues = AQ_HW_MAX_RX_QUEUES; + dev_info->max_tx_queues = AQ_HW_MAX_TX_QUEUES; + + dev_info->min_rx_bufsize = 1024; + dev_info->max_rx_pktlen = HW_ATL_B0_MTU_JUMBO; + dev_info->max_mac_addrs = HW_ATL_B0_MAC_MAX; + dev_info->max_vfs = pci_dev->max_vfs; + + dev_info->max_hash_mac_addrs = 0; + dev_info->max_vmdq_pools = 0; + dev_info->vmdq_queue_num = 0; + + dev_info->rx_offload_capa = ATL_RX_OFFLOADS; + + dev_info->tx_offload_capa = ATL_TX_OFFLOADS; + + + dev_info->default_rxconf = (struct rte_eth_rxconf) { + .rx_free_thresh = ATL_DEFAULT_RX_FREE_THRESH, + }; + + dev_info->default_txconf = (struct rte_eth_txconf) { + .tx_free_thresh = ATL_DEFAULT_TX_FREE_THRESH, + }; + + dev_info->rx_desc_lim = rx_desc_lim; + dev_info->tx_desc_lim = tx_desc_lim; + + dev_info->hash_key_size = HW_ATL_B0_RSS_HASHKEY_BITS / 8; + dev_info->reta_size = HW_ATL_B0_RSS_REDIRECTION_MAX; + dev_info->flow_type_rss_offloads = ATL_RSS_OFFLOAD_ALL; + + dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G; + dev_info->speed_capa |= ETH_LINK_SPEED_100M; + dev_info->speed_capa |= ETH_LINK_SPEED_2_5G; + dev_info->speed_capa |= ETH_LINK_SPEED_5G; +} + +static const uint32_t * +atl_dev_supported_ptypes_get(struct rte_eth_dev *dev) +{ + static const uint32_t ptypes[] = { + RTE_PTYPE_L2_ETHER, + RTE_PTYPE_L2_ETHER_ARP, + RTE_PTYPE_L2_ETHER_VLAN, + RTE_PTYPE_L3_IPV4, + RTE_PTYPE_L3_IPV6, + RTE_PTYPE_L4_TCP, + RTE_PTYPE_L4_UDP, + RTE_PTYPE_L4_SCTP, + RTE_PTYPE_L4_ICMP, + RTE_PTYPE_UNKNOWN + }; + + if (dev->rx_pkt_burst == atl_recv_pkts) + return ptypes; + + return NULL; +} + /* 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) @@ -1275,6 +1392,38 @@ atl_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) return 0; } +static bool +is_device_supported(struct rte_eth_dev *dev, struct rte_pci_driver *drv) +{ + if (strcmp(dev->device->driver->name, drv->driver.name)) + return false; + + return true; +} + +bool +is_atl_supported(struct rte_eth_dev *dev) +{ + return is_device_supported(dev, &rte_atl_pmd); +} + +static int +atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + struct rte_eth_dev_info dev_info; + uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + + atl_dev_info_get(dev, &dev_info); + + if ((mtu < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen)) + return -EINVAL; + + /* update max frame size */ + dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size; + + return 0; +} + static int atl_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { @@ -1533,3 +1682,16 @@ atl_rss_hash_conf_get(struct rte_eth_dev *dev, 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"); + +RTE_INIT(atl_init_log); +static void +atl_init_log(void) +{ + atl_logtype_init = rte_log_register("pmd.atlantic.init"); + if (atl_logtype_init >= 0) + rte_log_set_level(atl_logtype_init, RTE_LOG_DEBUG); + atl_logtype_driver = rte_log_register("pmd.atlantic.driver"); + if (atl_logtype_driver >= 0) + rte_log_set_level(atl_logtype_driver, RTE_LOG_DEBUG); +} + -- 2.13.3.windows.1