From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 717D93256 for ; Mon, 25 Feb 2019 12:29:34 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1PBPrnx013162; Mon, 25 Feb 2019 03:29:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=HXy8fsx7U+uAP9vrT6u5GpN8P/e4G7csUcd0MDk9k8Q=; b=RcivIFoQK45X7UBZNp/S+XEVhQirh0+tRjEec8pOxBzSDv7MYLW2pnVxKzVlETD604Wn BJuZ4NRX9ZyyDE5I0Zp90NiWk/Cxa/ALtBk/tz2JZ9pLowK9NZRiRXVMLIaxIaSMIB0O GP1x9CaUEPLdEZYYGA5jRS04fbEL89u3zufngA+5Nfz//2+XAUPWbEK+GJXGU0Yr6M9A N0wIeQ0KKggf0XjcxNAZMqVQ23lQ3ILBHGHTbFotgMvNCsvQGqX7QKGQZlBpcDs1Tk7Y suO4w9dG+vQOqxq5mAORJVlMLcN66bziy8ZPTIvzPYTjd8CI/eC8D+D1jY+BsYPxuObu /A== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2qu4dsvakk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 25 Feb 2019 03:29:33 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 25 Feb 2019 03:29:32 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.56) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 25 Feb 2019 03:29:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HXy8fsx7U+uAP9vrT6u5GpN8P/e4G7csUcd0MDk9k8Q=; b=EsM5QHsH4PPIshHaeDMZxKMfdFkgBDbNbwfdrGWemH5Mn8sMt5kNGQlPtY6uDr7shZijHnHjuSUccwikwC3UDMnyP3EEPuDfdILpruN/+ZPr5bQsVdYl95TG1HgXXzdgOnP9Yjv4cjEXq/t60/jIO+mjIeyULt29qHFVzjVowjY= Received: from MN2PR18MB2398.namprd18.prod.outlook.com (20.179.81.144) by MN2PR18MB2895.namprd18.prod.outlook.com (20.179.20.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.21; Mon, 25 Feb 2019 11:29:31 +0000 Received: from MN2PR18MB2398.namprd18.prod.outlook.com ([fe80::2117:f855:a2e6:593f]) by MN2PR18MB2398.namprd18.prod.outlook.com ([fe80::2117:f855:a2e6:593f%2]) with mapi id 15.20.1643.019; Mon, 25 Feb 2019 11:29:31 +0000 From: Liron Himi To: "ferruh.yigit@intel.com" CC: "dev@dpdk.org" , Liron Himi , Liron Himi Thread-Topic: [PATCH v2] net/kni: calc mbuf&mtu according to given mb_pool Thread-Index: AQHUy6IkUAVc88H6X0qnw4iFG1FGeKXwY2Dw Date: Mon, 25 Feb 2019 11:29:30 +0000 Message-ID: References: <1550738855-11107-1-git-send-email-lironh@marvell.com> <1550952885-2395-1-git-send-email-lironh@marvell.com> In-Reply-To: <1550952885-2395-1-git-send-email-lironh@marvell.com> Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [217.132.239.188] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 938c486a-d6d0-49b6-626f-08d69b148282 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:MN2PR18MB2895; x-ms-traffictypediagnostic: MN2PR18MB2895: x-microsoft-exchange-diagnostics: 1; MN2PR18MB2895; 20:dFJMkDIP4QCjfonBw04BCtOaN8v2NEPOoole/+o+DlAUMzHWxhuWqVLRA3kXnNZeekFYWCeblx6SdzFogf23c8+NBTeDkJMz/gDcZ7tLMS4sDjHpWePHcfOt7Fsz0brRf2zax28EaojZ6hCcA9IaMIQ8C/qlVMCrsraxRyqR6Ss= x-microsoft-antispam-prvs: x-forefront-prvs: 095972DF2F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39850400004)(376002)(366004)(136003)(13464003)(189003)(199004)(68736007)(14444005)(2351001)(9686003)(14454004)(7696005)(486006)(2906002)(26005)(105586002)(6916009)(8936002)(305945005)(4326008)(54906003)(186003)(7736002)(53936002)(52536013)(25786009)(256004)(99286004)(97736004)(81156014)(476003)(71190400001)(33656002)(71200400001)(5660300002)(81166006)(74316002)(106356001)(55016002)(3846002)(316002)(446003)(2501003)(11346002)(6116002)(6436002)(6246003)(86362001)(6506007)(53546011)(8676002)(478600001)(107886003)(66066001)(76176011)(229853002)(5640700003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2895; H:MN2PR18MB2398.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: rTQtSLNffgvHazT8pocRkjVgMcquVRyDE5o0QfQxneyv/TxSOyKC7gQn+VrRrHQfhBLOYeWcTtmpSDlRha4e/5tPYSEjfv5C6ptoMqkcNY4VJcRFeoGdobGSflvkTp3xq+CueZFO2ZnGHnkYQKQsQ0kEYTgtg6oNx6X8YDLwLIYMdg81hDtT3BegFs9FpNbwcKQcLfsI+XRD+WM0MYCz4/+E9uXdZ1LtFgq5o8wOqTaRAEhssnCjKOkBmVj6QiL83P6zlMmAsXoPjh9g/c3aCrx29ZfuhTdf1wL8SYBStP9dC0wQXAjZHfp0iVPGMszbP6v/3syEEnc7lGoYLCCvpAchIHrCLZABtGE3IvTmaDAZhOO9EYzBrvRq4E2lq3hGMFoUFgB85r7EtY313ZsdYNGNIsOKKIpYX/8Q3TGrAqQ= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 938c486a-d6d0-49b6-626f-08d69b148282 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Feb 2019 11:29:30.9206 (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-Transport-CrossTenantHeadersStamped: MN2PR18MB2895 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-25_06:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902250085 Subject: Re: [dpdk-dev] [PATCH v2] net/kni: calc mbuf&mtu according to given mb_pool 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: Mon, 25 Feb 2019 11:29:34 -0000 Hi, Kind reminder Regards, Liron -----Original Message----- From: lironh@marvell.com =20 Sent: Saturday, February 23, 2019 22:15 To: ferruh.yigit@intel.com Cc: dev@dpdk.org; Liron Himi Subject: [PATCH v2] net/kni: calc mbuf&mtu according to given mb_pool From: Liron Himi - mbuf_size and mtu are now being calculated according to the given mb-pool= . - max_mtu is now being set according to the given mtu the above two changes provide the ability to work with jumbo frames Signed-off-by: Liron Himi --- drivers/net/kni/rte_eth_kni.c | 10 +++++++--- kernel/linux/kni/compat.h | 4 ++++ kernel/linux/kni/kni_misc.c | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c = index a1e9970..5e02224 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -16,9 +16,11 @@ /* Only single queue supported */ #define KNI_MAX_QUEUE_PER_PORT 1 =20 -#define MAX_PACKET_SZ 2048 #define MAX_KNI_PORTS 8 =20 +#define KNI_ETHER_MTU(mbuf_size) \ + ((mbuf_size) - ETHER_HDR_LEN) /**< Ethernet MTU. */ + #define ETH_KNI_NO_REQUEST_THREAD_ARG "no_request_thread" static const char * const valid_arguments[] =3D { ETH_KNI_NO_REQUEST_THREAD_ARG, @@ -123,11 +125,13 @@ eth_kni_start(struct rte_eth_dev *dev) struct rte_kni_conf conf; const char *name =3D dev->device->name + 4; /* remove net_ */ =20 + mb_pool =3D internals->rx_queues[0].mb_pool; snprintf(conf.name, RTE_KNI_NAMESIZE, "%s", name); conf.force_bind =3D 0; conf.group_id =3D port_id; - conf.mbuf_size =3D MAX_PACKET_SZ; - mb_pool =3D internals->rx_queues[0].mb_pool; + conf.mbuf_size =3D + rte_pktmbuf_data_room_size(mb_pool) - RTE_PKTMBUF_HEADROOM; + conf.mtu =3D KNI_ETHER_MTU(conf.mbuf_size); =20 internals->kni =3D rte_kni_alloc(mb_pool, &conf, NULL); if (internals->kni =3D=3D NULL) { diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 3c= 575c7..b9f9a6f 100644 --- a/kernel/linux/kni/compat.h +++ b/kernel/linux/kni/compat.h @@ -117,3 +117,7 @@ #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 11, 0) #define HAVE_SIGNAL_= FUNCTIONS_OWN_HEADER #endif + +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 10, 0) #define=20 +HAVE_MAX_MTU_PARAM #endif diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c inde= x 522ae23..04c78eb 100644 --- a/kernel/linux/kni/kni_misc.c +++ b/kernel/linux/kni/kni_misc.c @@ -459,6 +459,9 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num, =20 if (dev_info.mtu) net_dev->mtu =3D dev_info.mtu; +#ifdef HAVE_MAX_MTU_PARAM + net_dev->max_mtu =3D net_dev->mtu; +#endif =20 ret =3D register_netdev(net_dev); if (ret) { -- 2.7.4