aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2017-11-15 12:52:42 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-11-16 18:45:22 +0300
commit5329e5211c447b9b823149baf76112eedfeb07fb (patch)
tree5039b1928dbcab5cddb21e39ad667349f01248c6
parentce058b8fdde37cc302bcf589f458dab7b8d3e365 (diff)
downloadodp-5329e5211c447b9b823149baf76112eedfeb07fb.tar.gz
linux-gen: pktio: add pktio capability to pktio_entry_t
Since odp_pktio_capability_t is common for all pktio implementations move it inside pktio_entry_t. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--platform/linux-generic/include/odp_packet_dpdk.h1
-rw-r--r--platform/linux-generic/include/odp_packet_io_internal.h1
-rw-r--r--platform/linux-generic/include/odp_packet_netmap.h1
-rw-r--r--platform/linux-generic/pktio/dpdk.c4
-rw-r--r--platform/linux-generic/pktio/netmap.c12
5 files changed, 9 insertions, 10 deletions
diff --git a/platform/linux-generic/include/odp_packet_dpdk.h b/platform/linux-generic/include/odp_packet_dpdk.h
index 7f0e285..05f00ad 100644
--- a/platform/linux-generic/include/odp_packet_dpdk.h
+++ b/platform/linux-generic/include/odp_packet_dpdk.h
@@ -60,7 +60,6 @@ typedef struct {
uint8_t lockless_tx; /**< no locking for tx */
uint8_t port_id; /**< DPDK port identifier */
/* --- 34 bytes --- */
- odp_pktio_capability_t capa; /**< interface capabilities */
odp_ticketlock_t rx_lock[PKTIO_MAX_QUEUES]; /**< RX queue locks */
odp_ticketlock_t tx_lock[PKTIO_MAX_QUEUES]; /**< TX queue locks */
/** cache for storing extra RX packets */
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index 1a4e345..83c449e 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -159,6 +159,7 @@ struct pktio_entry {
odp_pool_t pool;
odp_pktio_param_t param;
+ odp_pktio_capability_t capa; /**< Packet IO capabilities */
/* Storage for queue handles
* Multi-queue support is pktio driver specific */
diff --git a/platform/linux-generic/include/odp_packet_netmap.h b/platform/linux-generic/include/odp_packet_netmap.h
index a6f68d5..876c7e4 100644
--- a/platform/linux-generic/include/odp_packet_netmap.h
+++ b/platform/linux-generic/include/odp_packet_netmap.h
@@ -52,7 +52,6 @@ typedef struct {
char nm_name[IF_NAMESIZE + 7]; /**< netmap:<ifname> */
char if_name[IF_NAMESIZE]; /**< interface name used in ioctl */
odp_bool_t is_virtual; /**< nm virtual port (VALE/pipe) */
- odp_pktio_capability_t capa; /**< interface capabilities */
uint32_t num_rx_rings; /**< number of nm rx rings */
uint32_t num_tx_rings; /**< number of nm tx rings */
unsigned num_rx_desc_rings; /**< number of rx descriptor rings */
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c
index e9f7125..07671e6 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -1122,7 +1122,7 @@ static void dpdk_init_capability(pktio_entry_t *pktio_entry,
struct rte_eth_dev_info *dev_info)
{
pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk;
- odp_pktio_capability_t *capa = &pkt_dpdk->capa;
+ odp_pktio_capability_t *capa = &pktio_entry->s.capa;
int ptype_cnt;
int ptype_l3_ipv4 = 0;
int ptype_l4_tcp = 0;
@@ -1545,7 +1545,7 @@ static int dpdk_promisc_mode_get(pktio_entry_t *pktio_entry)
static int dpdk_capability(pktio_entry_t *pktio_entry,
odp_pktio_capability_t *capa)
{
- *capa = pktio_entry->s.pkt_dpdk.capa;
+ *capa = pktio_entry->s.capa;
return 0;
}
diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c
index 297d54d..cbcf778 100644
--- a/platform/linux-generic/pktio/netmap.c
+++ b/platform/linux-generic/pktio/netmap.c
@@ -267,9 +267,9 @@ static inline int netmap_wait_for_link(pktio_entry_t *pktio_entry)
static void netmap_init_capability(pktio_entry_t *pktio_entry)
{
pkt_netmap_t *pkt_nm = &pktio_entry->s.pkt_nm;
- odp_pktio_capability_t *capa = &pkt_nm->capa;
+ odp_pktio_capability_t *capa = &pktio_entry->s.capa;
- memset(&pkt_nm->capa, 0, sizeof(odp_pktio_capability_t));
+ memset(capa, 0, sizeof(odp_pktio_capability_t));
capa->max_input_queues = PKTIO_MAX_QUEUES;
if (pkt_nm->num_rx_rings < PKTIO_MAX_QUEUES)
@@ -395,8 +395,8 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, pktio_entry_t *pktio_entry,
ODP_DBG("Unable to fetch thread ID. VALE port MAC "
"addresses may not be unique.\n");
- pkt_nm->capa.max_input_queues = 1;
- pkt_nm->capa.set_op.op.promisc_mode = 0;
+ pktio_entry->s.capa.max_input_queues = 1;
+ pktio_entry->s.capa.set_op.op.promisc_mode = 0;
pkt_nm->mtu = buf_size;
pktio_entry->s.stats_type = STATS_UNSUPPORTED;
/* Set MAC address for virtual interface */
@@ -430,7 +430,7 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, pktio_entry_t *pktio_entry,
/* Check if RSS is supported. If not, set 'max_input_queues' to 1. */
if (rss_conf_get_supported_fd(sockfd, netdev, &hash_proto) == 0) {
ODP_DBG("RSS not supported\n");
- pkt_nm->capa.max_input_queues = 1;
+ pktio_entry->s.capa.max_input_queues = 1;
}
err = netmap_do_ioctl(pktio_entry, SIOCGIFFLAGS, 0);
@@ -897,7 +897,7 @@ static int netmap_promisc_mode_get(pktio_entry_t *pktio_entry)
static int netmap_capability(pktio_entry_t *pktio_entry,
odp_pktio_capability_t *capa)
{
- *capa = pktio_entry->s.pkt_nm.capa;
+ *capa = pktio_entry->s.capa;
return 0;
}