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 84BAFA0353; Mon, 11 Nov 2019 08:40:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E413A29AC; Mon, 11 Nov 2019 08:40:37 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10061.outbound.protection.outlook.com [40.107.1.61]) by dpdk.org (Postfix) with ESMTP id 717A629AC for ; Mon, 11 Nov 2019 08:40:36 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k0/zr1IGQW7bq2CGrpc7mcvJTfERWU7IhVEUsBsXlpp/RQn/aK3bnsoWfI6CvXXcnl1uZDVkDBJcEQ4vl6FZ8UnnTIf48HLVKP4B4koccxZd1qtUyOKWaCQSSq3QvkWlJrmMhNp55IZuS4sGqljpEgmpBwzuvPXX898Py5QiJOEZArJr3/A5p83FdcNnu4ypALbGNTvW7MX+AD/XRQP8yRBKf2t0Ab89nisD1/IEX0fmdB5uUqhxltkitMzDWfJUv3mIm4j5zSj1HnFr2hT8nA+sHTHfvVcBwFBJN5lI8Y+P1Za/416HnWS7LkkPOjM5GsPe2HNdDsz2oV3ickSmgw== 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=QlBgrDiOrUzxd3ZrzOPPEWLzTnxKXtLyv7ZgV0VHFEs=; b=hYAIc4lYmpe+opBNx6iQnAO6t8tV2yAH4b377ExKDaV5PDICYAGHn6UshJ4Gz5MFtr2oB2E5ghnz/dUaz5ii9wsLBkA/+maRy1HUyHTeqf2zcsBrlJXaaRlBTZiKbCY8j1P8I5/B70fYBdXQXdQSjlhslfJR4sfPpjCRrUVT/3T2DKxOUFB0KNUoPmNzqUk7MQbnJ9pR4DzlnqmG5yUJKwCPKflsVej79GgaFTZrFPh7qqt9Rp1Zag84QE3Hont0RZ5YUtDw0u3Mp7RrA/FBgw+uVSd6WkwyFUTBcEGuiO6C2faV5Zjuzv/VZiPL3pyjWgEp2eF18r4jcHBqso9VGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QlBgrDiOrUzxd3ZrzOPPEWLzTnxKXtLyv7ZgV0VHFEs=; b=DUt2qUpdBBslo8Zr3rFDvV/EKm5AqY6QaQzJrwRrQwr42zk0tl+foW5FgFb6zFOIT6AnYqkqUiy+oHtym4RU17B6gONTAaQlgZvdWO7fxfmOnWGwjlkrkIY6McNuWzAR0T9eIbouiA8YsUE7dg8hsriQK5hVG2VPPkzGUqluI/Q= Received: from AM4PR05MB3460.eurprd05.prod.outlook.com (10.171.187.153) by AM4PR05MB3140.eurprd05.prod.outlook.com (10.171.186.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.24; Mon, 11 Nov 2019 07:40:34 +0000 Received: from AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::117b:8dc0:905e:d154]) by AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::117b:8dc0:905e:d154%4]) with mapi id 15.20.2430.027; Mon, 11 Nov 2019 07:40:34 +0000 From: Dekel Peled To: "Ananyev, Konstantin" , "Mcnamara, John" , "Kovacevic, Marko" , "nhorman@tuxdriver.com" , "ajit.khaparde@broadcom.com" , "somnath.kotur@broadcom.com" , "Burakov, Anatoly" , "xuanziyang2@huawei.com" , "cloud.wangxiaoyun@huawei.com" , "zhouguoyang@huawei.com" , "Lu, Wenzhuo" , Matan Azrad , Shahaf Shuler , Slava Ovsiienko , "rmody@marvell.com" , "shshaikh@marvell.com" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "Wang, Zhihong" , "yongwang@vmware.com" , Thomas Monjalon , "Yigit, Ferruh" , "arybchenko@solarflare.com" , "Wu, Jingjing" , "Iremonger, Bernard" CC: "dev@dpdk.org" Thread-Topic: [PATCH v5 1/3] ethdev: support API to set max LRO packet size Thread-Index: AQHVllPN9znvjTpAlUOkZoppqPQy36eFCqOAgACKd7A= Date: Mon, 11 Nov 2019 07:40:34 +0000 Message-ID: References: <2601191342CEEE43887BDE71AB97725801A8C8578D@IRSMSX104.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB97725801A8C8578D@IRSMSX104.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 750c8fde-7fb3-437c-aada-08d7667a6ff4 x-ms-traffictypediagnostic: AM4PR05MB3140:|AM4PR05MB3140: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 0218A015FA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(396003)(366004)(346002)(376002)(189003)(199004)(13464003)(14454004)(7416002)(305945005)(76176011)(7736002)(966005)(74316002)(25786009)(81166006)(81156014)(2201001)(8676002)(86362001)(229853002)(7696005)(476003)(486006)(2906002)(11346002)(446003)(33656002)(8936002)(6506007)(316002)(110136005)(9686003)(53546011)(26005)(99286004)(66946007)(64756008)(66556008)(66476007)(66446008)(55016002)(4326008)(71190400001)(71200400001)(66066001)(6436002)(2501003)(45080400002)(6116002)(3846002)(478600001)(14444005)(186003)(52536014)(256004)(5660300002)(6246003)(76116006)(6306002)(102836004)(30864003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3140; H:AM4PR05MB3460.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ztd7ag1yk1/6FqNCxVARudHRx7jYoVThhFFA+MRW7L1ctUYyUGtaRMoWksLsgZ3613vjXNIFYbsRHajNJVjtnLJJnFGBXUgzWOO2ZbThboV60Niyu+AIlZBa4jYOX3Hnix9T9JoCxQHDfbWOBN+Sllfmi5wYJe6hFYmQ+wZfrUXAb6weX24xar7tOpVs/KYm+E1o2c+ueGvOv9mFqgK0OFnOdiz1ikEc+VQivIPyFG6NQwxMTzbVI9nIczViIsqCohSGyw8UGpNX/a6r4VgTFbrVnbZ5aHPJ/+LW5OGRcKHALB2FafMSbLEAhfhn9HwYOAhKqHD0djC7h3VQc7SpzJr1t+/tv7dz3Wf+U6Ebz5RXEpmB5/e1/uAFmwVDvCSW9TQcCVBOkQ3IcJoSd27u21BgePF+1QaBJrUNWGyQdwsXUbZuZ/Qk+TS4uatpnprR Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 750c8fde-7fb3-437c-aada-08d7667a6ff4 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2019 07:40:34.4734 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Cll89rYvJ8s4ExaXESdVBq5bYiHRBbb//CbToGFVLeiT/7Un/en8bfL+UAVviCkcYVI1G4WJsVQROA/PqtH5XQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3140 Subject: Re: [dpdk-dev] [PATCH v5 1/3] ethdev: support API to set max LRO packet size 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" Thnaks, PSB. > -----Original Message----- > From: Ananyev, Konstantin > Sent: Monday, November 11, 2019 1:08 AM > To: Dekel Peled ; Mcnamara, John > ; Kovacevic, Marko > ; nhorman@tuxdriver.com; > ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Burakov, > Anatoly ; xuanziyang2@huawei.com; > cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; Lu, Wenzhuo > ; Matan Azrad ; Shahaf > Shuler ; Slava Ovsiienko > ; rmody@marvell.com; > shshaikh@marvell.com; maxime.coquelin@redhat.com; Bie, Tiwei > ; Wang, Zhihong ; > yongwang@vmware.com; Thomas Monjalon ; Yigit, > Ferruh ; arybchenko@solarflare.com; Wu, Jingjing > ; Iremonger, Bernard > > Cc: dev@dpdk.org > Subject: RE: [PATCH v5 1/3] ethdev: support API to set max LRO packet siz= e >=20 >=20 >=20 > > This patch implements [1], to support API for configuration and > > validation of max size for LRO aggregated packet. > > API change notice [2] is removed, and release notes for 19.11 are > > updated accordingly. > > > > Various PMDs using LRO offload are updated, the new data members are > > initialized to ensure they don't fail validation. > > > > [1] > > > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > > > es.dpdk.org%2Fpatch%2F58217%2F&data=3D02%7C01%7Cdekelp%40mell > anox.co > > > m%7Cc12f78c6bd3d48bc223008d76632cd0f%7Ca652971c7d2e4d9ba6a4d1492 > 56f461 > > > b%7C0%7C0%7C637090240692948792&sdata=3DpU6LJBYDmlzPFzHc%2FQlF > UVXpGuv > > ulTcl%2F29GsXdvBF8%3D&reserved=3D0 > > [2] > > > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > > > es.dpdk.org%2Fpatch%2F57492%2F&data=3D02%7C01%7Cdekelp%40mell > anox.co > > > m%7Cc12f78c6bd3d48bc223008d76632cd0f%7Ca652971c7d2e4d9ba6a4d1492 > 56f461 > > > b%7C0%7C0%7C637090240692958790&sdata=3DVegV5HcYhkabDgcOF29u > %2FFLq25I > > %2BEDZTaEn20A2t2Wo%3D&reserved=3D0 >=20 > Actually if the requirement is just to allow user to limit max lro size, = then why > not to add just new function for that: >=20 > int rte_eth_dev_set_max_lro(uint16_t port_id, uint32_t lro); ? >=20 > And make it optional for the drivers to support it. > That way PMD/devices that allow LRO max size to be configurable, can > support it others can fail. Current implementation is consistent with the existing max_rx_pkt_len use, = in case LRO is used. When using jumbo frames the packet len must be specified. Using LRO the max session size should be specified. >=20 > Konstantin >=20 > > > > Signed-off-by: Dekel Peled > > Reviewed-by: Andrew Rybchenko > > Acked-by: Thomas Monjalon > > Acked-by: Matan Azrad > > --- > > doc/guides/nics/features.rst | 2 ++ > > doc/guides/rel_notes/deprecation.rst | 4 ---- > > doc/guides/rel_notes/release_19_11.rst | 8 +++++++ > > drivers/net/bnxt/bnxt_ethdev.c | 1 + > > drivers/net/hinic/hinic_pmd_ethdev.c | 1 + > > drivers/net/ixgbe/ixgbe_ethdev.c | 1 + > > drivers/net/mlx5/mlx5.h | 3 +++ > > drivers/net/mlx5/mlx5_ethdev.c | 1 + > > drivers/net/mlx5/mlx5_rxq.c | 1 - > > drivers/net/qede/qede_ethdev.c | 1 + > > drivers/net/virtio/virtio_ethdev.c | 1 + > > drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 + > > lib/librte_ethdev/rte_ethdev.c | 44 > ++++++++++++++++++++++++++++++++++ > > lib/librte_ethdev/rte_ethdev.h | 4 ++++ > > 14 files changed, 68 insertions(+), 5 deletions(-) > > > > diff --git a/doc/guides/nics/features.rst > > b/doc/guides/nics/features.rst index 7a31cf7..2138ce3 100644 > > --- a/doc/guides/nics/features.rst > > +++ b/doc/guides/nics/features.rst > > @@ -193,10 +193,12 @@ LRO > > Supports Large Receive Offload. > > > > * **[uses] rte_eth_rxconf,rte_eth_rxmode**: > ``offloads:DEV_RX_OFFLOAD_TCP_LRO``. > > + ``dev_conf.rxmode.max_lro_pkt_size``. > > * **[implements] datapath**: ``LRO functionality``. > > * **[implements] rte_eth_dev_data**: ``lro``. > > * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_LRO``, > ``mbuf.tso_segsz``. > > * **[provides] rte_eth_dev_info**: > ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_TCP_LRO``. > > +* **[provides] rte_eth_dev_info**: ``max_lro_pkt_size``. > > > > > > .. _nic_features_tso: > > diff --git a/doc/guides/rel_notes/deprecation.rst > > b/doc/guides/rel_notes/deprecation.rst > > index c10dc30..fdec33d 100644 > > --- a/doc/guides/rel_notes/deprecation.rst > > +++ b/doc/guides/rel_notes/deprecation.rst > > @@ -87,10 +87,6 @@ Deprecation Notices > > This scheme will allow PMDs to avoid lookup to internal ptype table = on Rx > and > > thereby improve Rx performance if application wishes do so. > > > > -* ethdev: New 32-bit fields may be added for maximum LRO session > > size, in > > - struct ``rte_eth_dev_info`` for the port capability and in struct > > - ``rte_eth_rxmode`` for the port configuration. > > - > > * cryptodev: support for using IV with all sizes is added, J0 still ca= n > > be used but only when IV length in following structs > ``rte_crypto_auth_xform``, > > ``rte_crypto_aead_xform`` is set to zero. When IV length is greater > > or equal diff --git a/doc/guides/rel_notes/release_19_11.rst > > b/doc/guides/rel_notes/release_19_11.rst > > index 87b7bd0..a3fc023 100644 > > --- a/doc/guides/rel_notes/release_19_11.rst > > +++ b/doc/guides/rel_notes/release_19_11.rst > > @@ -418,6 +418,14 @@ ABI Changes > > align the Ethernet header on receive and all known encapsulations > > preserve the alignment of the header. > > > > +* ethdev: Added 32-bit fields for maximum LRO aggregated packet size, > > +in > > + struct ``rte_eth_dev_info`` for the port capability and in struct > > + ``rte_eth_rxmode`` for the port configuration. > > + Application should use the new field in struct ``rte_eth_rxmode`` > > +to configure > > + the requested size. >=20 > That part I am not happy with: * application should use*. > Many apps I suppose are ok with default LRO size selected by PMD/HW. > Why to force changes in all of them? Again this is to keep consistent with max_rx_pkt_len use. >=20 > > + PMD should use the new field in struct ``rte_eth_dev_info`` to > > + report the supported port capability. > > + > > > > Shared Library Versions > > ----------------------- > > diff --git a/drivers/net/bnxt/bnxt_ethdev.c > > b/drivers/net/bnxt/bnxt_ethdev.c index b9b055e..741b897 100644 > > --- a/drivers/net/bnxt/bnxt_ethdev.c > > +++ b/drivers/net/bnxt/bnxt_ethdev.c > > @@ -519,6 +519,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev > *eth_dev, > > /* Fast path specifics */ > > dev_info->min_rx_bufsize =3D 1; > > dev_info->max_rx_pktlen =3D BNXT_MAX_PKT_LEN; > > + dev_info->max_lro_pkt_size =3D BNXT_MAX_PKT_LEN; > > > > dev_info->rx_offload_capa =3D BNXT_DEV_RX_OFFLOAD_SUPPORT; > > if (bp->flags & BNXT_FLAG_PTP_SUPPORTED) diff --git > > a/drivers/net/hinic/hinic_pmd_ethdev.c > > b/drivers/net/hinic/hinic_pmd_ethdev.c > > index 9f37a40..b33b2cf 100644 > > --- a/drivers/net/hinic/hinic_pmd_ethdev.c > > +++ b/drivers/net/hinic/hinic_pmd_ethdev.c > > @@ -727,6 +727,7 @@ static void hinic_get_speed_capa(struct > rte_eth_dev *dev, uint32_t *speed_capa) > > info->max_tx_queues =3D nic_dev->nic_cap.max_sqs; > > info->min_rx_bufsize =3D HINIC_MIN_RX_BUF_SIZE; > > info->max_rx_pktlen =3D HINIC_MAX_JUMBO_FRAME_SIZE; > > + info->max_lro_pkt_size =3D HINIC_MAX_JUMBO_FRAME_SIZE; > > info->max_mac_addrs =3D HINIC_MAX_UC_MAC_ADDRS; > > info->min_mtu =3D HINIC_MIN_MTU_SIZE; > > info->max_mtu =3D HINIC_MAX_MTU_SIZE; > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > > b/drivers/net/ixgbe/ixgbe_ethdev.c > > index 30c0379..5719552 100644 > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > > @@ -3814,6 +3814,7 @@ static int > ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, > > } > > dev_info->min_rx_bufsize =3D 1024; /* cf BSIZEPACKET in SRRCTL > register */ > > dev_info->max_rx_pktlen =3D 15872; /* includes CRC, cf MAXFRS > register > > */ > > + dev_info->max_lro_pkt_size =3D RTE_IPV4_MAX_PKT_LEN; > > dev_info->max_mac_addrs =3D hw->mac.num_rar_entries; > > dev_info->max_hash_mac_addrs =3D IXGBE_VMDQ_NUM_UC_MAC; > > dev_info->max_vfs =3D pci_dev->max_vfs; diff --git > > a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > > fab58c9..4783b5c 100644 > > --- a/drivers/net/mlx5/mlx5.h > > +++ b/drivers/net/mlx5/mlx5.h > > @@ -206,6 +206,9 @@ struct mlx5_hca_attr { #define > > MLX5_LRO_SUPPORTED(dev) \ > > (((struct mlx5_priv > > *)((dev)->data->dev_private))->config.lro.supported) > > > > +/* Maximal size of aggregated LRO packet. */ #define > > +MLX5_MAX_LRO_SIZE (UINT8_MAX * 256u) > > + > > /* LRO configurations structure. */ > > struct mlx5_lro_config { > > uint32_t supported:1; /* Whether LRO is supported. */ diff --git > > a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c > > index 2b7c867..3adc824 100644 > > --- a/drivers/net/mlx5/mlx5_ethdev.c > > +++ b/drivers/net/mlx5/mlx5_ethdev.c > > @@ -606,6 +606,7 @@ struct ethtool_link_settings { > > /* FIXME: we should ask the device for these values. */ > > info->min_rx_bufsize =3D 32; > > info->max_rx_pktlen =3D 65536; > > + info->max_lro_pkt_size =3D MLX5_MAX_LRO_SIZE; > > /* > > * Since we need one CQ per QP, the limit is the minimum number > > * between the two values. > > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > > index 24d0eaa..9423e7b 100644 > > --- a/drivers/net/mlx5/mlx5_rxq.c > > +++ b/drivers/net/mlx5/mlx5_rxq.c > > @@ -1701,7 +1701,6 @@ struct mlx5_rxq_obj * > > return 0; > > } > > > > -#define MLX5_MAX_LRO_SIZE (UINT8_MAX * 256u) #define > > MLX5_MAX_TCP_HDR_OFFSET ((unsigned int)(sizeof(struct > rte_ether_hdr) + \ > > sizeof(struct rte_vlan_hdr) * 2 + \ > > sizeof(struct rte_ipv6_hdr))) > > diff --git a/drivers/net/qede/qede_ethdev.c > > b/drivers/net/qede/qede_ethdev.c index 575982f..ccbb8a4 100644 > > --- a/drivers/net/qede/qede_ethdev.c > > +++ b/drivers/net/qede/qede_ethdev.c > > @@ -1277,6 +1277,7 @@ static int qede_dev_configure(struct rte_eth_dev > > *eth_dev) > > > > dev_info->min_rx_bufsize =3D (uint32_t)QEDE_MIN_RX_BUFF_SIZE; > > dev_info->max_rx_pktlen =3D > (uint32_t)ETH_TX_MAX_NON_LSO_PKT_LEN; > > + dev_info->max_lro_pkt_size =3D (uint32_t)0x7FFF; > > dev_info->rx_desc_lim =3D qede_rx_desc_lim; > > dev_info->tx_desc_lim =3D qede_tx_desc_lim; > > > > diff --git a/drivers/net/virtio/virtio_ethdev.c > > b/drivers/net/virtio/virtio_ethdev.c > > index 044eb10..22ce5a2 100644 > > --- a/drivers/net/virtio/virtio_ethdev.c > > +++ b/drivers/net/virtio/virtio_ethdev.c > > @@ -2435,6 +2435,7 @@ static void virtio_dev_free_mbufs(struct > rte_eth_dev *dev) > > RTE_MIN(hw->max_queue_pairs, > VIRTIO_MAX_TX_QUEUES); > > dev_info->min_rx_bufsize =3D VIRTIO_MIN_RX_BUFSIZE; > > dev_info->max_rx_pktlen =3D VIRTIO_MAX_RX_PKTLEN; > > + dev_info->max_lro_pkt_size =3D VIRTIO_MAX_RX_PKTLEN; > > dev_info->max_mac_addrs =3D VIRTIO_MAX_MAC_ADDRS; > > > > host_features =3D VTPCI_OPS(hw)->get_features(hw); diff --git > > a/drivers/net/vmxnet3/vmxnet3_ethdev.c > > b/drivers/net/vmxnet3/vmxnet3_ethdev.c > > index d1faeaa..d18e8bc 100644 > > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c > > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c > > @@ -1161,6 +1161,7 @@ static int eth_vmxnet3_pci_remove(struct > rte_pci_device *pci_dev) > > dev_info->max_tx_queues =3D VMXNET3_MAX_TX_QUEUES; > > dev_info->min_rx_bufsize =3D 1518 + RTE_PKTMBUF_HEADROOM; > > dev_info->max_rx_pktlen =3D 16384; /* includes CRC, cf MAXFRS > register > > */ > > + dev_info->max_lro_pkt_size =3D 16384; > > dev_info->speed_capa =3D ETH_LINK_SPEED_10G; > > dev_info->max_mac_addrs =3D VMXNET3_MAX_MAC_ADDRS; > > > > diff --git a/lib/librte_ethdev/rte_ethdev.c > > b/lib/librte_ethdev/rte_ethdev.c index 652c369..c642ba5 100644 > > --- a/lib/librte_ethdev/rte_ethdev.c > > +++ b/lib/librte_ethdev/rte_ethdev.c > > @@ -1136,6 +1136,26 @@ struct rte_eth_dev * > > return name; > > } > > > > +static inline int > > +check_lro_pkt_size(uint16_t port_id, uint32_t config_size, > > + uint32_t dev_info_size) > > +{ > > + int ret =3D 0; > > + > > + if (config_size > dev_info_size) { > > + RTE_ETHDEV_LOG(ERR, "Ethdev port_id=3D%d > max_lro_pkt_size %u " > > + "> max allowed value %u\n", port_id, config_size, > > + dev_info_size); > > + ret =3D -EINVAL; > > + } else if (config_size < RTE_ETHER_MIN_LEN) { > > + RTE_ETHDEV_LOG(ERR, "Ethdev port_id=3D%d > max_lro_pkt_size %u " > > + "< min allowed value %u\n", port_id, config_size, > > + (unsigned int)RTE_ETHER_MIN_LEN); > > + ret =3D -EINVAL; > > + } > > + return ret; > > +} > > + > > int > > rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t > nb_tx_q, > > const struct rte_eth_conf *dev_conf) @@ -1266,6 > +1286,18 @@ > > struct rte_eth_dev * > > > RTE_ETHER_MAX_LEN; > > } > > > > + /* > > + * If LRO is enabled, check that the maximum aggregated packet > > + * size is supported by the configured device. > > + */ > > + if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_TCP_LRO) { > > + ret =3D check_lro_pkt_size( > > + port_id, dev_conf- > >rxmode.max_lro_pkt_size, > > + dev_info.max_lro_pkt_size); > > + if (ret !=3D 0) > > + goto rollback; > > + } > > + > > /* Any requested offloading must be within its device capabilities */ > > if ((dev_conf->rxmode.offloads & dev_info.rx_offload_capa) !=3D > > dev_conf->rxmode.offloads) { > > @@ -1770,6 +1802,18 @@ struct rte_eth_dev * > > return -EINVAL; > > } > > > > + /* > > + * If LRO is enabled, check that the maximum aggregated packet > > + * size is supported by the configured device. > > + */ > > + if (local_conf.offloads & DEV_RX_OFFLOAD_TCP_LRO) { > > + int ret =3D check_lro_pkt_size(port_id, > > + dev->data- > >dev_conf.rxmode.max_lro_pkt_size, > > + dev_info.max_lro_pkt_size); > > + if (ret !=3D 0) > > + return ret; > > + } > > + > > ret =3D (*dev->dev_ops->rx_queue_setup)(dev, rx_queue_id, > nb_rx_desc, > > socket_id, &local_conf, mp); > > if (!ret) { > > diff --git a/lib/librte_ethdev/rte_ethdev.h > > b/lib/librte_ethdev/rte_ethdev.h index 44d77b3..1b76df5 100644 > > --- a/lib/librte_ethdev/rte_ethdev.h > > +++ b/lib/librte_ethdev/rte_ethdev.h > > @@ -395,6 +395,8 @@ struct rte_eth_rxmode { > > /** The multi-queue packet distribution mode to be used, e.g. RSS. > */ > > enum rte_eth_rx_mq_mode mq_mode; > > uint32_t max_rx_pkt_len; /**< Only used if JUMBO_FRAME > enabled. */ > > + /** Maximum allowed size of LRO aggregated packet. */ > > + uint32_t max_lro_pkt_size; > > uint16_t split_hdr_size; /**< hdr buf size (header_split enabled).*/ > > /** > > * Per-port Rx offloads to be set using DEV_RX_OFFLOAD_* flags. > > @@ -1218,6 +1220,8 @@ struct rte_eth_dev_info { > > const uint32_t *dev_flags; /**< Device flags */ > > uint32_t min_rx_bufsize; /**< Minimum size of RX buffer. */ > > uint32_t max_rx_pktlen; /**< Maximum configurable length of RX > pkt. > > */ > > + /** Maximum configurable size of LRO aggregated packet. */ > > + uint32_t max_lro_pkt_size; > > uint16_t max_rx_queues; /**< Maximum number of RX queues. */ > > uint16_t max_tx_queues; /**< Maximum number of TX queues. */ > > uint32_t max_mac_addrs; /**< Maximum number of MAC > addresses. */ > > -- > > 1.8.3.1