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 27B62201 for ; Sun, 10 Mar 2019 15:27:15 +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 x2AEKarl017838; Sun, 10 Mar 2019 07:27:14 -0700 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=oFyPU+TYIri8P5NWq0MiW8YBzSJGbtjqVP+k4awZE0Y=; b=tYOPP00/ocGuRGAT0tjitSW41yksNbY/pRFgLLo+VG/wdL8rmyIqQy9v8oItQESS+xyW qJn+4kYZ+3F6FpqdSidHxvvRmEisA8koGbcHKvdq1dSNYDuO8JhvGlNLiMX5wAfxq5OP p8ZnRVyfTOf/xWhFgqEpHH86zK/2TWybeswx8K8FYqbHIWn6cmydMhR6XwNBD98xYkWF 0FT06zM9kgVyEKQhJXzPfCB/I8syadXQYMmaucYqSZ0GdviJTrI98jUUL/pkXRme4CjZ XM9Xc6xHiNB8SycMWb7zvj95t7Kfs8NtXxtcb399IOqFQd3+fcWitk8UZnjBk3ccml1h jA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2r4bqq3dm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 10 Mar 2019 07:27:14 -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.1367.3; Sun, 10 Mar 2019 07:27:13 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.57) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sun, 10 Mar 2019 07:27:13 -0700 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=oFyPU+TYIri8P5NWq0MiW8YBzSJGbtjqVP+k4awZE0Y=; b=Cm3NWOiYJPbzpau/8xCkRcE9D52Fw5YJ5nzsJhLslqfxLjwqZK3fWchJhv176h9VWYEHKWLc+ZP9Jc/wyuCIiRaGANNtUiaEBh+92Ut9IvKjDrZYnjHAagicu1aD3KF5pEwIli14WhUct8haxGkHH+bzqphYpJSuD7DM7k28sC0= Received: from MN2PR18MB2398.namprd18.prod.outlook.com (20.179.81.144) by MN2PR18MB2784.namprd18.prod.outlook.com (20.179.23.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.21; Sun, 10 Mar 2019 14:27:12 +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.1686.021; Sun, 10 Mar 2019 14:27:11 +0000 From: Liron Himi To: "ferruh.yigit@intel.com" CC: "dev@dpdk.org" , Alan Winkowski , "Liron Himi" Thread-Topic: [PATCH v2] net/kni: calc mbuf&mtu according to given mb_pool Thread-Index: AQHUy6IkUAVc88H6X0qnw4iFG1FGeKXwY2DwgBSf3nA= Date: Sun, 10 Mar 2019 14:27:11 +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: Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [212.199.69.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c00c668c-b3a1-4d4e-8fae-08d6a5647c42 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:MN2PR18MB2784; x-ms-traffictypediagnostic: MN2PR18MB2784: x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; MN2PR18MB2784; 23:MO+gh35WBoowmW+cEsTdesflgUcnHE+mp5OE2cIM9?= =?us-ascii?Q?3xaEzejZmf19a7ZqLb53imKTvE4jw68qlHqJaiHJ+9JXMND+QiBgICzALJ3n?= =?us-ascii?Q?0gflARhdPSvEoQau6YpHAR8tc8JOQTHGpJCFugMfbXRlDTYzYZJoyiesl/y4?= =?us-ascii?Q?JHCn4un6t5pyUbocaiqvd5ZZ83Z+XOGh6jQQACOocQ+690Doq8nCERbcKzEZ?= =?us-ascii?Q?oXSdCrFTko1E7xAflDrd6ykZ0QlG00oknpZYdcdi6Mzh/0cKC4rrQD7Qzrwx?= =?us-ascii?Q?B8BuoXPwrA75SlWNEC9OmWtdtNf4qBPfH3G65i8SkrchhBkAwsKx8zkKsOTv?= =?us-ascii?Q?u0bRj3cO+vPzBu5fXiW+TXYkcPPjiAUt16DuWdPkkxDjmVjPxiEA2ErzjanQ?= =?us-ascii?Q?/ptS4+dGc70JmppwMm6To9zxcvaqS/0xk1DGMbO+kUO8sbHsiNdkIn1CM6eH?= =?us-ascii?Q?Ewg0TOmCZtnJcg4Ol2pXQUEY0daxq1ANdM9gP5LBlbOKFxjZaqPXT3MPPgJE?= =?us-ascii?Q?fyQ+qpZ3Z6dpIl5wEgt1PHXi32b8XmA8RpQoUFCRjUOJEQksWEvTjEpNLw0k?= =?us-ascii?Q?T2uvCeOI+DPgn6qxzOR2yZ4D3n7lc9OZDxf2fTG0zPoOKU8bwCpVVQmX6LI5?= =?us-ascii?Q?P+iZKndsk9NwecAu5xYY3g98wFF3alLTWgB1aUD8jt6NVg2p1E2DP4Dw4wQc?= =?us-ascii?Q?6wO2E87qzefNbHD2LTRGbc2sEZ+F+rT94JHH+s6g0Lpw4GtGU55kNNnvczmc?= =?us-ascii?Q?hT1pM8bp2J2XnovqHZvCS7Zr/Szw1rhcORtrptJhErQUVL5xDv3qWGIPunzY?= =?us-ascii?Q?/AIl9SK7rZXYMXKxiQxbh8WBHPp8g5KQWLneT+s0GkpRrG+EgM1FAjyYOdJV?= =?us-ascii?Q?ddx9bKG4phOi4SL1NVKWiuGYtbGAXTkgGt4DMlYgEtUeer2thoWqXftIFOUu?= =?us-ascii?Q?792DCF3ZVCxM3Y6IXkuGHDHXDJ8RBwvE7WU9WPK+oVJOL0C7F9yNZFsQHXVm?= =?us-ascii?Q?5k3N5G2NOEUIdGimGomBQ8ml2yVnMy4r7jqRZvmbNBoqN+g0SAWVP7qXoWIz?= =?us-ascii?Q?FdyL6HqO8QbnQASYGLz8C3sg+eXQWRmQsgVCeUPR5haUcboZUnwA6XIPaX6G?= =?us-ascii?Q?rRsBUalBVz0WvG/mCU6b+LIBvfRHucMgceUsASTK6ni3E5o6olm8QcruBw/N?= =?us-ascii?Q?p4t+E+AzA8PRCN9ZKsw90TnEaoaOYyjwtZNIxylXpsOpF1gWSLsSJfRSnQ0Q?= =?us-ascii?Q?4eZ3dI678aMs2nX67ZHREDSE2zE55iKTHKFTtrKTkyPmF58i19fMkcfv6zDY?= =?us-ascii?Q?1Q+TNk+7LNPmGDUMCEdSiJmTo8IH8LroJblaQvKWb0CBwZOib8j3RzmRmerD?= =?us-ascii?Q?C/RaQ=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0972DEC1D9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(346002)(396003)(39850400004)(376002)(189003)(199004)(13464003)(68736007)(7736002)(6916009)(2351001)(14454004)(486006)(478600001)(476003)(105586002)(6506007)(54906003)(53546011)(102836004)(71200400001)(71190400001)(76176011)(52536013)(107886003)(5660300002)(186003)(316002)(14444005)(256004)(26005)(99286004)(6246003)(86362001)(7696005)(4326008)(5640700003)(55016002)(33656002)(9686003)(53936002)(25786009)(6116002)(3846002)(81156014)(8676002)(81166006)(8936002)(2906002)(446003)(106356001)(11346002)(74316002)(97736004)(305945005)(229853002)(6436002)(66066001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2784; 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: hUEXUEBpkvmWfrr3FJr7RRDXNUWYbdLNoK4UvZDm4tgCha6PBBZoaICFCMlHykZxBR6l2/FWxNUYn9KQWefYrQkDcOQ0Q41kWGEiYjdpmTa1CaxWCJYxb07s/o/dxdSy7ibR7jBxPX8Ho0pTY6CAFTpjThYwFImsEGWj7CsVJ+zKP1Q3aCUBpKhvvRysNQQqbI2ffdKnBkuTFOJMA0zsr4mxlbqjMaKRS2sQJomS4+YOXCCJMdAGAKRMxglX/3+SZBKeljjmNGkCMluXzJ7e94wp+cpEIAfuJIYh2aMAskah9nsOWxOY3a2whjavEVo0hQIxF6WZsjQnY86iVIZaRW02pyPfjgS3vXd/oZ6WslxjP/6drNlPD55QZKzRzr+fEA8HIQRsxwVcwZxKy3zDX6l68W1Qy3CtBAdmNigMzyc= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c00c668c-b3a1-4d4e-8fae-08d6a5647c42 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2019 14:27:11.8462 (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: MN2PR18MB2784 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-10_13:, , signatures=0 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: Sun, 10 Mar 2019 14:27:15 -0000 Adding Alan. -----Original Message----- From: Liron Himi=20 Sent: Monday, February 25, 2019 13:30 To: ferruh.yigit@intel.com Cc: dev@dpdk.org; Liron Himi ; Liron Himi Subject: RE: [PATCH v2] net/kni: calc mbuf&mtu according to given mb_pool Hi, Kind reminder Regards, Liron -----Original Message----- From: lironh@marvell.com 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