Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-21 Thread Adrien Mazarguil
Disclaimer: I agree with Thomas's suggestions in his reply [1] to your message, I'm replying below as well to provide more details of my own and clarify the motivations behind this approach a bit more. On Tue, Dec 19, 2017 at 12:44:35PM -0800, Ferruh Yigit wrote: > On 12/19/2017 7:06 AM, Adrien Ma

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-20 Thread Thomas Monjalon
19/12/2017 21:44, Ferruh Yigit: > On 12/19/2017 7:06 AM, Adrien Mazarguil wrote: > > On Mon, Dec 18, 2017 at 05:54:45PM -0800, Ferruh Yigit wrote: > >> On 12/18/2017 8:46 AM, Adrien Mazarguil wrote: > >>> As described in more details in the attached documentation (see patch > >>> contents), this vi

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Ferruh Yigit
On 12/19/2017 7:06 AM, Adrien Mazarguil wrote: > On Mon, Dec 18, 2017 at 05:54:45PM -0800, Ferruh Yigit wrote: >> On 12/18/2017 8:46 AM, Adrien Mazarguil wrote: >>> As described in more details in the attached documentation (see patch >>> contents), this virtual device driver manages NetVSC interfa

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Stephen Hemminger
On Tue, 19 Dec 2017 11:01:55 +0100 Adrien Mazarguil wrote: > > Why not use sscanf which would be safer in this case. > > Right, this is indeed the obvious implementation, however not only the fixed > MAC-48 format is not the most convenient to use for user input (somewhat > like forcing them t

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Stephen Hemminger
On Tue, 19 Dec 2017 11:15:38 +0100 Adrien Mazarguil wrote: > On Tue, Dec 19, 2017 at 09:53:27AM +, Bruce Richardson wrote: > > On Mon, Dec 18, 2017 at 09:23:41PM +0100, Adrien Mazarguil wrote: > > > On Mon, Dec 18, 2017 at 10:34:12AM -0800, Stephen Hemminger wrote: > > > > On Mon, 18 Dec

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Adrien Mazarguil
On Mon, Dec 18, 2017 at 05:54:45PM -0800, Ferruh Yigit wrote: > On 12/18/2017 8:46 AM, Adrien Mazarguil wrote: > > As described in more details in the attached documentation (see patch > > contents), this virtual device driver manages NetVSC interfaces in virtual > > machines hosted by Hyper-V/Azur

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Adrien Mazarguil
On Tue, Dec 19, 2017 at 09:53:27AM +, Bruce Richardson wrote: > On Mon, Dec 18, 2017 at 09:23:41PM +0100, Adrien Mazarguil wrote: > > On Mon, Dec 18, 2017 at 10:34:12AM -0800, Stephen Hemminger wrote: > > > On Mon, 18 Dec 2017 17:46:23 +0100 > > > Adrien Mazarguil wrote: > > > > > > > > +sta

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Adrien Mazarguil
On Mon, Dec 18, 2017 at 03:59:46PM -0800, Stephen Hemminger wrote: > On Mon, 18 Dec 2017 17:46:23 +0100 > Adrien Mazarguil wrote: > > > +static int > > +ether_addr_from_str(struct ether_addr *eth_addr, const char *str) > > +{ > > + static const uint8_t conv[0x100] = { > > + ['0'] = 0x

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Bruce Richardson
On Mon, Dec 18, 2017 at 09:23:41PM +0100, Adrien Mazarguil wrote: > On Mon, Dec 18, 2017 at 10:34:12AM -0800, Stephen Hemminger wrote: > > On Mon, 18 Dec 2017 17:46:23 +0100 > > Adrien Mazarguil wrote: > > > > > +static int > > > +hyperv_iface_is_netvsc(const struct if_nameindex *iface) > > > +{

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-19 Thread Nelio Laranjeiro
Hi Keith, On Mon, Dec 18, 2017 at 06:43:35PM +, Wiles, Keith wrote: > > > > On Dec 18, 2017, at 11:59 AM, Adrien Mazarguil > > wrote: > > >> Not to criticize style, but a few blank lines could help in > >> readability for these files IMHO. Unless blank lines are illegal > >> :-) > > > >

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Ferruh Yigit
On 12/18/2017 8:46 AM, Adrien Mazarguil wrote: > As described in more details in the attached documentation (see patch > contents), this virtual device driver manages NetVSC interfaces in virtual > machines hosted by Hyper-V/Azure platforms. > > This driver does not manage traffic nor Ethernet dev

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Stephen Hemminger
On Mon, 18 Dec 2017 17:46:23 +0100 Adrien Mazarguil wrote: > +static int > +ether_addr_from_str(struct ether_addr *eth_addr, const char *str) > +{ > + static const uint8_t conv[0x100] = { > + ['0'] = 0x80, ['1'] = 0x81, ['2'] = 0x82, ['3'] = 0x83, > + ['4'] = 0x84, ['5

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Stephen Hemminger
On Mon, 18 Dec 2017 22:03:55 +0100 Thomas Monjalon wrote: > > > > Good question. For the following reasons: > > > > - I forgot about the existence of ether_ntoa() and didn't look it up seeing > > struct ether_addr is (re-)defined by rte_ether.h. What happens when one > > includes netinet/et

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Thomas Monjalon
18/12/2017 21:21, Adrien Mazarguil: > On Mon, Dec 18, 2017 at 10:26:29AM -0800, Stephen Hemminger wrote: > > On Mon, 18 Dec 2017 17:46:23 +0100 > > Adrien Mazarguil wrote: > > > > > +static int > > > +ether_addr_from_str(struct ether_addr *eth_addr, const char *str) > > > +{ > > > + static const

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Adrien Mazarguil
On Mon, Dec 18, 2017 at 10:34:12AM -0800, Stephen Hemminger wrote: > On Mon, 18 Dec 2017 17:46:23 +0100 > Adrien Mazarguil wrote: > > > > > /** > > + * Destroy a hyperv context instance. > > + * > > + * @param ctx > > + * Context to destroy. > > + */ > > +static void > > +hyperv_ctx_destroy(

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Adrien Mazarguil
On Mon, Dec 18, 2017 at 10:26:29AM -0800, Stephen Hemminger wrote: > On Mon, 18 Dec 2017 17:46:23 +0100 > Adrien Mazarguil wrote: > > > +static int > > +ether_addr_from_str(struct ether_addr *eth_addr, const char *str) > > +{ > > + static const uint8_t conv[0x100] = { > > + ['0'] = 0x

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Wiles, Keith
> On Dec 18, 2017, at 11:59 AM, Adrien Mazarguil > wrote: >> Not to criticize style, but a few blank lines could help in readability for >> these files IMHO. Unless blank lines are illegal :-) > > It's a matter of taste, I think people tend to add random blank lines where > they think doing

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Stephen Hemminger
On Mon, 18 Dec 2017 17:46:23 +0100 Adrien Mazarguil wrote: > > /** > + * Destroy a hyperv context instance. > + * > + * @param ctx > + * Context to destroy. > + */ > +static void > +hyperv_ctx_destroy(struct hyperv_ctx *ctx) > +{ > + if (ctx->pipe[0] != -1) > + close(ctx->pip

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Stephen Hemminger
On Mon, 18 Dec 2017 17:46:23 +0100 Adrien Mazarguil wrote: > +static int > +ether_addr_from_str(struct ether_addr *eth_addr, const char *str) > +{ > + static const uint8_t conv[0x100] = { > + ['0'] = 0x80, ['1'] = 0x81, ['2'] = 0x82, ['3'] = 0x83, > + ['4'] = 0x84, ['5

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Adrien Mazarguil
On Mon, Dec 18, 2017 at 05:04:23PM +, Wiles, Keith wrote: > > On Dec 18, 2017, at 10:46 AM, Adrien Mazarguil > > wrote: > > > > As described in more details in the attached documentation (see patch > > contents), this virtual device driver manages NetVSC interfaces in virtual > > machines ho

Re: [dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Wiles, Keith
> On Dec 18, 2017, at 10:46 AM, Adrien Mazarguil > wrote: > > As described in more details in the attached documentation (see patch > contents), this virtual device driver manages NetVSC interfaces in virtual > machines hosted by Hyper-V/Azure platforms. > > This driver does not manage traffi

[dpdk-dev] [PATCH v1 2/3] net/hyperv: implement core functionality

2017-12-18 Thread Adrien Mazarguil
As described in more details in the attached documentation (see patch contents), this virtual device driver manages NetVSC interfaces in virtual machines hosted by Hyper-V/Azure platforms. This driver does not manage traffic nor Ethernet devices directly; it acts as a thin configuration layer that