From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4EB0A567F for ; Tue, 21 Mar 2017 16:32:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490110329; x=1521646329; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=s55kBiX4Qk5cItks+kZGGRqiC/esVrHz6YrmvrNN4oY=; b=iK94WFeFayUIucjLbvkzBhTj2cq3k0SEGM3oVagbm3mvfLBvIj9QF5Ak K9kmfqgKcKNFwISqxsswgDeYX8Y15Q==; Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2017 08:32:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,198,1486454400"; d="scan'208";a="78992574" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 21 Mar 2017 08:32:07 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.175]) by FMSMSX106.amr.corp.intel.com ([169.254.5.37]) with mapi id 14.03.0319.002; Tue, 21 Mar 2017 08:32:07 -0700 From: "Wiles, Keith" To: Pascal Mazon CC: "dev@dpdk.org" Thread-Topic: [PATCH v5 1/4] net/tap: move private elements to external header Thread-Index: AQHSnZxCIIIIMTqHUkmigsRi0TFF5qGf6rcA Date: Tue, 21 Mar 2017 15:32:06 +0000 Message-ID: <9176239A-AA15-49F2-AF81-FF9B58C9AF1D@intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.255.84.105] Content-Type: text/plain; charset="us-ascii" Content-ID: <51CA5A844D0665469DB0B0BC7DC3BD7D@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5 1/4] net/tap: move private elements to external header 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: Tue, 21 Mar 2017 15:32:10 -0000 > On Mar 15, 2017, at 9:54 AM, Pascal Mazon wrote: >=20 > In the next patch, access to struct pmd_internals will be necessary in > tap_flow.c to store the flows. >=20 > Signed-off-by: Pascal Mazon > Acked-by: Olga Shern > --- > drivers/net/tap/Makefile | 1 + > drivers/net/tap/rte_eth_tap.c | 36 ++------------------- > drivers/net/tap/rte_eth_tap.h | 75 ++++++++++++++++++++++++++++++++++++++= +++++ > 3 files changed, 78 insertions(+), 34 deletions(-) > create mode 100644 drivers/net/tap/rte_eth_tap.h >=20 > diff --git a/drivers/net/tap/Makefile b/drivers/net/tap/Makefile > index ddf87232d335..fa4658bd1e75 100644 > --- a/drivers/net/tap/Makefile > +++ b/drivers/net/tap/Makefile > @@ -40,6 +40,7 @@ EXPORT_MAP :=3D rte_pmd_tap_version.map > LIBABIVER :=3D 1 >=20 > CFLAGS +=3D -O3 > +CFLAGS +=3D -I$(SRCDIR) > CFLAGS +=3D $(WERROR_FLAGS) >=20 > # > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.= c > index f8d9cc7dc3b2..6bb63e5ec873 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -55,6 +55,8 @@ > #include > #include >=20 > +#include > + > /* Linux based path to the TUN device */ > #define TUN_TAP_DEV_PATH "/dev/net/tun" > #define DEFAULT_TAP_NAME "dtap" > @@ -87,40 +89,6 @@ static struct rte_eth_link pmd_link =3D { > .link_autoneg =3D ETH_LINK_SPEED_AUTONEG > }; >=20 > -struct pkt_stats { > - uint64_t opackets; /* Number of output packets */ > - uint64_t ipackets; /* Number of input packets */ > - uint64_t obytes; /* Number of bytes on output */ > - uint64_t ibytes; /* Number of bytes on input */ > - uint64_t errs; /* Number of error packets */ > -}; > - > -struct rx_queue { > - struct rte_mempool *mp; /* Mempool for RX packets */ > - uint32_t trigger_seen; /* Last seen Rx trigger value */ > - uint16_t in_port; /* Port ID */ > - int fd; > - > - struct pkt_stats stats; /* Stats for this RX queue */ > -}; > - > -struct tx_queue { > - int fd; > - struct pkt_stats stats; /* Stats for this TX queue */ > -}; > - > -struct pmd_internals { > - char name[RTE_ETH_NAME_MAX_LEN]; /* Internal Tap device name */ > - uint16_t nb_queues; /* Number of queues supported */ > - struct ether_addr eth_addr; /* Mac address of the device port */ > - > - int if_index; /* IF_INDEX for the port */ > - int ioctl_sock; /* socket for ioctl calls */ > - > - struct rx_queue rxq[RTE_PMD_TAP_MAX_QUEUES]; /* List of RX queues */ > - struct tx_queue txq[RTE_PMD_TAP_MAX_QUEUES]; /* List of TX queues */ > -}; > - > static void > tap_trigger_cb(int sig __rte_unused) > { > diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.= h > new file mode 100644 > index 000000000000..aafdef1faa99 > --- /dev/null > +++ b/drivers/net/tap/rte_eth_tap.h > @@ -0,0 +1,75 @@ > +/*- > + * BSD LICENSE > + * > + * Copyright 2017 6WIND S.A. > + * Copyright 2017 Mellanox. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyrig= ht > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * * Neither the name of 6WIND S.A. nor the names of its > + * contributors may be used to endorse or promote products derived > + * from this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS F= OR > + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGH= T > + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTA= L, > + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF US= E, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A= NY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE U= SE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE= . > + */ > + > +#ifndef _RTE_ETH_TAP_H_ > +#define _RTE_ETH_TAP_H_ > + > +#include > + > +#include > +#include Just noticed this new header does not have the C++ ifdefs. Create a new pat= ch to fix this problem, unless you need to update this patch series. Just s= tarting my review of this one, sorry was traveling last week. > + > +#define RTE_PMD_TAP_MAX_QUEUES 16 > + > +struct pkt_stats { > + uint64_t opackets; /* Number of output packets */ > + uint64_t ipackets; /* Number of input packets */ > + uint64_t obytes; /* Number of bytes on output */ > + uint64_t ibytes; /* Number of bytes on input */ > + uint64_t errs; /* Number of TX error packets */ > +}; > + > +struct rx_queue { > + struct rte_mempool *mp; /* Mempool for RX packets */ > + uint32_t trigger_seen; /* Last seen Rx trigger value */ > + uint16_t in_port; /* Port ID */ > + int fd; > + struct pkt_stats stats; /* Stats for this RX queue */ > +}; > + > +struct tx_queue { > + int fd; > + struct pkt_stats stats; /* Stats for this TX queue */ > +}; > + > +struct pmd_internals { > + char name[RTE_ETH_NAME_MAX_LEN]; /* Internal Tap device name */ > + uint16_t nb_queues; /* Number of queues supported */ > + struct ether_addr eth_addr; /* Mac address of the device port */ > + int if_index; /* IF_INDEX for the port */ > + int ioctl_sock; /* socket for ioctl calls */ > + struct rx_queue rxq[RTE_PMD_TAP_MAX_QUEUES]; /* List of RX queues */ > + struct tx_queue txq[RTE_PMD_TAP_MAX_QUEUES]; /* List of TX queues */ > +}; > + > +#endif /* _RTE_ETH_TAP_H_ */ > --=20 > 2.8.0.rc0 >=20 Regards, Keith