From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id AB6C32B88 for ; Wed, 22 Feb 2017 09:37:39 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id v77so5209146wmv.0 for ; Wed, 22 Feb 2017 00:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=xrD4vAlzwvuYnr2B0DWKQI6l7XRdm+CWa4+e87z8jTI=; b=IQl7VsxxzVFmTdKAUcWKnx5rXrgYx+iIIWFxwY99BFxu0pnQz8C/gSDXLxNMMWQAqP 1mvGO++sY1qTTtV3OHY401TVoHVeo9qzgqeXNlU+CCXSpWVy9Z0DmCBjyRZIvVeTtC62 KSN59QHsWCHlDR/AlR0ibQIiswaYRuGWwIq0zz7nnk3he34EVhQPsy0d0GcY8Q0zhn1F +Lm7MROdWVnxQnTmYW3zoiEZN2jHBX906VLoRg+KURhH+OcBr8fOs/yPNNgFozq3Pxlu l77Ts9VWHl1aNmX7tRQLtmZ+VGLIv3TWyTN467VxtndSeKV3Y41KJCM2I8gERvaXpoCi uFGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=xrD4vAlzwvuYnr2B0DWKQI6l7XRdm+CWa4+e87z8jTI=; b=K1OU/Csa0IVt7tCf4elFkv9ueAFUjl6L1xF4NzMi7PdphEANLSX+ehlBVdY3HFlnW2 E50eu7jawlgxaNWtKrpL8K0v8whFajgzVVKH/rIyYE6/J9xliCLYhwhnNYEiB4pX214c hSs4pS4EgR8UgsT7iFCI2WPsjspWvt12/eQLHzogL3hppGqD03w5ByVp1k4fxD/sc8Dk hbxfrB4lTjprLRN3XcBaE6cVUyq/wmdGR8Nk28dB4BQ6BQZcOBbjEEDWvpD4WrLh8EQx UwbRmxERESw/NkAB+JQtVYARXw/5hWAN28vXy7ReczQvH3vXY+LB1PS+HNl+YrWZbtXl Jv/A== X-Gm-Message-State: AMke39m+Kr5tebHk4ISbRznjRR6NlZeUrnt1R0JmhH3EdfHMeeQ+m0AD4ivrHh6kb9sG3W+Y X-Received: by 10.28.91.209 with SMTP id p200mr1237887wmb.18.1487752658658; Wed, 22 Feb 2017 00:37:38 -0800 (PST) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 191sm1112515wmo.21.2017.02.22.00.37.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Feb 2017 00:37:38 -0800 (PST) Date: Wed, 22 Feb 2017 09:37:30 +0100 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Vasily Philipov Cc: dev@dpdk.org, Adrien Mazarguil Message-ID: <20170222083730.GH23344@autoinstall.dev.6wind.com> References: <74798f347a5b1fad28037b713ad83048c227a2ca.1487685098.git.vasilyf@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <74798f347a5b1fad28037b713ad83048c227a2ca.1487685098.git.vasilyf@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 1/2] net/mlx4: split the definitions to the header file 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: Wed, 22 Feb 2017 08:37:39 -0000 On Tue, Feb 21, 2017 at 02:07:02PM +0000, Vasily Philipov wrote: > Make some structs/defines visible from different source files by placing > them into mlx4.h header. > > Signed-off-by: Vasily Philipov > --- > drivers/net/mlx4/mlx4.c | 183 ++-------------------------------------------- > drivers/net/mlx4/mlx4.h | 187 +++++++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 189 insertions(+), 181 deletions(-) > > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c > index 79efaaa..82ccac8 100644 > --- a/drivers/net/mlx4/mlx4.c > +++ b/drivers/net/mlx4/mlx4.c > @@ -1,8 +1,8 @@ > /*- > * BSD LICENSE > * > - * Copyright 2012-2015 6WIND S.A. > - * Copyright 2012 Mellanox. > + * Copyright 2012-2017 6WIND S.A. > + * Copyright 2012-2017 Mellanox. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -68,10 +68,6 @@ > #pragma GCC diagnostic error "-Wpedantic" > #endif > > -/* DPDK headers don't like -pedantic. */ > -#ifdef PEDANTIC > -#pragma GCC diagnostic ignored "-Wpedantic" > -#endif > #include > #include > #include > @@ -86,9 +82,6 @@ > #include > #include > #include > -#ifdef PEDANTIC > -#pragma GCC diagnostic error "-Wpedantic" > -#endif > > /* Generated configuration header. */ > #include "mlx4_autoconf.h" > @@ -96,21 +89,6 @@ > /* PMD header. */ > #include "mlx4.h" > > -/* Runtime logging through RTE_LOG() is enabled when not in debugging mode. > - * Intermediate LOG_*() macros add the required end-of-line characters. */ > -#ifndef NDEBUG > -#define INFO(...) DEBUG(__VA_ARGS__) > -#define WARN(...) DEBUG(__VA_ARGS__) > -#define ERROR(...) DEBUG(__VA_ARGS__) > -#else > -#define LOG__(level, m, ...) \ > - RTE_LOG(level, PMD, MLX4_DRIVER_NAME ": " m "%c", __VA_ARGS__) > -#define LOG_(level, ...) LOG__(level, __VA_ARGS__, '\n') > -#define INFO(...) LOG_(INFO, __VA_ARGS__) > -#define WARN(...) LOG_(WARNING, __VA_ARGS__) > -#define ERROR(...) LOG_(ERR, __VA_ARGS__) > -#endif > - > /* Convenience macros for accessing mbuf fields. */ > #define NEXT(m) ((m)->next) > #define DATA_LEN(m) ((m)->data_len) > @@ -137,157 +115,6 @@ > (((val) & (from)) / ((from) / (to))) : \ > (((val) & (from)) * ((to) / (from)))) > > -struct mlx4_rxq_stats { > - unsigned int idx; /**< Mapping index. */ > -#ifdef MLX4_PMD_SOFT_COUNTERS > - uint64_t ipackets; /**< Total of successfully received packets. */ > - uint64_t ibytes; /**< Total of successfully received bytes. */ > -#endif > - uint64_t idropped; /**< Total of packets dropped when RX ring full. */ > - uint64_t rx_nombuf; /**< Total of RX mbuf allocation failures. */ > -}; > - > -struct mlx4_txq_stats { > - unsigned int idx; /**< Mapping index. */ > -#ifdef MLX4_PMD_SOFT_COUNTERS > - uint64_t opackets; /**< Total of successfully sent packets. */ > - uint64_t obytes; /**< Total of successfully sent bytes. */ > -#endif > - uint64_t odropped; /**< Total of packets not sent when TX ring full. */ > -}; > - > -/* RX element (scattered packets). */ > -struct rxq_elt_sp { > - struct ibv_recv_wr wr; /* Work Request. */ > - struct ibv_sge sges[MLX4_PMD_SGE_WR_N]; /* Scatter/Gather Elements. */ > - struct rte_mbuf *bufs[MLX4_PMD_SGE_WR_N]; /* SGEs buffers. */ > -}; > - > -/* RX element. */ > -struct rxq_elt { > - struct ibv_recv_wr wr; /* Work Request. */ > - struct ibv_sge sge; /* Scatter/Gather Element. */ > - /* mbuf pointer is derived from WR_ID(wr.wr_id).offset. */ > -}; > - > -/* RX queue descriptor. */ > -struct rxq { > - struct priv *priv; /* Back pointer to private data. */ > - struct rte_mempool *mp; /* Memory Pool for allocations. */ > - struct ibv_mr *mr; /* Memory Region (for mp). */ > - struct ibv_cq *cq; /* Completion Queue. */ > - struct ibv_qp *qp; /* Queue Pair. */ > - struct ibv_exp_qp_burst_family *if_qp; /* QP burst interface. */ > - struct ibv_exp_cq_family *if_cq; /* CQ interface. */ > - /* > - * Each VLAN ID requires a separate flow steering rule. > - */ > - BITFIELD_DECLARE(mac_configured, uint32_t, MLX4_MAX_MAC_ADDRESSES); > - struct ibv_flow *mac_flow[MLX4_MAX_MAC_ADDRESSES][MLX4_MAX_VLAN_IDS]; > - struct ibv_flow *promisc_flow; /* Promiscuous flow. */ > - struct ibv_flow *allmulti_flow; /* Multicast flow. */ > - unsigned int port_id; /* Port ID for incoming packets. */ > - unsigned int elts_n; /* (*elts)[] length. */ > - unsigned int elts_head; /* Current index in (*elts)[]. */ > - union { > - struct rxq_elt_sp (*sp)[]; /* Scattered RX elements. */ > - struct rxq_elt (*no_sp)[]; /* RX elements. */ > - } elts; > - unsigned int sp:1; /* Use scattered RX elements. */ > - unsigned int csum:1; /* Enable checksum offloading. */ > - unsigned int csum_l2tun:1; /* Same for L2 tunnels. */ > - struct mlx4_rxq_stats stats; /* RX queue counters. */ > - unsigned int socket; /* CPU socket ID for allocations. */ > - struct ibv_exp_res_domain *rd; /* Resource Domain. */ > -}; > - > -/* TX element. */ > -struct txq_elt { > - struct rte_mbuf *buf; > -}; > - > -/* Linear buffer type. It is used when transmitting buffers with too many > - * segments that do not fit the hardware queue (see max_send_sge). > - * Extra segments are copied (linearized) in such buffers, replacing the > - * last SGE during TX. > - * The size is arbitrary but large enough to hold a jumbo frame with > - * 8 segments considering mbuf.buf_len is about 2048 bytes. */ > -typedef uint8_t linear_t[16384]; > - > -/* TX queue descriptor. */ > -struct txq { > - struct priv *priv; /* Back pointer to private data. */ > - struct { > - const struct rte_mempool *mp; /* Cached Memory Pool. */ > - struct ibv_mr *mr; /* Memory Region (for mp). */ > - uint32_t lkey; /* mr->lkey */ > - } mp2mr[MLX4_PMD_TX_MP_CACHE]; /* MP to MR translation table. */ > - struct ibv_cq *cq; /* Completion Queue. */ > - struct ibv_qp *qp; /* Queue Pair. */ > - struct ibv_exp_qp_burst_family *if_qp; /* QP burst interface. */ > - struct ibv_exp_cq_family *if_cq; /* CQ interface. */ > -#if MLX4_PMD_MAX_INLINE > 0 > - uint32_t max_inline; /* Max inline send size <= MLX4_PMD_MAX_INLINE. */ > -#endif > - unsigned int elts_n; /* (*elts)[] length. */ > - struct txq_elt (*elts)[]; /* TX elements. */ > - unsigned int elts_head; /* Current index in (*elts)[]. */ > - unsigned int elts_tail; /* First element awaiting completion. */ > - unsigned int elts_comp; /* Number of completion requests. */ > - unsigned int elts_comp_cd; /* Countdown for next completion request. */ > - unsigned int elts_comp_cd_init; /* Initial value for countdown. */ > - struct mlx4_txq_stats stats; /* TX queue counters. */ > - linear_t (*elts_linear)[]; /* Linearized buffers. */ > - struct ibv_mr *mr_linear; /* Memory Region for linearized buffers. */ > - unsigned int socket; /* CPU socket ID for allocations. */ > - struct ibv_exp_res_domain *rd; /* Resource Domain. */ > -}; > - > -struct priv { > - struct rte_eth_dev *dev; /* Ethernet device. */ > - struct ibv_context *ctx; /* Verbs context. */ > - struct ibv_device_attr device_attr; /* Device properties. */ > - struct ibv_pd *pd; /* Protection Domain. */ > - /* > - * MAC addresses array and configuration bit-field. > - * An extra entry that cannot be modified by the DPDK is reserved > - * for broadcast frames (destination MAC address ff:ff:ff:ff:ff:ff). > - */ > - struct ether_addr mac[MLX4_MAX_MAC_ADDRESSES]; > - BITFIELD_DECLARE(mac_configured, uint32_t, MLX4_MAX_MAC_ADDRESSES); > - /* VLAN filters. */ > - struct { > - unsigned int enabled:1; /* If enabled. */ > - unsigned int id:12; /* VLAN ID (0-4095). */ > - } vlan_filter[MLX4_MAX_VLAN_IDS]; /* VLAN filters table. */ > - /* Device properties. */ > - uint16_t mtu; /* Configured MTU. */ > - uint8_t port; /* Physical port number. */ > - unsigned int started:1; /* Device started, flows enabled. */ > - unsigned int promisc:1; /* Device in promiscuous mode. */ > - unsigned int allmulti:1; /* Device receives all multicast packets. */ > - unsigned int hw_qpg:1; /* QP groups are supported. */ > - unsigned int hw_tss:1; /* TSS is supported. */ > - unsigned int hw_rss:1; /* RSS is supported. */ > - unsigned int hw_csum:1; /* Checksum offload is supported. */ > - unsigned int hw_csum_l2tun:1; /* Same for L2 tunnels. */ > - unsigned int rss:1; /* RSS is enabled. */ > - unsigned int vf:1; /* This is a VF device. */ > - unsigned int pending_alarm:1; /* An alarm is pending. */ > -#ifdef INLINE_RECV > - unsigned int inl_recv_size; /* Inline recv size */ > -#endif > - unsigned int max_rss_tbl_sz; /* Maximum number of RSS queues. */ > - /* RX/TX queues. */ > - struct rxq rxq_parent; /* Parent queue when RSS is enabled. */ > - unsigned int rxqs_n; /* RX queues array size. */ > - unsigned int txqs_n; /* TX queues array size. */ > - struct rxq *(*rxqs)[]; /* RX queues. */ > - struct txq *(*txqs)[]; /* TX queues. */ > - struct rte_intr_handle intr_handle; /* Interrupt handler. */ > - rte_spinlock_t lock; /* Lock for control functions. */ > -}; > - > /* Local storage for secondary process data. */ > struct mlx4_secondary_data { > struct rte_eth_dev_data data; /* Local device data. */ > @@ -335,8 +162,7 @@ struct mlx4_secondary_data { > * @param priv > * Pointer to private structure. > */ > -static void > -priv_lock(struct priv *priv) > +void priv_lock(struct priv *priv) > { > rte_spinlock_lock(&priv->lock); > } > @@ -347,8 +173,7 @@ struct mlx4_secondary_data { > * @param priv > * Pointer to private structure. > */ > -static void > -priv_unlock(struct priv *priv) > +void priv_unlock(struct priv *priv) > { > rte_spinlock_unlock(&priv->lock); > } > diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h > index 4c7505e..70c9ecd 100644 > --- a/drivers/net/mlx4/mlx4.h > +++ b/drivers/net/mlx4/mlx4.h > @@ -1,8 +1,8 @@ > /*- > * BSD LICENSE > * > - * Copyright 2012-2015 6WIND S.A. > - * Copyright 2012 Mellanox. > + * Copyright 2012-2017 6WIND S.A. > + * Copyright 2012-2017 Mellanox. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -39,6 +39,33 @@ > #include > > /* > + * Runtime logging through RTE_LOG() is enabled when not in debugging mode. > + * Intermediate LOG_*() macros add the required end-of-line characters. > + */ > +#ifndef NDEBUG > +#define INFO(...) DEBUG(__VA_ARGS__) > +#define WARN(...) DEBUG(__VA_ARGS__) > +#define ERROR(...) DEBUG(__VA_ARGS__) > +#else > +#define LOG__(level, m, ...) \ > + RTE_LOG(level, PMD, MLX4_DRIVER_NAME ": " m "%c", __VA_ARGS__) > +#define LOG_(level, ...) LOG__(level, __VA_ARGS__, '\n') > +#define INFO(...) LOG_(INFO, __VA_ARGS__) > +#define WARN(...) LOG_(WARNING, __VA_ARGS__) > +#define ERROR(...) LOG_(ERR, __VA_ARGS__) > +#endif > + > +/* Verbs header. */ > +/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */ > +#ifdef PEDANTIC > +#pragma GCC diagnostic ignored "-Wpedantic" > +#endif > +#include > +#ifdef PEDANTIC > +#pragma GCC diagnostic error "-Wpedantic" > +#endif > + > +/* > * Maximum number of simultaneous MAC addresses supported. > * > * According to ConnectX's Programmer Reference Manual: > @@ -160,4 +187,160 @@ enum { > #define claim_positive(...) (__VA_ARGS__) > #endif /* NDEBUG */ > > +struct mlx4_rxq_stats { > + unsigned int idx; /**< Mapping index. */ > +#ifdef MLX4_PMD_SOFT_COUNTERS > + uint64_t ipackets; /**< Total of successfully received packets. */ > + uint64_t ibytes; /**< Total of successfully received bytes. */ > +#endif > + uint64_t idropped; /**< Total of packets dropped when RX ring full. */ > + uint64_t rx_nombuf; /**< Total of RX mbuf allocation failures. */ > +}; > + > +/* RX element (scattered packets). */ > +struct rxq_elt_sp { > + struct ibv_recv_wr wr; /* Work Request. */ > + struct ibv_sge sges[MLX4_PMD_SGE_WR_N]; /* Scatter/Gather Elements. */ > + struct rte_mbuf *bufs[MLX4_PMD_SGE_WR_N]; /* SGEs buffers. */ > +}; > + > +/* RX element. */ > +struct rxq_elt { > + struct ibv_recv_wr wr; /* Work Request. */ > + struct ibv_sge sge; /* Scatter/Gather Element. */ > + /* mbuf pointer is derived from WR_ID(wr.wr_id).offset. */ > +}; > + > +/* RX queue descriptor. */ > +struct rxq { > + struct priv *priv; /* Back pointer to private data. */ > + struct rte_mempool *mp; /* Memory Pool for allocations. */ > + struct ibv_mr *mr; /* Memory Region (for mp). */ > + struct ibv_cq *cq; /* Completion Queue. */ > + struct ibv_qp *qp; /* Queue Pair. */ > + struct ibv_exp_qp_burst_family *if_qp; /* QP burst interface. */ > + struct ibv_exp_cq_family *if_cq; /* CQ interface. */ > + /* > + * Each VLAN ID requires a separate flow steering rule. > + */ > + BITFIELD_DECLARE(mac_configured, uint32_t, MLX4_MAX_MAC_ADDRESSES); > + struct ibv_flow *mac_flow[MLX4_MAX_MAC_ADDRESSES][MLX4_MAX_VLAN_IDS]; > + struct ibv_flow *promisc_flow; /* Promiscuous flow. */ > + struct ibv_flow *allmulti_flow; /* Multicast flow. */ > + unsigned int port_id; /* Port ID for incoming packets. */ > + unsigned int elts_n; /* (*elts)[] length. */ > + unsigned int elts_head; /* Current index in (*elts)[]. */ > + union { > + struct rxq_elt_sp (*sp)[]; /* Scattered RX elements. */ > + struct rxq_elt (*no_sp)[]; /* RX elements. */ > + } elts; > + unsigned int sp:1; /* Use scattered RX elements. */ > + unsigned int csum:1; /* Enable checksum offloading. */ > + unsigned int csum_l2tun:1; /* Same for L2 tunnels. */ > + struct mlx4_rxq_stats stats; /* RX queue counters. */ > + unsigned int socket; /* CPU socket ID for allocations. */ > + struct ibv_exp_res_domain *rd; /* Resource Domain. */ > +}; > + > +/* TX element. */ > +struct txq_elt { > + struct rte_mbuf *buf; > +}; > + > +struct mlx4_txq_stats { > + unsigned int idx; /**< Mapping index. */ > +#ifdef MLX4_PMD_SOFT_COUNTERS > + uint64_t opackets; /**< Total of successfully sent packets. */ > + uint64_t obytes; /**< Total of successfully sent bytes. */ > +#endif > + uint64_t odropped; /**< Total of packets not sent when TX ring full. */ > +}; > + > +/* > + * Linear buffer type. It is used when transmitting buffers with too many > + * segments that do not fit the hardware queue (see max_send_sge). > + * Extra segments are copied (linearized) in such buffers, replacing the > + * last SGE during TX. > + * The size is arbitrary but large enough to hold a jumbo frame with > + * 8 segments considering mbuf.buf_len is about 2048 bytes. > + */ > +typedef uint8_t linear_t[16384]; > + > +/* TX queue descriptor. */ > +struct txq { > + struct priv *priv; /* Back pointer to private data. */ > + struct { > + const struct rte_mempool *mp; /* Cached Memory Pool. */ > + struct ibv_mr *mr; /* Memory Region (for mp). */ > + uint32_t lkey; /* mr->lkey */ > + } mp2mr[MLX4_PMD_TX_MP_CACHE]; /* MP to MR translation table. */ > + struct ibv_cq *cq; /* Completion Queue. */ > + struct ibv_qp *qp; /* Queue Pair. */ > + struct ibv_exp_qp_burst_family *if_qp; /* QP burst interface. */ > + struct ibv_exp_cq_family *if_cq; /* CQ interface. */ > +#if MLX4_PMD_MAX_INLINE > 0 > + uint32_t max_inline; /* Max inline send size <= MLX4_PMD_MAX_INLINE. */ > +#endif > + unsigned int elts_n; /* (*elts)[] length. */ > + struct txq_elt (*elts)[]; /* TX elements. */ > + unsigned int elts_head; /* Current index in (*elts)[]. */ > + unsigned int elts_tail; /* First element awaiting completion. */ > + unsigned int elts_comp; /* Number of completion requests. */ > + unsigned int elts_comp_cd; /* Countdown for next completion request. */ > + unsigned int elts_comp_cd_init; /* Initial value for countdown. */ > + struct mlx4_txq_stats stats; /* TX queue counters. */ > + linear_t (*elts_linear)[]; /* Linearized buffers. */ > + struct ibv_mr *mr_linear; /* Memory Region for linearized buffers. */ > + unsigned int socket; /* CPU socket ID for allocations. */ > + struct ibv_exp_res_domain *rd; /* Resource Domain. */ > +}; > + > +struct priv { > + struct rte_eth_dev *dev; /* Ethernet device. */ > + struct ibv_context *ctx; /* Verbs context. */ > + struct ibv_device_attr device_attr; /* Device properties. */ > + struct ibv_pd *pd; /* Protection Domain. */ > + /* > + * MAC addresses array and configuration bit-field. > + * An extra entry that cannot be modified by the DPDK is reserved > + * for broadcast frames (destination MAC address ff:ff:ff:ff:ff:ff). > + */ > + struct ether_addr mac[MLX4_MAX_MAC_ADDRESSES]; > + BITFIELD_DECLARE(mac_configured, uint32_t, MLX4_MAX_MAC_ADDRESSES); > + /* VLAN filters. */ > + struct { > + unsigned int enabled:1; /* If enabled. */ > + unsigned int id:12; /* VLAN ID (0-4095). */ > + } vlan_filter[MLX4_MAX_VLAN_IDS]; /* VLAN filters table. */ > + /* Device properties. */ > + uint16_t mtu; /* Configured MTU. */ > + uint8_t port; /* Physical port number. */ > + unsigned int started:1; /* Device started, flows enabled. */ > + unsigned int promisc:1; /* Device in promiscuous mode. */ > + unsigned int allmulti:1; /* Device receives all multicast packets. */ > + unsigned int hw_qpg:1; /* QP groups are supported. */ > + unsigned int hw_tss:1; /* TSS is supported. */ > + unsigned int hw_rss:1; /* RSS is supported. */ > + unsigned int hw_csum:1; /* Checksum offload is supported. */ > + unsigned int hw_csum_l2tun:1; /* Same for L2 tunnels. */ > + unsigned int rss:1; /* RSS is enabled. */ > + unsigned int vf:1; /* This is a VF device. */ > + unsigned int pending_alarm:1; /* An alarm is pending. */ > +#ifdef INLINE_RECV > + unsigned int inl_recv_size; /* Inline recv size */ > +#endif > + unsigned int max_rss_tbl_sz; /* Maximum number of RSS queues. */ > + /* RX/TX queues. */ > + struct rxq rxq_parent; /* Parent queue when RSS is enabled. */ > + unsigned int rxqs_n; /* RX queues array size. */ > + unsigned int txqs_n; /* TX queues array size. */ > + struct rxq *(*rxqs)[]; /* RX queues. */ > + struct txq *(*txqs)[]; /* TX queues. */ > + struct rte_intr_handle intr_handle; /* Interrupt handler. */ > + rte_spinlock_t lock; /* Lock for control functions. */ > +}; > + > +void priv_lock(struct priv *priv); > +void priv_unlock(struct priv *priv); > + > #endif /* RTE_PMD_MLX4_H_ */ > -- > 1.8.3.1 > Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND