From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C4B51A0559; Mon, 16 Mar 2020 10:34:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5DFF21C0B0; Mon, 16 Mar 2020 10:34:55 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 384E21C06D for ; Mon, 16 Mar 2020 10:34:54 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02G9VOiP024310; Mon, 16 Mar 2020 02:34:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt0818; bh=mWYtTh/wpHJj5UKGz09iULz29HxTA7f3/KnyXpVbb3Q=; b=WvIAq6RNBXLI5QHQux6exwcUjzD0ld/I1cMv5L/pteLtenDD01baZ4zpJMbsSxS9PTlv pZtjSJKO0Jf7aILSbfz4bblFWLmeSGcvEFm7GJLlzUGP+SjrzxH7Bk9gUQmOZTzAb/fo 9SAk559hJlGwylddvCNh5YyE1/hQH7R5tO/cpyzloI0KE+bitaZabjBfsFOZVfnJM0kR My1sw5h80pWk+9iDdQk25b0d7jhedsXoZ3hPnjlF2SBAAJyLRtMr0XP/jZerTUpV3CFN 1df4vxskqIspdlMSNwXfdeBfeymkM81imGH8r+w5cnAW0/WU3sKBRPvNv7kwJs4EH3qX Gw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2yrvmqppy9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 16 Mar 2020 02:34:53 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Mar 2020 02:34:51 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 16 Mar 2020 02:34:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LCzrDKE+RPChDtOfCAhXroFN+YF7fAlTMW3+UlvNKzQIPRRGUMIizxvo0mvekv+U7oTy8aZcrU4zOgUD76JJsVSwkIrsxJTSfqkCnLTS/BJxiC4BVHF3fP41Xm350nMi7nDbK5tDqCh7+GHl+D8uLsuLjLHjyeWsNHc9q3qd+EAAUrovDYeRBs8KXDy9ZmWJjhlMPuW6Kcc6HQflzEC2uOXZPsTRWQPxJPSa6+Urk0bh4BXUq4KUPgW448wB9dY8EhI+5U4+MUf7isd1uEhi+5NjL5xnhot//4n6G630m2xNvnBGQLZj/XUioFBoeT9lLWrx7MB9jbA/w8prxtqLow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mWYtTh/wpHJj5UKGz09iULz29HxTA7f3/KnyXpVbb3Q=; b=VKiP6+zYxnOKbgiTbTHzaUIM+7Nin03d6sbqvWOPrzlt+xW16zcQ0Xs2rYJnVN7MMdLuyUZ9a+wdwsuo4dZoeqieqJn9oDvDRKe71Y8S/ZqkPnE5DQP3++6LXSebylNqaiIV3rjQY6uqGzJzCNsw65AxLHy3HKBnXBVDnvRBbRjpm/H3Fcli48GdMj6krmk5x+x+E99iT7XTPuXv2jZY5hHeD4+SRpef/sCco46TefpoB7xNS6sbxM5JODBCtZUvemar4PJiIUso+hkopfTZyAmAkIXCEbnEmdPflj7WCKqO3CwPYmkU2oq8ZMXc/nW4rG/YCIp/GDHfwaGZfpw3RQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mWYtTh/wpHJj5UKGz09iULz29HxTA7f3/KnyXpVbb3Q=; b=d61pm+K6ptfa5ubaGD/9XTq+jqx0OpVEseovvTljMeR957cTNThEK6RpoE2xitokJ1YagIwWf33rSRf94JYGNcMzepIuBbKI5S+FXS/FxUcZujgMEBVJ6CY8YGEOibMp6NPAzFXvpR5KQtsWA589LnQtEYJ4AgX7ac6idBQCEW8= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) by MN2PR18MB3117.namprd18.prod.outlook.com (2603:10b6:208:162::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Mon, 16 Mar 2020 09:34:49 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::f829:3e55:94f6:4efb]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::f829:3e55:94f6:4efb%5]) with mapi id 15.20.2814.021; Mon, 16 Mar 2020 09:34:49 +0000 From: Harman Kalra To: , , CC: , , Harman Kalra Date: Mon, 16 Mar 2020 15:03:40 +0530 Message-ID: <1584351224-23500-5-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584351224-23500-1-git-send-email-hkalra@marvell.com> References: <1584351224-23500-1-git-send-email-hkalra@marvell.com> Content-Type: text/plain X-ClientProxiedBy: BMXPR01CA0006.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::16) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hkarlara-OptiPlex-3046.marvell.com (115.113.156.2) by BMXPR01CA0006.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2814.13 via Frontend Transport; Mon, 16 Mar 2020 09:34:32 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 339cc4ea-e269-4a8b-8e5f-08d7c98d3cc2 X-MS-TrafficTypeDiagnostic: MN2PR18MB3117: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 03449D5DD1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(136003)(376002)(39860400002)(346002)(396003)(199004)(52116002)(7696005)(478600001)(4326008)(8676002)(8936002)(107886003)(26005)(66556008)(30864003)(2906002)(86362001)(5660300002)(36756003)(55236004)(16526019)(2616005)(956004)(66946007)(6486002)(66476007)(81156014)(81166006)(6666004)(186003)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3117; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tPhtMq3OzlrqRa/rZBYxvsaxk5J2adNqYE088bXmlp7QEcuojBKMw8OP1ynC6zBTyxgocm9iXJ6JEcub4baLKWT3lQh3gDx3jTiAkBwujbzoHW0+k8la49jVaalGFKgrAw1c4t7OXdkEP4R1kZEegA6slr3LVWSklroe2YrXmgElKsJbmCslXJ+s0BOynMmj1quHn7afa08TG5MRpZXo65DKgc0kJDM2vfHCK6J8GOwMUvGAcGzgnfOgC6mQc4kqlGKZgYDTP31il56Y4NJnHJaW3I1AbokOFa5ktVEa9TO57cj89Pr/r1FRJzclhN6MhG8TnNUH6SIgR/wdNptHrzMn7JhOXAkgS9/hsb1vou4b2WNFvxK5nl7vjPwokIqODRfGW18UOmURlQ1Fc1ue93myZvBI2tOzD9XVewt8spYyanIyNEtWGO8cBy7GE2/m X-MS-Exchange-AntiSpam-MessageData: umxnn4kmrC3mQ+xvwLZCCqu8z04fQhxtlO25XiLGK+PEEab2ZPH4J2543iU3ko35hqf/CIn2JATy0x+NR1Vx28C8JQvYSUM6j0Q+HhRGEU7RiY3A4KhEDbx/FeEo+ItKwPQtKQnfazKjMvWnc4/Hag== X-MS-Exchange-CrossTenant-Network-Message-Id: 339cc4ea-e269-4a8b-8e5f-08d7c98d3cc2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2020 09:34:34.4568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pJLL6X4QumkuzFhGPhio3Lp+fs+xo/r+iqGaEyxN0OLDFr7k/N9BZ1sMFK8A62uP98SqzTmY8EV9VJjDlnJaVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3117 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-16_02:2020-03-12, 2020-03-16 signatures=0 Subject: [dpdk-dev] [PATCH 4/8] net/octeontx: add MTU support 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" Adding support for mtu eth operation which configures mtu based on max pkt len. Signed-off-by: Harman Kalra --- doc/guides/nics/features/octeontx.ini | 1 + doc/guides/nics/octeontx.rst | 1 + drivers/net/octeontx/base/octeontx_bgx.c | 17 +++++ drivers/net/octeontx/base/octeontx_bgx.h | 1 + drivers/net/octeontx/base/octeontx_pkovf.c | 21 +++++++ drivers/net/octeontx/base/octeontx_pkovf.h | 8 +++ drivers/net/octeontx/octeontx_ethdev.c | 72 +++++++++++++++++++++- drivers/net/octeontx/octeontx_ethdev.h | 25 ++++++++ drivers/net/octeontx/octeontx_logs.h | 3 + 9 files changed, 146 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/features/octeontx.ini b/doc/guides/nics/features/octeontx.ini index 19caee61b..e3ee79f0f 100644 --- a/doc/guides/nics/features/octeontx.ini +++ b/doc/guides/nics/features/octeontx.ini @@ -8,6 +8,7 @@ Speed capabilities = Y Link status = Y Lock-free Tx queue = Y Queue start/stop = P +MTU update = Y Jumbo frame = Y Scattered Rx = Y Promiscuous mode = Y diff --git a/doc/guides/nics/octeontx.rst b/doc/guides/nics/octeontx.rst index 0c36e10cb..ddb626bc3 100644 --- a/doc/guides/nics/octeontx.rst +++ b/doc/guides/nics/octeontx.rst @@ -22,6 +22,7 @@ Features of the OCTEON TX Ethdev PMD are: - Jumbo frames - Scatter-Gather IO support - Link state information +- MTU update - SR-IOV VF - Multiple queues for TX - Lock-free Tx queue diff --git a/drivers/net/octeontx/base/octeontx_bgx.c b/drivers/net/octeontx/base/octeontx_bgx.c index a2d615fb2..cc2bbd104 100644 --- a/drivers/net/octeontx/base/octeontx_bgx.c +++ b/drivers/net/octeontx/base/octeontx_bgx.c @@ -226,6 +226,23 @@ octeontx_bgx_port_promisc_set(int port, int en) return res; } +int +octeontx_bgx_port_mtu_set(int port, int mtu) +{ + struct octeontx_mbox_hdr hdr; + int res; + + hdr.coproc = OCTEONTX_BGX_COPROC; + hdr.msg = MBOX_BGX_PORT_SET_MTU; + hdr.vfid = port; + + res = octeontx_mbox_send(&hdr, &mtu, sizeof(mtu), NULL, 0); + if (res < 0) + return -EACCES; + + return res; +} + int octeontx_bgx_port_mac_set(int port, uint8_t *mac_addr) { diff --git a/drivers/net/octeontx/base/octeontx_bgx.h b/drivers/net/octeontx/base/octeontx_bgx.h index 11c25db67..e385de42d 100644 --- a/drivers/net/octeontx/base/octeontx_bgx.h +++ b/drivers/net/octeontx/base/octeontx_bgx.h @@ -131,6 +131,7 @@ int octeontx_bgx_port_mac_set(int port, uint8_t *mac_addr); int octeontx_bgx_port_mac_add(int port, uint8_t *mac_addr, int index); int octeontx_bgx_port_mac_del(int port, uint32_t index); int octeontx_bgx_port_mac_entries_get(int port); +int octeontx_bgx_port_mtu_set(int port, int mtu); #endif /* __OCTEONTX_BGX_H__ */ diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c index dacbdd0b4..bf28bc799 100644 --- a/drivers/net/octeontx/base/octeontx_pkovf.c +++ b/drivers/net/octeontx/base/octeontx_pkovf.c @@ -465,6 +465,27 @@ octeontx_pko_get_vfid(void) return SIZE_MAX; } +int +octeontx_pko_send_mtu(int port, int mtu) +{ + struct octeontx_mbox_hdr hdr; + int res; + mbox_pko_mtu_cfg_t cfg; + + cfg.mtu = mtu; + + hdr.coproc = OCTEONTX_PKO_COPROC; + hdr.msg = MBOX_PKO_MTU_CONFIG; + hdr.vfid = port; + + res = octeontx_mbox_send(&hdr, &cfg, sizeof(mbox_pko_mtu_cfg_t), + NULL, 0); + if (res < 0) + return -EACCES; + + return res; +} + int octeontx_pko_init_fc(const size_t pko_vf_count) { diff --git a/drivers/net/octeontx/base/octeontx_pkovf.h b/drivers/net/octeontx/base/octeontx_pkovf.h index 4e0bb7c2e..7e1aba3e3 100644 --- a/drivers/net/octeontx/base/octeontx_pkovf.h +++ b/drivers/net/octeontx/base/octeontx_pkovf.h @@ -43,6 +43,13 @@ #define PKO_SEND_GATHER_LDTYPE(x) ((x) << 58) #define PKO_SEND_GATHER_GAUAR(x) ((x) << 24) +#define OCTEONTX_PKO_COPROC 4 +#define MBOX_PKO_MTU_CONFIG 1 + +typedef struct mbox_pko_mtu_cfg { + uint32_t mtu; +} mbox_pko_mtu_cfg_t; + typedef struct octeontx_dq_s { void *lmtline_va; void *ioreg_va; @@ -71,5 +78,6 @@ int octeontx_pko_vf_count(void); size_t octeontx_pko_get_vfid(void); int octeontx_pko_init_fc(const size_t pko_vf_count); void octeontx_pko_fc_free(void); +int octeontx_pko_send_mtu(int port, int mtu); #endif /* __OCTEONTX_PKO_H__ */ diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 97b4298fe..91b9ea645 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -139,7 +139,7 @@ octeontx_port_open(struct octeontx_nic *nic) nic->base_ochan = bgx_port_conf.base_chan; nic->num_ichans = bgx_port_conf.num_chans; nic->num_ochans = bgx_port_conf.num_chans; - nic->mtu = bgx_port_conf.mtu; + nic->bgx_mtu = bgx_port_conf.mtu; nic->bpen = bgx_port_conf.bpen; nic->fcs_strip = bgx_port_conf.fcs_strip; nic->bcast_mode = bgx_port_conf.bcast_mode; @@ -407,6 +407,55 @@ octeontx_dev_close(struct rte_eth_dev *dev) dev->rx_pkt_burst = NULL; } +static int +octeontx_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) +{ + uint32_t buffsz, frame_size = mtu + OCCTX_L2_OVERHEAD; + struct octeontx_nic *nic = octeontx_pmd_priv(eth_dev); + struct rte_eth_dev_data *data = eth_dev->data; + int rc = 0; + + /* Check if MTU is within the allowed range */ + if (frame_size < OCCTX_MIN_FRS || frame_size > OCCTX_MAX_FRS) + return -EINVAL; + + buffsz = data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM; + + /* Refuse MTU that requires the support of scattered packets + * when this feature has not been enabled before. + */ + if (data->dev_started && frame_size > buffsz && + !(nic->rx_offloads & DEV_RX_OFFLOAD_SCATTER)) { + octeontx_log_err("Scatter mode is disabled"); + return -EINVAL; + } + + /* Check * >= max_frame */ + if ((nic->rx_offloads & DEV_RX_OFFLOAD_SCATTER) && + (frame_size > buffsz * OCCTX_RX_NB_SEG_MAX)) + return -EINVAL; + + rc = octeontx_pko_send_mtu(nic->port_id, frame_size); + if (rc) + return rc; + + rc = octeontx_bgx_port_mtu_set(nic->port_id, frame_size); + if (rc) + return rc; + + if (frame_size > RTE_ETHER_MAX_LEN) + nic->rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; + else + nic->rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME; + + /* Update max_rx_pkt_len */ + data->dev_conf.rxmode.max_rx_pkt_len = frame_size; + octeontx_log_info("Received pkt beyond maxlen %d will be dropped", + frame_size); + + return rc; +} + static int octeontx_recheck_rx_offloads(struct octeontx_rxq *rxq) { @@ -435,6 +484,9 @@ octeontx_recheck_rx_offloads(struct octeontx_rxq *rxq) evdev_priv->rx_offload_flags = nic->rx_offload_flags; evdev_priv->tx_offload_flags = nic->tx_offload_flags; + /* Setup MTU based on max_rx_pkt_len */ + nic->mtu = data->dev_conf.rxmode.max_rx_pkt_len - OCCTX_L2_OVERHEAD; + return 0; } @@ -445,6 +497,7 @@ octeontx_dev_start(struct rte_eth_dev *dev) struct octeontx_rxq *rxq; int ret = 0, i; + PMD_INIT_FUNC_TRACE(); /* Rechecking if any new offload set to update * rx/tx burst function pointer accordingly. */ @@ -453,7 +506,13 @@ octeontx_dev_start(struct rte_eth_dev *dev) octeontx_recheck_rx_offloads(rxq); } - PMD_INIT_FUNC_TRACE(); + /* Setting up the mtu based on max_rx_pkt_len */ + ret = octeontx_dev_mtu_set(dev, nic->mtu); + if (ret) { + octeontx_log_err("Failed to set default MTU size %d", ret); + goto error; + } + /* * Tx start */ @@ -713,6 +772,12 @@ octeontx_dev_info(struct rte_eth_dev *dev, ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G | ETH_LINK_SPEED_40G; + /* Min/Max MTU supported */ + dev_info->min_rx_bufsize = OCCTX_MIN_FRS; + dev_info->max_rx_pktlen = OCCTX_MAX_FRS; + dev_info->max_mtu = dev_info->max_rx_pktlen - OCCTX_L2_OVERHEAD; + dev_info->min_mtu = dev_info->min_rx_bufsize - OCCTX_L2_OVERHEAD; + dev_info->max_mac_addrs = octeontx_bgx_port_mac_entries_get(nic->port_id); dev_info->max_rx_pktlen = PKI_MAX_PKTLEN; @@ -1127,6 +1192,7 @@ static const struct eth_dev_ops octeontx_dev_ops = { .rx_queue_setup = octeontx_dev_rx_queue_setup, .rx_queue_release = octeontx_dev_rx_queue_release, .dev_supported_ptypes_get = octeontx_dev_supported_ptypes_get, + .mtu_set = octeontx_dev_mtu_set, .pool_ops_supported = octeontx_pool_ops, }; @@ -1256,7 +1322,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, nic->port_id, nic->port_ena, nic->base_ochan, nic->num_ochans, nic->num_tx_queues); - PMD_INIT_LOG(DEBUG, "speed %d mtu %d", nic->speed, nic->mtu); + PMD_INIT_LOG(DEBUG, "speed %d mtu %d", nic->speed, nic->bgx_mtu); rte_octeontx_pchan_map[(nic->base_ochan >> 8) & 0x7] [(nic->base_ochan >> 4) & 0xF] = data->port_id; diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h index 1abe1703b..27f6556dd 100644 --- a/drivers/net/octeontx/octeontx_ethdev.h +++ b/drivers/net/octeontx/octeontx_ethdev.h @@ -29,6 +29,30 @@ #define OCTEONTX_MAX_BGX_PORTS 4 #define OCTEONTX_MAX_LMAC_PER_BGX 4 +#define OCCTX_RX_NB_SEG_MAX 6 + +/* VLAN tag inserted by OCCTX_TX_VTAG_ACTION. + * In Tx space is always reserved for this in FRS. + */ +#define OCCTX_MAX_VTAG_INS 2 +#define OCCTX_MAX_VTAG_ACT_SIZE (4 * OCCTX_MAX_VTAG_INS) + +/* HW config of frame size doesn't include FCS */ +#define OCCTX_MAX_HW_FRS 9212 +#define OCCTX_MIN_HW_FRS 60 + +/* ETH_HLEN+ETH_FCS+2*VLAN_HLEN */ +#define OCCTX_L2_OVERHEAD (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + \ + OCCTX_MAX_VTAG_ACT_SIZE) + +/* Since HW FRS includes NPC VTAG insertion space, user has reduced FRS */ +#define OCCTX_MAX_FRS \ + (OCCTX_MAX_HW_FRS + RTE_ETHER_CRC_LEN - OCCTX_MAX_VTAG_ACT_SIZE) + +#define OCCTX_MIN_FRS (OCCTX_MIN_HW_FRS + RTE_ETHER_CRC_LEN) + +#define OCCTX_MAX_MTU (OCCTX_MAX_FRS - OCCTX_L2_OVERHEAD) + #define OCTEONTX_RX_OFFLOADS (DEV_RX_OFFLOAD_CHECKSUM | \ DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_JUMBO_FRAME) @@ -67,6 +91,7 @@ struct octeontx_nic { uint8_t link_up; uint8_t duplex; uint8_t speed; + uint16_t bgx_mtu; uint16_t mtu; uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; /* Rx port parameters */ diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h index ccb8a1b0a..dec8042c6 100644 --- a/drivers/net/octeontx/octeontx_logs.h +++ b/drivers/net/octeontx/octeontx_logs.h @@ -19,6 +19,9 @@ rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \ "%s(): " fmt "\n", __func__, ## args) +#define octeontx_log_info(fmt, args...) \ + RTE_LOG(INFO, PMD, fmt "\n", ## args) + #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__) #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__) #define octeontx_mbox_log(s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__) -- 2.18.0