From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 89C532C27 for ; Thu, 6 Jul 2017 11:33:02 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jul 2017 02:32:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,316,1496127600"; d="scan'208";a="282822195" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by fmsmga004.fm.intel.com with ESMTP; 06 Jul 2017 02:32:50 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 6 Jul 2017 10:32:47 +0100 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.187]) by irsmsx111.ger.corp.intel.com ([169.254.2.25]) with mapi id 14.03.0319.002; Thu, 6 Jul 2017 10:32:47 +0100 From: "Burakov, Anatoly" To: "Yigit, Ferruh" , "dev@dpdk.org" CC: Stephen Hemminger , "Richardson, Bruce" Thread-Topic: [PATCH v10 10/20] unci: init netlink Thread-Index: AQHS9OCWQP2/vCevlE2MQHA+jaQ0baJGi6BA Date: Thu, 6 Jul 2017 09:32:46 +0000 Message-ID: References: <20170630165140.59594-1-ferruh.yigit@intel.com> <20170704161337.45926-1-ferruh.yigit@intel.com> <20170704161337.45926-11-ferruh.yigit@intel.com> In-Reply-To: <20170704161337.45926-11-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjcyMDZiZTktMWJjYy00ZDFlLTliYmItMmQ0OWFlOTJjNjIyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImQ1Mmc1emxFWE40VU9WZHBwNnVpTUxEVjZaVkVhZE1BWjZTaDNQNWI2YVk9In0= dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v10 10/20] unci: init netlink 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: Thu, 06 Jul 2017 09:33:03 -0000 > -----Original Message----- > From: Yigit, Ferruh > Sent: Tuesday, July 4, 2017 5:13 PM > To: dev@dpdk.org > Cc: Yigit, Ferruh ; Stephen Hemminger > ; Richardson, Bruce > ; Burakov, Anatoly > > Subject: [PATCH v10 10/20] unci: init netlink >=20 > Initialize netlink socket. >=20 > Userspace application will connect to the socket for data transfer. >=20 > Signed-off-by: Ferruh Yigit > --- > .../linuxapp/eal/include/exec-env/unci.h | 33 ++++++++++ > lib/librte_eal/linuxapp/unci/Makefile | 1 + > lib/librte_eal/linuxapp/unci/unci_dev.h | 3 + > lib/librte_eal/linuxapp/unci/unci_net.c | 7 +++ > lib/librte_eal/linuxapp/unci/unci_nl.c | 72 > ++++++++++++++++++++++ > 5 files changed, 116 insertions(+) > create mode 100644 lib/librte_eal/linuxapp/unci/unci_nl.c >=20 > diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/unci.h > b/lib/librte_eal/linuxapp/eal/include/exec-env/unci.h > index 8d4a95777..6d3490aee 100644 > --- a/lib/librte_eal/linuxapp/eal/include/exec-env/unci.h > +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/unci.h > @@ -60,6 +60,20 @@ >=20 > #define UNCI_DEVICE "unci" >=20 > +#define UNCI_GENL_MSG_LEN 1536 > + > +#define UNCI_NL_MSG_LEN 500 > +struct unci_nl_msg { > + __u32 cmd_id; > + __u32 port_id; > + __u32 flag; > + __u8 input_buffer[UNCI_NL_MSG_LEN]; > + __u8 output_buffer[UNCI_NL_MSG_LEN]; > + size_t input_buffer_len; > + size_t output_buffer_len; > + int err; > +}; > + > /* can go into include/uapi/linux/if_link.h */ enum { > IFLA_UNCI_UNSPEC, > @@ -70,4 +84,23 @@ enum { >=20 > #define IFLA_UNCI_MAX (__IFLA_UNCI_MAX - 1) >=20 > + > +#define UNCI_GENL_VERSION 1 > + > +enum { > + UNCI_ATTR_UNSPEC, > + UNCI_ATTR_MSG, > + __UNCI_ATTR_MAX, > +}; > + > +#define UNCI_ATTR_MAX (__UNCI_ATTR_MAX - 1) > + > +enum { > + UNCI_CMD_UNSPEC, > + UNCI_CMD_MSG, > + __UNCI_CMD_MAX, > +}; > + > +#define UNCI_CMD_MAX (__UNCI_CMD_MAX - 1) > + > #endif /* _UAPI_LINUX_UNCI_H_ */ > diff --git a/lib/librte_eal/linuxapp/unci/Makefile > b/lib/librte_eal/linuxapp/unci/Makefile > index 02e354814..c2a81be7d 100644 > --- a/lib/librte_eal/linuxapp/unci/Makefile > +++ b/lib/librte_eal/linuxapp/unci/Makefile > @@ -48,5 +48,6 @@ MODULE_CFLAGS +=3D -Wall -Werror # all source are > stored in SRCS-y # > SRCS-$(CONFIG_RTE_UNCI_KMOD) :=3D unci_net.c > +SRCS-$(CONFIG_RTE_UNCI_KMOD) +=3D unci_nl.c >=20 > include $(RTE_SDK)/mk/rte.module.mk > diff --git a/lib/librte_eal/linuxapp/unci/unci_dev.h > b/lib/librte_eal/linuxapp/unci/unci_dev.h > index 92b9b8383..a748abf98 100644 > --- a/lib/librte_eal/linuxapp/unci/unci_dev.h > +++ b/lib/librte_eal/linuxapp/unci/unci_dev.h > @@ -39,4 +39,7 @@ struct unci_dev { > __u32 pid; > }; >=20 > +int unci_nl_init(void); > +void unci_nl_release(void); > + > #endif /* _UNCI_DEV_H_ */ > diff --git a/lib/librte_eal/linuxapp/unci/unci_net.c > b/lib/librte_eal/linuxapp/unci/unci_net.c > index 42fac3e63..1989b6d23 100644 > --- a/lib/librte_eal/linuxapp/unci/unci_net.c > +++ b/lib/librte_eal/linuxapp/unci/unci_net.c > @@ -74,6 +74,12 @@ static struct rtnl_link_ops unci_link_ops __read_mostl= y > =3D { >=20 > static int __init unci_init(void) > { > + int ret; > + > + ret =3D unci_nl_init(); > + if (ret) > + return ret; > + > return rtnl_link_register(&unci_link_ops); > } > module_init(unci_init); > @@ -81,6 +87,7 @@ module_init(unci_init); static void __exit > unci_exit(void) { > rtnl_link_unregister(&unci_link_ops); > + unci_nl_release(); > } > module_exit(unci_exit); >=20 > diff --git a/lib/librte_eal/linuxapp/unci/unci_nl.c > b/lib/librte_eal/linuxapp/unci/unci_nl.c > new file mode 100644 > index 000000000..1461a3309 > --- /dev/null > +++ b/lib/librte_eal/linuxapp/unci/unci_nl.c > @@ -0,0 +1,72 @@ > +/*- > + * GPL LICENSE SUMMARY > + * > + * Copyright(c) 2017 Intel Corporation. All rights reserved. > + * > + * This program is free software; you can redistribute it and/or modif= y > + * it under the terms of version 2 of the GNU General Public License a= s > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU > + * General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; > + * The full GNU General Public License is included in this distributio= n > + * in the file called LICENSE.GPL. > + * > + * Contact Information: > + * Intel Corporation > + */ Again, GPL-only, but the module says it's dual BSD-GPL (and some files inde= ed are licensed under dual license).