From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0066.outbound.protection.outlook.com [104.47.37.66]) by dpdk.org (Postfix) with ESMTP id 4723E5698 for ; Thu, 15 Sep 2016 11:11:54 +0200 (CEST) Received: from BN3PR0301CA0059.namprd03.prod.outlook.com (10.160.152.155) by CY1PR0301MB2011.namprd03.prod.outlook.com (10.164.2.17) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.10; Thu, 15 Sep 2016 09:11:52 +0000 Received: from BN1BFFO11FD035.protection.gbl (2a01:111:f400:7c10::1:197) by BN3PR0301CA0059.outlook.office365.com (2a01:111:e400:401e::27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.10 via Frontend Transport; Thu, 15 Sep 2016 09:11:52 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD035.mail.protection.outlook.com (10.58.144.98) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Thu, 15 Sep 2016 09:11:51 +0000 Received: from [127.0.0.1] (B32944-11.ap.freescale.net [10.232.14.25]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u8F9Bjs3019628; Thu, 15 Sep 2016 02:11:49 -0700 To: Yuanhan Liu References: <1473072871-16108-1-git-send-email-pankaj.chauhan@nxp.com> <1473072871-16108-3-git-send-email-pankaj.chauhan@nxp.com> <20160913121423.GT23158@yliu-dev.sh.intel.com> CC: , , , From: Pankaj Chauhan Message-ID: <5da31caa-888e-424a-749f-18e2b91b0e77@nxp.com> Date: Thu, 15 Sep 2016 14:41:44 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160913121423.GT23158@yliu-dev.sh.intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184043121530022; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(199003)(189002)(24454002)(377454003)(43544003)(31686004)(50986999)(104016004)(2906002)(230700001)(83506001)(86362001)(4326007)(15395725005)(68736007)(31696002)(76176999)(54356999)(8676002)(11100500001)(87936001)(586003)(626004)(8936002)(23746002)(7126002)(7246003)(85426001)(92566002)(2950100001)(77096005)(47776003)(15975445007)(7846002)(81156014)(50466002)(64126003)(5660300001)(65826007)(81166006)(120886001)(110136003)(305945005)(65956001)(105606002)(19580405001)(106466001)(4001350100001)(8666005)(36756003)(356003)(33646002)(69596002)(19580395003)(65806001)(189998001)(97736004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2011; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD035; 1:LSdKWNXfMgs7dzTATOWnovGXlfaTemtyXxLH/glqDi5PLa+OYksqJDQyQYmblI4AkY9Tm1GxvC5+HUTBLaPGLnAEHhcAMoTI0dLgSfVfQazCwIQI6fAET0JA54+nJGpF59hBK+J1xF/vzvCNExS6nHgoKwhnp116mCl458kwIJikre2xzIQHzVPoIIk2ilpr/60DUABkY8M2HdeZ82nlgLjXHrBkeBeuNv+nnNCR3ZDFtcsGJUPiefvZEerfr/uqTrBHgX/2Z2cL8MuXso06ayHWfJ0xG8stWgGbgfwFJcADoF0tiOBLAb/N6+/qESpSOGyMdmUFbr1w5tkntv0LFw1VNuYbsFDJCKlgRM7M2Fp2TExCzlGLKLarbDpYQCIPiHgvAlwR7YadEcbzfGR3JCLG5P2dp09C5AWGWCTIq7HVuyl8Jdvm0QWAWRtjEiJQWFDfdaHF327qLWxrvwQpRK0rksvXGFMJ5eKVoPjmB6tvRbtCoPY/Op6NdB4PtQvdCITjP8I5ld1Kygjh5pW9rRWj4d3aCoP1mRrdessDueHpSwHoiyfmMBoyuWXVJ7dMigdQi0IR5aA/M2m1LgydyPLlMNKRv4NtJ6elwVSj50Kmt1IB0A1EdnBlMaucbWwKdXne3nNsXihrhNCdQnagoQ== X-MS-Office365-Filtering-Correlation-Id: 071f99eb-0a07-420d-f345-08d3dd4854e9 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2011; 2:MTLbz/59j1Ai1tAGh7+sVln3diC/mV9alOOUkd/d7cMbNEgxZGjLjiPVsrmeBRpmSfAP9pQ9Z1VeBa6oViwmgs33U8laISeN6yHeKQ3yBtyVkXiP1yWnC7w7AnFKh1Hw0WU3sp55RobDM/H6N5S+RiaQngxS8GUOFHTNPWl5QgDC1Pr6OFQI12K+oKgSutoa; 3:NRpbeN8yN21be6rGU3FfegYKKG2sRSsmOJTJRFQTunqyWI6QMYWiPsa3ml3Q0P+1I7iBIUhn8RjWQoWaj7keQE3jA58OOLBbzubsJPweydELmNnOLqO8QxLNUd37We2w/Sf2LPQ4P1iK9fbeJTo+2kM5Bva/MO2YeKbQMYDElHivUvAbXFlg3OowBZy1Fk1CskbYZNCOc/Peti0CJG6lH4rhyORDn8uTn5g8zs24sGo= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB2011; X-Microsoft-Exchange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x6u0ONDL3vPTp/JWQqg9+GI7O7z1Whpq/F1+AYLxp+kEGZ2wl3ZLW0zyYaR7q2bfKcvFI5jW1r6ckp0hzcMFVcQQaUW2f3tO/o=; 4:R2VoBfUrA/qYjMchejgwpZJVu4K6fwsbJsZeaL/4Au0Av1XTpKqhsUFrkKdgtLwhkxbo/J7PaRm3I8lhxplc06n5Uaqm2FTekhrVLluJK9Firq2NpT6LEbrpMo4qiLaQw0F8YuTssw1GFTiFRqG0UosA8tpBd6hwUAlwTKUMUbSKD9yIn/N/W4Jo0rC3dNn+s+xu+DgGSwCAXGJzBtOScDZWxGuShf8XxmTyP0yH5PC7ER9PxQUsoAzgoYzkt8MBpcMJjIc4z5t+CoyXF2P2ZpGLY1xkhY02fXyNjJrWCNfAOJM9L6AgT1oAdzf4fBmqsr2zztmNXH/PedJY8pPbFXu9Vap7qBt/zgb1ckKIs05uJ0F7Oz0Mvht7f+2HQWruHdT2OygSo/YnDiaIsDbVg12tCIAMGYrgd79wfJYDLK9AJYcAcyrZPBNHmafUNk3LY6uMdx9EuKn/CX4biIh+yOdUgMdN/4sn9LccUtrVWrSoBWajzIx+rhVZIv8vGKnlnD41cKRLMrewxhTDbX7Kr5pn+zxpBrfQihJ9aXMadqo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(13017025)(13023025)(13024025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB2011; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB2011; X-Forefront-PRVS: 0066D63CE6 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY1PR0301MB2011; 23:gog2NkgW2HcdIYCR3glswfIWpDZppX+lPPp?= =?Windows-1252?Q?p/N1gd2PVyAlOM2d4i2WAb9gAxteqejajuIV5XGeKCULZpqAC9QNn1F2?= =?Windows-1252?Q?D56ot82TntBXzU4Pz2GjVY4uThbqtOEXDB+NiahVPV35wYx25Y7c5p51?= =?Windows-1252?Q?j+NyfrRYrOJ7Xs4EhyuP6IW+IkuUKi1MxhkID2xmaC79F5ItoXY2p8j5?= =?Windows-1252?Q?oLwoiemC0Yh70ZStx9t7eD+oxh+uZTidNXoSokHtejsUzRbWGwXcAyjI?= =?Windows-1252?Q?To1cZi549vkZsSVM1zb/fmCRWPZE31a59eWmOzQJ6KchRun6PyTDiGgE?= =?Windows-1252?Q?leBdeCVMs2v6YmvwPTqvd5OReWYadNHJRBvG0f3+2S92i14LNY94GIlX?= =?Windows-1252?Q?2po2+kb6KNw2M1RRbUHN5EROtEGmI6i5Wod8GazSwwM9Hywxk2tVJjhQ?= =?Windows-1252?Q?Ua/lvIwDpVlyGhco/6NFdZ88UWoT5nyFZBbvxl1j5VRRfGMJvW54dut/?= =?Windows-1252?Q?RwPdq+MZ0oPGkWZiUrzPe/GF9HDzZRa8qxTxuk/SdIe6hyhFyOTb4nYE?= =?Windows-1252?Q?8NoTzkdja9i9pWR8AQh68k0GGRZwuyhbZuH9lYh24zsEiWvUvxJ58U41?= =?Windows-1252?Q?Od4VXzw481MNElVL86ldv1mJFRU49I8ln1y74mcWwuQEO6Rk3CHJZNBL?= =?Windows-1252?Q?/LVSqVF9XXG04+iQZLvJb/UzEMDdhAPbyLDWnkiFhwTXr/86o5WpTj6f?= =?Windows-1252?Q?W/QUogyuryDCvo6JSEqHtGpNGnZZwPXe+AYnXlrzYqv9rZLSXBCbC6q5?= =?Windows-1252?Q?fzAqg0UldUW878UrlonHnhEUdL3iQoYwqERRwx+pzlaxxfj/pL2YgOXQ?= =?Windows-1252?Q?kvvw8/dXSwyVyohKoQ2oLfQ9KjSCz8WjfhuoC2o2a/uuW7Puu/02QVYA?= =?Windows-1252?Q?uJuLnUZvPZFFd5b+dl/ZiUMKjPukJf083ejaPHEl/XhBDXZxtKWlyh/D?= =?Windows-1252?Q?uK66S9BKBOdjRTN/c/6etYUEcLOmwXs3p4AmomHOx0iklEEA8llWRbI6?= =?Windows-1252?Q?/LZWrQm77ImfThfvObekufr9byDYcf+EZOKDI1HfBvuK9Wk53FiFDypM?= =?Windows-1252?Q?tuw0PtEC0e01nkMqLqmY/sL5KFFBWBJt0ExzetpACJsXlBKGWaMwz2Pm?= =?Windows-1252?Q?5jjS/Wnkd4uzV0fuq8Xfk0K8dpSx3X0BlHgNzDKfm1lnJGThMmacQEdv?= =?Windows-1252?Q?iQrEpW0W//sMXB+CM0J5utv4ZB7nlp/EOJk2j0+fbHONBsTMSdb9tGtb?= =?Windows-1252?Q?VeyBX5HkrNK7dlWPI9Mmr8HliArTc828xrzh9iAOBUQIxTQ70tbAqXAn?= =?Windows-1252?Q?paEMvndwut0adTT6y2S/drr/Uhj8uGqzzdMWDLxPY19sCELuGrIF9PFb?= =?Windows-1252?Q?fqM/DlDrcNmJkjM48VO9v3HpKT4iBN2ycs2a3Vmh5WGOdX8NJ4I8pr/5?= =?Windows-1252?Q?0SCQ1OoIWg3C/GaXsGRQXJSemNkoKwgOdbVsM9HOeVFpHkmEkepRHEbH?= =?Windows-1252?Q?21j71EnLxDVKYeLLm+7Rj7mCGJWNdvy2I3HNQd4EL7XrHoL4UIdMcGF4?= =?Windows-1252?Q?4J3V/aDOIzmwdD+PyZkeA0Mo7GXb0gYOPz6x8J+pxlp+7?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2011; 6:ZWgTPylExIVGyRk8ze221x4CsEtNEIdUCTpmEPck1zMThOB9DegHx8sLvVJYe0q1WuPPbIDursAIbQa0+YH4BpH0qz2oUFbcaX4GtRTxuE1dDkWq5A+EQqHJak1nE8NMKkKD+9ogjdgeHVR6YJD9TAlId2ZMX1e+h6e3yIjOE9LhhkxivpLjlMitHMDZ/e0GwPJ4x8hkX+tHEjNLDiFkxFKO3jeMOMUpnjs/P2XFdHclS3bES+a6XrRKY3A7bUUX6qhw3UV8JvE5K9/H4+5iOOfK+ugq5IIzbXi0M78ztt8=; 5:Zrcbp5ZkZZZm2IHEFxDBbK6v28eB+w+ZExMstdN4G8odaZracKvnJG5I/Vitv7yrp1Enm8c6lW8Ffx7dWfWxeTdBKt4X5xRgIGqOFZyUxSTqAZ0UN0+1FxXDctSx0/35x0QDHjaJQFJ/cAWjtS/pMUboSMLY2X/pKNscyoiCwgI=; 24:AOxlFtsRl+xA+j8yH3c+xTFpq4Zk8J00dP14O5RW52xmPP8n2huhaBf2UMTEwhO992/888Z9ckJ7Vd9Er2+N32kgPIHxl6LAACY+3Q1rE70=; 7:yuesHNpkXpJE+YzejtFap7W4XgCe10CyENORLCE+1H2ZqvoqwVY1GhnkhwawfRmbhq0PgAIq81vI1gbPUmWP333zs4dXnM9EusE8hEiyOw3HdO1fG1vK8SGsoAs83sfQ9agjV1VZGE0RLe5OGhVn7D3WTxjFe7ZKEtRt2G4vDWgh0cA2OzLmk1ZGRl21QMPQk7+AwZdfCKDT6f0kdZKoOQNUuhl/ZkNWI0kGfdCHRUlqxEy06/j2ncod9kdy6MTH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2016 09:11:51.9034 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB2011 Subject: Re: [dpdk-dev] [RFC][PATCH V2 2/3] examples/vhost: Add vswitch command line options X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 09:11:54 -0000 On 9/13/2016 5:44 PM, Yuanhan Liu wrote: > On Mon, Sep 05, 2016 at 04:24:30PM +0530, Pankaj Chauhan wrote: >> Add command line options for selecting switch implementation >> and maximum ports for the vswitch.following are two new command >> line options: >> >> --switch [char string, Selects the switch imlementation] >> --max-ports [int, selects maximum number of ports to support] >> >> For example: >> >> $ ./vhost-switch -c 3 -n 2 --socket-mem 1024 --huge-dir /hugetlbfs -- -p >> 0x1 --dev-basename sock1 > > That means you were basing on the master branch. You should base on > next-virtio instead: http://dpdk.org/browse/next/dpdk-next-virtio/ Yes i were basing it on master, i will base the next version on dpdk-next-virtio. Sorry for this, i am bit new to dpdk upstream development . > >> --switch "vmdq" --max-ports 3 > > Normally, we should keep the old behaviour first. Say, making the vmdq > as the default switch mode. Yes if we don't give the '--switch' option then default is vmdq. > > However, actually, I don't quite like to make the vhost-switch to bind > to a hardare feature that tightly, that you may want to make a standalone > patch as the last one in this patchset to make the "switch" mode be the > default one. Sure i will split the patch to take care of this. > >> >> Signed-off-by: Pankaj Chauhan >> --- >> examples/vhost/main.c | 43 +++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 43 insertions(+) >> >> diff --git a/examples/vhost/main.c b/examples/vhost/main.c >> index c949df4..a4e51ae 100644 >> --- a/examples/vhost/main.c >> +++ b/examples/vhost/main.c >> @@ -142,6 +142,10 @@ static uint32_t burst_rx_retry_num = BURST_RX_RETRIES; >> /* Character device basename. Can be set by user. */ >> static char dev_basename[MAX_BASENAME_SZ] = "vhost-net"; >> >> +/* vswitch device name and maximum number of ports */ >> +static char switch_dev[MAX_BASENAME_SZ] = "vmdq"; > > First of all, limiting it with MAX_BASENAME_SZ makes no sense here. > I will fix it, define a different constant for switch_dev name. > Secondly, you don't have to represent the switch mode with string, > you could simply use some numeric macros, or enum. > I used the string because the registration function (vs_register_switch) uses the switch name as string to register the switches and find the matching switch_dev given in command line. If we use macro or enum then we will have to add the MACRO for the switch id in common code every time a new switch implementation is added. Keeping a string as name, saves us from touching the common code for adding a new switch implementation. > Besides, I just had a quick glimplse of your patches (still couldn't > make a detailed look so far), and I'd ask you to do few more things > for v3: > > - I'm hoping you could split this patchset further, say **maybe** > one patch to introduce vswitch_port, one to introduce vswitch_ops > and another one to introduce vswitch_dev. This helps review. > Do you want me to split the vswitch_ops, vswitch_dev and vswitch_port introduction (mainly vswitch_common.h) in three patches with the patch body explaining them in bit detail, correct ? Their usage i.e vswitch_common.c can be kept in separate patch (4th one), is this fine? otherwise it fill be tricky to make vswitch_common.c to compilable without complete definition of vswitch_port, vswitch_dev and vswitch_ops > - make sure each commit is buldable. > I will take care of this in v3 > > And few more generic comments to the whole set: > > - use "__rte_unused" but not "__attribute__((unused))" > And we normally use it after but not before the key word. I will take care of this in v3 > > - follow the DPDK prefered way to define a function, the return type > and function name takes two lines. I will take care of this in v3 > > - run scripts/{checkpatches.sh,check-git-log.sh} and fix real warnings > if any before sending them out. > > This would at least help you catch "line over 80 chars" issue. Sure, will take care of this in v3 and onwards. Thanks, Pankaj > > Thanks. > --yliu >