From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0076.outbound.protection.outlook.com [104.47.42.76]) by dpdk.org (Postfix) with ESMTP id 6B2975911 for ; Fri, 7 Sep 2018 17:23:40 +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=nMlTIjXCwrUV/DEjr/GANupDcbU1tL8/FSPhx3pq9XQ=; b=QQ8aa9MxpMZqr0xO6Jg+T41+cyVqKlaPPNcCNM5rd19/vBVHtl93ChODakDK2x9o93DMGngFtRmlgswj3KhkxpKX+Z54HG4ECC5iiyuJZ0gCxMyvL4HeRZ2zt041KzW89nF6ZNNr0QbbhyWU02HEMyGxGEGN/86RtO1jwFQc6pM= 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:37 +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:57 +0300 Message-Id: <1536333719-32155-20-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: a16f95e3-1ed5-4c48-31a5-08d614d5e2d5 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:HMlaG2qTFqpMI6WKerNpCo0kuhw8pfbPwaXNh57+asgOhXFLTq99St9+WsZ/CKXmVy6QPvh46fZPMafOIwtUNNpC+KPbzSSadiOXlUeFQvVW2+AnOrUPxvo0aqnzWvYQPnblR/+/AtmAyieJ3k0ebJqVk8DLOA/6YwociT+eYm2Hff1F5hmO1qfEjmqMq4NTsiCuXXiD061XvkvZwITu0H46yD3ysW06ZDVXUDPgLWWOXnHRwZaVb9DCt0QCVTCe; 25:WtkfqzeeROm1+sPfa7/jvVzJAGIWjGA2803lKxFfRQFIPzXO111ZVJi9rDFxUthe1N4HmCIO5XSZWnfHV1Xgz3oVBo0KXEXbCbOENJ5rswZCPm6Sijhtgb+60dT5X8g4YgeyGv7GPCXPy+H8+dj0YobLCAytMkOIs36gJb3gN661T8EAR4KNQFf1DajkU7IfbBJtcSI5ilZYplMWXGTUZQ4vNaZgC/wbGAwfXD8P/65rFDXICgZWX07Ybv705KNZhuxaxSc7MwlWi88x97o7a5MdwarDZ813gKSdfpq9UANkxgjOtDxsW0SirB8jdPd1sVpLTV73+phUzSSRGRLEhg==; 31:uZIQbZ6WPi7SuRx1jp+UXV5MPZ7hUKkAw4sBrom+I515XANRs6/F7bAzJILOaco+L4tsRHFbq81MJQf29QCHBiFBq0o2AFyEL0/2BbBiQTKos3ZNVyHSr9+ekl98qsrGQWL8jYRu34s0fetUhp6WocIPLTCuegzTJYC9SFYt0BsfOL8966sqwgPE4zYJFJYUqtn7nWexupoGx13c2gHNTWDyqjknQXlFS7OhUoxy0Zw= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1652: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 20:xcrBfR0uYo4ajmM8vhZBVJVjQtuEnZ4k4ofN7PPvKEU+1Y6YMVG4U86A2DViTxeYvgJNki3sscKqDRTKXVOBKBD2oaoR9x8942xvGITHC7tmsKvkSzzVVSItiTlRm2nJhttxuLs7kKEV+EqAyQ8ODo9ZQdB9/srB1qTvhrCugP3SvXzabq3J49kpMr6Fk5wCyIGXvKdhfKnfsfImqGztylBcgt9o2H6eE2ju7NYxlT2nPnFU343T+oxYqu535uXo/UGYkEU31+2FiSbxgpwdi4xzEfhwqz1K7RWhMhF8QGKCFbSyLdN2sGcPEVtMQq1bfpTIXidy8MJagt5bUyeNrCcrDgrj2HRoAv1VgvjnocNpiimgAnZodlo+7FU0Nvq6CVHYOJcv/hBIoaxDpw05Q+t1Pz5S/Iw2kNjDIvlv8styQwMaZojyLPYY0NjbkIQf2Z5AV3P6Of8OlWz1ix3l4QIdjV13CX8zPtBzrvOvtyJDPiqJPB1/egFR8Zd18sIj; 4:n2/8yGiJV3vz4YOx79RvoeHLX0QgBKOLV0T3KK+6ohe79UtKfcQCWhtzVDbm4VvIP2xxaVBtsZIB22rNfp4UQ7uoU2e8oQYtoDeg7Ear84oCXbakIEsJMP65Nwl881bQaKgfQSVRZXqWgiR1VCasEbrkNWQ5ujnXiMxHv3P9Rg7eWG2nyKAjg9akf5WX+F9g11r/0hGG7Gn07NiuSAMoz35mTIv7/YSdU2gJK0Y1TIwJbfG0/t8reB4f690w3zhBMhast3yxRD5pe7RoC71B4Q== 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)(72206003)(6116002)(97736004)(36756003)(3846002); 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:1OEwAhckVV9l7wC1sIigdPapDRwrwO0kOTgvgp4?= =?us-ascii?Q?X5Bn0QydO0J6K8Q9dFSHhlGqSh94AykJ1oo/PkZ3q/cokBcpwshZ1zNi1nsH?= =?us-ascii?Q?3tSUQY7XzHVqXLmk3tIm2ajyCihn4tw82EY8gcP8ssjj20LYVJpJewk2tCGd?= =?us-ascii?Q?YHi6yWYNCbkCFwoCQSjD/71GgTUvjz4BQ7N+9To3psjO8GL5+xtaMsUzcnDp?= =?us-ascii?Q?2C1VNyo5f3xi0pHco/zkbw5rSUB+62YIWMmSrWFJwfNMwcIhv+vEuNSGoqC6?= =?us-ascii?Q?VGnYhRQxWyRbqKy52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U5HeTthcnGRRm5R3fUsBmXezml38m91i6msJNv02HkY0jRAxnWMKjnBif0RoWc/lRsBsKfQwkgmPM4+kR0w8aQWja67NCj6UE4bIAVT1VKGXX83tXW8=; 7:aw5D7WLUFL+ZEs7Mkdh1V23KRJyH7A6qw2xawWw3jVykhXns0J182HEry8tjMkdnc4QQr0/+VsAc1cgFwQUhrHjHkzAlMpI4BKuqHsJRNyKXhtFb3HH2Oow6KrqFUKkrV7DXYOHC6gMpcplJ7tLkhpDXvTomF6dQTXSu/hHKrBwnJ4pGMMacKxL8S1v+Qs1HqG91M0oygl7JdqgB90DyjbNtYJnFg+HPnCVQZSjxdzN2P+Ub82f/2f+0ZvwvuVjV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 15:23:37.2164 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a16f95e3-1ed5-4c48-31a5-08d614d5e2d5 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 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: Fri, 07 Sep 2018 15:23:41 -0000 From: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 160 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 80b7ac88e..44cea12ab 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -78,11 +78,14 @@ 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, @@ -111,6 +114,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); @@ -189,6 +195,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, @@ -257,6 +277,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, @@ -657,6 +683,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; } @@ -837,6 +864,94 @@ atl_dev_xstats_reset(struct rte_eth_dev *dev __rte_unused) { return; } + + +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) @@ -1254,6 +1369,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) { @@ -1501,3 +1648,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