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/enic: fix max MTU calculation
[dpdk.git]
/
drivers
/
net
/
cxgbe
/
cxgbe_main.c
diff --git
a/drivers/net/cxgbe/cxgbe_main.c
b/drivers/net/cxgbe/cxgbe_main.c
index
a135df9
..
fd0707b
100644
(file)
--- a/
drivers/net/cxgbe/cxgbe_main.c
+++ b/
drivers/net/cxgbe/cxgbe_main.c
@@
-33,9
+33,9
@@
#include <rte_dev.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
#include <rte_kvargs.h>
-#include "common.h"
-#include "t4_regs.h"
-#include "t4_msg.h"
+#include "
base/
common.h"
+#include "
base/
t4_regs.h"
+#include "
base/
t4_msg.h"
#include "cxgbe.h"
#include "clip_tbl.h"
#include "l2t.h"
#include "cxgbe.h"
#include "clip_tbl.h"
#include "l2t.h"
@@
-122,6
+122,7
@@
int setup_sge_ctrl_txq(struct adapter *adapter)
int err = 0, i = 0;
for_each_port(adapter, i) {
int err = 0, i = 0;
for_each_port(adapter, i) {
+ struct port_info *pi = adap2pinfo(adapter, i);
char name[RTE_ETH_NAME_MAX_LEN];
struct sge_ctrl_txq *q = &s->ctrlq[i];
char name[RTE_ETH_NAME_MAX_LEN];
struct sge_ctrl_txq *q = &s->ctrlq[i];
@@
-135,16
+136,19
@@
int setup_sge_ctrl_txq(struct adapter *adapter)
err);
goto out;
}
err);
goto out;
}
- snprintf(name, sizeof(name), "cxgbe_ctrl_pool_%d", i);
+ snprintf(name, sizeof(name), "%s_ctrl_pool_%d",
+ pi->eth_dev->device->driver->name,
+ pi->eth_dev->data->port_id);
q->mb_pool = rte_pktmbuf_pool_create(name, s->ctrlq[i].q.size,
RTE_CACHE_LINE_SIZE,
RTE_MBUF_PRIV_ALIGN,
RTE_MBUF_DEFAULT_BUF_SIZE,
SOCKET_ID_ANY);
if (!q->mb_pool) {
q->mb_pool = rte_pktmbuf_pool_create(name, s->ctrlq[i].q.size,
RTE_CACHE_LINE_SIZE,
RTE_MBUF_PRIV_ALIGN,
RTE_MBUF_DEFAULT_BUF_SIZE,
SOCKET_ID_ANY);
if (!q->mb_pool) {
- dev_err(adapter, "Can't create ctrl pool for port: %d",
- i);
- err = -ENOMEM;
+ err = -rte_errno;
+ dev_err(adapter,
+ "Can't create ctrl pool for port %d. Err: %d\n",
+ pi->eth_dev->data->port_id, err);
goto out;
}
}
goto out;
}
}
@@
-157,18
+161,18
@@
out:
/**
* cxgbe_poll_for_completion: Poll rxq for completion
* @q: rxq to poll
/**
* cxgbe_poll_for_completion: Poll rxq for completion
* @q: rxq to poll
- * @
us: micro
seconds to delay
+ * @
ms: milli
seconds to delay
* @cnt: number of times to poll
* @c: completion to check for 'done' status
*
* Polls the rxq for reples until completion is done or the count
* expires.
*/
* @cnt: number of times to poll
* @c: completion to check for 'done' status
*
* Polls the rxq for reples until completion is done or the count
* expires.
*/
-int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int
u
s,
+int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int
m
s,
unsigned int cnt, struct t4_completion *c)
{
unsigned int i;
unsigned int cnt, struct t4_completion *c)
{
unsigned int i;
- unsigned int work_done, budget =
4
;
+ unsigned int work_done, budget =
32
;
if (!c)
return -EINVAL;
if (!c)
return -EINVAL;
@@
-181,7
+185,7
@@
int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int us,
return 0;
}
t4_os_unlock(&c->lock);
return 0;
}
t4_os_unlock(&c->lock);
-
udelay(u
s);
+
rte_delay_ms(m
s);
}
return -ETIMEDOUT;
}
}
return -ETIMEDOUT;
}
@@
-411,7
+415,7
@@
static int tid_init(struct tid_info *t)
return -ENOMEM;
t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids];
return -ENOMEM;
t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids];
- t->ftid_tab = (struct filter_entry *)&t->tid_tab[t->natids];
+ t->ftid_tab = (struct filter_entry *)&t->
a
tid_tab[t->natids];
t->ftid_bmap_array = t4_os_alloc(ftid_bmap_size);
if (!t->ftid_bmap_array) {
tid_free(t);
t->ftid_bmap_array = t4_os_alloc(ftid_bmap_size);
if (!t->ftid_bmap_array) {
tid_free(t);
@@
-1339,18
+1343,22
@@
inline bool force_linkup(struct adapter *adap)
int link_start(struct port_info *pi)
{
struct adapter *adapter = pi->adapter;
int link_start(struct port_info *pi)
{
struct adapter *adapter = pi->adapter;
-
int ret
;
+
u64 conf_offloads
;
unsigned int mtu;
unsigned int mtu;
+ int ret;
mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
(ETHER_HDR_LEN + ETHER_CRC_LEN);
mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
(ETHER_HDR_LEN + ETHER_CRC_LEN);
+ conf_offloads = pi->eth_dev->data->dev_conf.rxmode.offloads;
+
/*
* We do not set address filters and promiscuity here, the stack does
* that step explicitly.
*/
/*
* We do not set address filters and promiscuity here, the stack does
* that step explicitly.
*/
- ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, mtu, -1, -1,
- -1, 1, true);
+ ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, mtu, -1, -1, -1,
+ !!(conf_offloads & DEV_RX_OFFLOAD_VLAN_STRIP),
+ true);
if (ret == 0) {
ret = cxgbe_mpstcam_modify(pi, (int)pi->xact_addr_filt,
(u8 *)&pi->eth_dev->data->mac_addrs[0]);
if (ret == 0) {
ret = cxgbe_mpstcam_modify(pi, (int)pi->xact_addr_filt,
(u8 *)&pi->eth_dev->data->mac_addrs[0]);
@@
-1710,12
+1718,7
@@
void cxgbe_close(struct adapter *adapter)
if (pi->viid != 0)
t4_free_vi(adapter, adapter->mbox,
adapter->pf, 0, pi->viid);
if (pi->viid != 0)
t4_free_vi(adapter, adapter->mbox,
adapter->pf, 0, pi->viid);
- rte_free(pi->eth_dev->data->mac_addrs);
- /* Skip first port since it'll be freed by DPDK stack */
- if (i) {
- rte_free(pi->eth_dev->data->dev_private);
- rte_eth_dev_release_port(pi->eth_dev);
- }
+ rte_eth_dev_release_port(pi->eth_dev);
}
adapter->flags &= ~FULL_INIT_DONE;
}
}
adapter->flags &= ~FULL_INIT_DONE;
}
@@
-1918,14
+1921,7
@@
out_free:
if (pi->viid != 0)
t4_free_vi(adapter, adapter->mbox, adapter->pf,
0, pi->viid);
if (pi->viid != 0)
t4_free_vi(adapter, adapter->mbox, adapter->pf,
0, pi->viid);
- /* Skip first port since it'll be de-allocated by DPDK */
- if (i == 0)
- continue;
- if (pi->eth_dev) {
- if (pi->eth_dev->data->dev_private)
- rte_free(pi->eth_dev->data->dev_private);
- rte_eth_dev_release_port(pi->eth_dev);
- }
+ rte_eth_dev_release_port(pi->eth_dev);
}
if (adapter->flags & FW_OK)
}
if (adapter->flags & FW_OK)