[dpdk-dev] [PATCH 1/2] examples/vhost: rename dev-basename

Maxime Coquelin maxime.coquelin at redhat.com
Thu Aug 18 10:29:12 CEST 2016



On 08/18/2016 10:35 AM, Yuanhan Liu wrote:
> On Thu, Aug 18, 2016 at 10:22:38AM +0200, Maxime Coquelin wrote:
>> Hi Jiayu,
>>
>> On 08/16/2016 06:14 PM, Jiayu Hu wrote:
>>> In examples/vhost, "dev-basename" is a program option, which is to set
>>> the vhost-net socket used by vhost-user, or the character device used
>>> by vhost-cuse. Since vhost-cuse should be dropped, and "dev-basename"
>>> is not a suitable name for the vhost-net socket. Therefore, this patch
>>> is to change this option name for examples/vhost.
>>>
>>> Signed-off-by: Jiayu Hu <jiayu.hu at intel.com>
>>> ---
>>> examples/vhost/main.c | 41 +++++++++++++++++++++--------------------
>>> 1 file changed, 21 insertions(+), 20 deletions(-)
>>>
>>> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
>>> index 92a9823..a718577 100644
>>> --- a/examples/vhost/main.c
>>> +++ b/examples/vhost/main.c
>>> @@ -90,9 +90,6 @@
>>> /* Size of buffers used for snprintfs. */
>>> #define MAX_PRINT_BUFF 6072
>>>
>>> -/* Maximum character device basename size. */
>>> -#define MAX_BASENAME_SZ 10
>>> -
>>> /* Maximum long option length for option parsing. */
>>> #define MAX_LONG_OPT_SZ 64
>>>
>>> @@ -139,8 +136,8 @@ static uint32_t burst_rx_delay_time = BURST_RX_WAIT_US;
>>> /* Specify the number of retries on RX. */
>>> 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";
>>> +/* Socket file path. Can be set by user */
>>> +static char socket_file[PATH_MAX] = "vhost-net";
>>
>> Not very important, but now that we only support vhost-user,
>> maybe we could default the name to "vhost-user"?
>>
>> There is no real convention I think, but this is what OVS is
>> used to use in its examples.
>
> I think it doesn't matter now, since since the 2nd patch, --socket-path
> is a must but not optional any more, meaning there is no default
> socket file path.

Yes, just noticed it while reviewing patch 2.
So this is all good to me for this patch.

Thanks,
Maxime


More information about the dev mailing list