git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: add rte prefix to ether defines
[dpdk.git]
/
drivers
/
net
/
octeontx
/
octeontx_ethdev.c
diff --git
a/drivers/net/octeontx/octeontx_ethdev.c
b/drivers/net/octeontx/octeontx_ethdev.c
index
0681486
..
1b85339
100644
(file)
--- a/
drivers/net/octeontx/octeontx_ethdev.c
+++ b/
drivers/net/octeontx/octeontx_ethdev.c
@@
-142,7
+142,8
@@
octeontx_port_open(struct octeontx_nic *nic)
nic->mcast_mode = bgx_port_conf.mcast_mode;
nic->speed = bgx_port_conf.mode;
nic->mcast_mode = bgx_port_conf.mcast_mode;
nic->speed = bgx_port_conf.mode;
- memcpy(&nic->mac_addr[0], &bgx_port_conf.macaddr[0], ETHER_ADDR_LEN);
+ memcpy(&nic->mac_addr[0], &bgx_port_conf.macaddr[0],
+ RTE_ETHER_ADDR_LEN);
octeontx_log_dbg("port opened %d", nic->port_id);
return res;
octeontx_log_dbg("port opened %d", nic->port_id);
return res;
@@
-555,7
+556,7
@@
octeontx_dev_stats_reset(struct rte_eth_dev *dev)
static int
octeontx_dev_default_mac_addr_set(struct rte_eth_dev *dev,
static int
octeontx_dev_default_mac_addr_set(struct rte_eth_dev *dev,
- struct ether_addr *addr)
+ struct
rte_
ether_addr *addr)
{
struct octeontx_nic *nic = octeontx_pmd_priv(dev);
int ret;
{
struct octeontx_nic *nic = octeontx_pmd_priv(dev);
int ret;
@@
-844,10
+845,11
@@
octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
pktbuf_conf.mmask.f_cache_mode = 1;
pktbuf_conf.wqe_skip = OCTTX_PACKET_WQE_SKIP;
pktbuf_conf.mmask.f_cache_mode = 1;
pktbuf_conf.wqe_skip = OCTTX_PACKET_WQE_SKIP;
- pktbuf_conf.first_skip = OCTTX_PACKET_FIRST_SKIP;
+ pktbuf_conf.first_skip = OCTTX_PACKET_FIRST_SKIP
(mb_pool)
;
pktbuf_conf.later_skip = OCTTX_PACKET_LATER_SKIP;
pktbuf_conf.mbuff_size = (mb_pool->elt_size -
RTE_PKTMBUF_HEADROOM -
pktbuf_conf.later_skip = OCTTX_PACKET_LATER_SKIP;
pktbuf_conf.mbuff_size = (mb_pool->elt_size -
RTE_PKTMBUF_HEADROOM -
+ rte_pktmbuf_priv_size(mb_pool) -
sizeof(struct rte_mbuf));
pktbuf_conf.cache_mode = PKI_OPC_MODE_STF2_STT;
sizeof(struct rte_mbuf));
pktbuf_conf.cache_mode = PKI_OPC_MODE_STF2_STT;
@@
-1063,7
+1065,7
@@
octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
data->all_multicast = 0;
data->scattered_rx = 0;
data->all_multicast = 0;
data->scattered_rx = 0;
- data->mac_addrs = rte_zmalloc_socket(octtx_name, ETHER_ADDR_LEN, 0,
+ data->mac_addrs = rte_zmalloc_socket(octtx_name,
RTE_
ETHER_ADDR_LEN, 0,
socket_id);
if (data->mac_addrs == NULL) {
octeontx_log_err("failed to allocate memory for mac_addrs");
socket_id);
if (data->mac_addrs == NULL) {
octeontx_log_err("failed to allocate memory for mac_addrs");
@@
-1084,7
+1086,7
@@
octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
}
/* Update port_id mac to eth_dev */
}
/* Update port_id mac to eth_dev */
- memcpy(data->mac_addrs, nic->mac_addr, ETHER_ADDR_LEN);
+ memcpy(data->mac_addrs, nic->mac_addr,
RTE_
ETHER_ADDR_LEN);
PMD_INIT_LOG(DEBUG, "ethdev info: ");
PMD_INIT_LOG(DEBUG, "port %d, port_ena %d ochan %d num_ochan %d tx_q %d",
PMD_INIT_LOG(DEBUG, "ethdev info: ");
PMD_INIT_LOG(DEBUG, "port %d, port_ena %d ochan %d num_ochan %d tx_q %d",
@@
-1237,15
+1239,8
@@
octeontx_probe(struct rte_vdev_device *dev)
res = -EINVAL;
goto parse_error;
}
res = -EINVAL;
goto parse_error;
}
- if (pnum > qnum) {
- /*
- * We don't poll on event ports
- * that do not have any queues assigned.
- */
- pnum = qnum;
- PMD_INIT_LOG(INFO,
- "reducing number of active event ports to %d", pnum);
- }
+
+ /* Enable all queues available */
for (i = 0; i < qnum; i++) {
res = rte_event_queue_setup(evdev, i, NULL);
if (res < 0) {
for (i = 0; i < qnum; i++) {
res = rte_event_queue_setup(evdev, i, NULL);
if (res < 0) {
@@
-1255,6
+1250,7
@@
octeontx_probe(struct rte_vdev_device *dev)
}
}
}
}
+ /* Enable all ports available */
for (i = 0; i < pnum; i++) {
res = rte_event_port_setup(evdev, i, NULL);
if (res < 0) {
for (i = 0; i < pnum; i++) {
res = rte_event_port_setup(evdev, i, NULL);
if (res < 0) {
@@
-1263,6
+1259,14
@@
octeontx_probe(struct rte_vdev_device *dev)
i, res);
goto parse_error;
}
i, res);
goto parse_error;
}
+ }
+
+ /*
+ * Do 1:1 links for ports & queues. All queues would be mapped to
+ * one port. If there are more ports than queues, then some ports
+ * won't be linked to any queue.
+ */
+ for (i = 0; i < qnum; i++) {
/* Link one queue to one event port */
qlist = i;
res = rte_event_port_link(evdev, i, &qlist, NULL, 1);
/* Link one queue to one event port */
qlist = i;
res = rte_event_port_link(evdev, i, &qlist, NULL, 1);