From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0056.outbound.protection.outlook.com [104.47.33.56]) by dpdk.org (Postfix) with ESMTP id 4FC8568A9 for ; Wed, 3 May 2017 13:21:32 +0200 (CEST) Received: from BN3PR0301CA0048.namprd03.prod.outlook.com (10.160.152.144) by BN1PR03MB171.namprd03.prod.outlook.com (10.255.200.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Wed, 3 May 2017 11:21:31 +0000 Received: from BN1BFFO11FD044.protection.gbl (2a01:111:f400:7c10::1:126) by BN3PR0301CA0048.outlook.office365.com (2a01:111:e400:401e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11 via Frontend Transport; Wed, 3 May 2017 11:21:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD044.mail.protection.outlook.com (10.58.144.107) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1047.9 via Frontend Transport; Wed, 3 May 2017 11:21:30 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v43BLPtj008454; Wed, 3 May 2017 04:21:29 -0700 From: Hemant Agrawal To: CC: Date: Wed, 3 May 2017 16:51:10 +0530 Message-ID: <1493810472-668-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493810472-668-1-git-send-email-hemant.agrawal@nxp.com> References: <1493810472-668-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131382840909324248; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39850400002)(39840400002)(39860400002)(39410400002)(39380400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(356003)(104016004)(53936002)(305945005)(2906002)(106466001)(33646002)(76176999)(5003940100001)(2351001)(498600001)(50986999)(77096006)(50226002)(105606002)(6666003)(4326008)(47776003)(86362001)(189998001)(2950100002)(38730400002)(6916009)(81166006)(5660300001)(8936002)(8676002)(110136004)(85426001)(36756003)(50466002)(48376002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR03MB171; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD044; 1:YPRme3vltKiVmEzZO5D872oNLOJVi9bA9ua+bVID5NjLMoSzk+wPoFllhdwY5Jql4V30YCAYECRWXG3lt0llnkCMYtYFOmZ3NIPrkgSKH4ipZXYeanhOSb6kBjVvKurT04OGxermwM+fXSPO2WE/Kx/2D2vVJqP4lBsOvYvz3ML7dg/rWY/dC0avBV0moNkPI4zEw+A50wBkehqsxuBecSP5BFYghMTvrPA8wRtte5nPgGRhI4H968cBTHVCJRfNgJg8uQ5vlDwNSDmNHxGKdfYTyonNaM/32RymmCssrJAOXV4VEcNICh3JIptsflaOx0G1kmBFJPCAwU3UUGyde+LFhVLloNuJFEpYq3bJSqUyXBV/vcoAi86rpF/Jd9a6HWMVj+yzVB60SyA9SrPvywzErfl+7wAhAac0mL1iMjhKtxroQq+jiuydyVyMfHJeoiEu1b0TDWk2gYTyDGyJFPZJUZEo8tZq282zuhvQO9HobRo8hCNHH5hRJeSAWHZ3UmeYQS4o1qtrYjEXzuKKSYm+LuSiz4c9jOWS0T0saaDtGYvbLBOWY1niR8Djo3DPRRQDX/BmK/G+09GU49vHJvZmB8XcNB/rb8R/2qn5Q6na8bZpI3WFW+yY0axcYHdIMm1tCzp7n+WNWU4/5nJn+tihEV+MKOJkICiTPKTVMJ8= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c774d713-fef5-4c84-9d16-08d492168c6d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN1PR03MB171; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB171; 3:0OImfH5t/62d2JpNv0KtQHgTMCTFGzPlORMwRAAipISvPXSms+1YWU/bfuqNSabSXtH4k40a8dEdNnRV8SqO0R44nLgDCAkFNuFuNv78VwlO9WoQlTob3j1etV+d6rl6r4ewCJrRUM69H2ZgHqsz95lgO5mne5M4STdImjEiV99/nDBv4W3XYYPOW2njL2DqErcVNJMWAE8yg119Dy5VH/J+3diNfFMg3q151nYya6JXR1knn3/vRR+6Tf2wIyUhrp0pI5/tsCFA6x90MEXoTeU5L9olTtpafVYNzj7UTsH3ZZ/pyDtBEUxZGb049Ozqj2A7ylBILNQUKqQ1qiEG4lzHgCKXNA86t5fCF7+2uPuGIwoUcLlGLz5zcerqTljzZNhxDRY9A9dL1UKsRyipCdiw5mimG2XmX5oosTdKNznkcTOCnWtg/sSats/I4IDh; 25:nu4i4DzvobHaAymZdEVnQWZdJFIXqeJNGWQ8rkHvRhh90n224aOmirdYFO5ERp4WD3HxpzNNxGlMl6iFLGJlt02CX/mTFwRJ43TiKfJORyxh3B3rzIZjSr9Z5MEX/vnNte+0Vh2oBXkXWHXUxOorALio1Tj+lyz/8XgNjB1QjoBhnKfVRYXeWg4iUk29GsREeqP51oCW/pXpbZnou/3CDog+TxA/CyPPxiz19u+ndUB5D0QRkyhXtON0sUTPZcF9zQ61gmnZ4fB0abEuI4C8Q3N2OIyMqLMFOtK0k5ucXaowwP7OTn0UYtJFLO1CvAeKwwczBVb+XiCgtdQjzf6gnxpHYfUsAqaZOoRv4fkimr/4ZhbG4NBhUKo9/7oGCT508SeIW/1v18EL8gV8VNcRDxuEH+mxx54bR7dLoI7NYy0lg6CkKbzRG0rLocacArZe/VHkIeoRdrjFf1mUH5Le8w== X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB171; 31:wq4hiGfbTcAfkuC7LDS+n3rLTlMJ7t0+o0RajdLqDtTvmXKY1pfYRPBLyMzXnZMEWp/5QBiFQc3GqUNSpoKlVIkmiTLxswK8BFETTfQ8CWdTVdDIpxpI1muNGnPu4x9P5sCqMN+SSAtxz+YGdM8tpgR9ngSvCCVAJDgIYeTnhtsB/jQItQAGsGJ2IcH+kM4KhufwKRKPMjoPYVtZqfqx/YD+5FsMTpJnuW/IgblRnSbYN+bdpWpHBOQ5a2a5gOGYKYizT/3h5Cv5jfouWyjDrQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13017025)(13015025)(5005006)(8121501046)(13023025)(13024025)(13018025)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123565025)(20161123559100)(20161123556025)(20161123561025); SRVR:BN1PR03MB171; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR03MB171; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR03MB171; 4:lc5OTkR0n+SKKSgx+Oy3NdskiRln2heSgO+or0t+cQR?= =?us-ascii?Q?3PT8X8J0N/spMZEIBU9HF591ROpXqraeo2wv8IbkwFnhxYr1Ww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pny9L4Yhq5io9dWbAgcqfR+gQkEWgk1o6UJyTBduxGsOFktQSsEbQStYQccnZD9aAHvmwaACWz6ZrnHA==; 5:a3pZ4Iqrd/qMkTjLoH2FnBWal1yerXpoTi+gEc1/qVGqCEClENQZvmzOhToLffUKsC4/4Gr74Cpu/VPAFVpVT2IYELnbyXLlSmwQ6J00ZURnjPGyNJaN4ElOuCa3mHYMXZr+Wk5UobEWI7JLleWczcqZ+OO8fP1OkicZURugAAhbke295ZfpDiyRx1fw2aPY; 24:b97KQexnRmBeD9rDlFhhiMTUk63rQiaaglAruX/GjoIjO+Bb1pLUcNCLQTeKHQeEaFzxV23308PF3hP5wENIwbAQVrV/SyOnAX6h13VSvYs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB171; 7:CYwW1BhhutfjLjXBmUywa4eSbtlpm06Yhpy2CyeagHBEm1oOMsEDNPoose7G51Y1Z2eKCgKwR0IvrOo/PJrK/oi4u47wAaLg50tAE/sL/OpzLBsRH8lU2BE26/rdNB5BLK5nPwol4XRZ3vml5/JdHJkPE/WsZXljiUoZEIHI9mqxQI3OK/Yll0NZUkSa9chBpwKvb84/RG60XN9QinN6o4zVpIhfIdGqQ4+A8t1btzK/3/C3CMvBY4NHVaceq4siEb2/YnCMQdHYYUbdf4mlNi+URnWPXm/ZZayt2hEX4XT5tea7nXW8Jeds8qGHiEO2O2Z9RKzxCU4Xl2KYy2LUCA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2017 11:21:30.7296 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB171 Subject: [dpdk-dev] [RFC PATCH 3/5] kni: init and change request for mtu 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: Wed, 03 May 2017 11:21:32 -0000 1. Configure initial mtu. 2. Message to userspace for mtu change Signed-off-by: Hemant Agrawal --- lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 1 + lib/librte_eal/linuxapp/kni/kni_misc.c | 2 ++ lib/librte_kni/rte_kni.c | 1 + lib/librte_kni/rte_kni.h | 1 + 4 files changed, 5 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h index c04fefd..2cd7d9a 100644 --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h @@ -172,6 +172,7 @@ struct rte_kni_device_info { /* mbuf size */ unsigned mbuf_size; + unsigned int mtu; /**< MTU */ char macaddr[6]; /**< Mac Address */ }; diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c index 90879fa..4f99a5e 100644 --- a/lib/librte_eal/linuxapp/kni/kni_misc.c +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c @@ -469,6 +469,8 @@ struct kni_net { memcpy(net_dev->dev_addr, dev_info.macaddr, ETH_ALEN); } + net_dev->mtu = dev_info.mtu; + ret = register_netdev(net_dev); if (ret) { pr_err("error %i registering device \"%s\"\n", diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 8ae632f..a3aab9d 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -373,6 +373,7 @@ struct rte_kni * dev_info.mbuf_size = conf->mbuf_size; memcpy(dev_info.macaddr, conf->macaddr, ETH_ADDR_LEN); + dev_info.mtu = conf->mtu; snprintf(ctx->name, RTE_KNI_NAMESIZE, "%s", intf_name); snprintf(dev_info.name, RTE_KNI_NAMESIZE, "%s", intf_name); diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 488db4b..3156e33 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -98,6 +98,7 @@ struct rte_kni_conf { struct rte_pci_addr addr; struct rte_pci_id id; char macaddr[ETH_ADDR_LEN]; /* MAC address assigned to KNI */ + uint16_t mtu; /* Maximum transmission Unit of KNI*/ __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */ -- 1.9.1