Commit 293c4a7d authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

be2net: Fix TX queue create for Lancer

Lancer uses V1 version of TXQ create. This command needs interface
id for TX queue creation. Rearrange code such that tx queue create
is after interface create. As TXQ create is now called after MCC
ring create use MCC instead of MBOX.
Signed-off-by: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ca36f7d
...@@ -916,10 +916,14 @@ int be_cmd_txq_create(struct be_adapter *adapter, ...@@ -916,10 +916,14 @@ int be_cmd_txq_create(struct be_adapter *adapter,
void *ctxt; void *ctxt;
int status; int status;
if (mutex_lock_interruptible(&adapter->mbox_lock)) spin_lock_bh(&adapter->mcc_lock);
return -1;
wrb = wrb_from_mccq(adapter);
if (!wrb) {
status = -EBUSY;
goto err;
}
wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
ctxt = &req->context; ctxt = &req->context;
...@@ -945,14 +949,15 @@ int be_cmd_txq_create(struct be_adapter *adapter, ...@@ -945,14 +949,15 @@ int be_cmd_txq_create(struct be_adapter *adapter,
be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem); be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
status = be_mbox_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_eth_tx_create *resp = embedded_payload(wrb); struct be_cmd_resp_eth_tx_create *resp = embedded_payload(wrb);
txq->id = le16_to_cpu(resp->cid); txq->id = le16_to_cpu(resp->cid);
txq->created = true; txq->created = true;
} }
mutex_unlock(&adapter->mbox_lock); err:
spin_unlock_bh(&adapter->mcc_lock);
return status; return status;
} }
......
...@@ -1689,9 +1689,6 @@ static int be_tx_queues_create(struct be_adapter *adapter) ...@@ -1689,9 +1689,6 @@ static int be_tx_queues_create(struct be_adapter *adapter)
if (be_queue_alloc(adapter, q, TX_Q_LEN, if (be_queue_alloc(adapter, q, TX_Q_LEN,
sizeof(struct be_eth_wrb))) sizeof(struct be_eth_wrb)))
goto err; goto err;
if (be_cmd_txq_create(adapter, q, cq))
goto err;
} }
return 0; return 0;
...@@ -2572,8 +2569,9 @@ static int be_setup(struct be_adapter *adapter) ...@@ -2572,8 +2569,9 @@ static int be_setup(struct be_adapter *adapter)
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
u32 cap_flags, en_flags; u32 cap_flags, en_flags;
u32 tx_fc, rx_fc; u32 tx_fc, rx_fc;
int status; int status, i;
u8 mac[ETH_ALEN]; u8 mac[ETH_ALEN];
struct be_tx_obj *txo;
be_setup_init(adapter); be_setup_init(adapter);
...@@ -2613,6 +2611,12 @@ static int be_setup(struct be_adapter *adapter) ...@@ -2613,6 +2611,12 @@ static int be_setup(struct be_adapter *adapter)
if (status != 0) if (status != 0)
goto err; goto err;
for_all_tx_queues(adapter, txo, i) {
status = be_cmd_txq_create(adapter, &txo->q, &txo->cq);
if (status)
goto err;
}
/* For BEx, the VF's permanent mac queried from card is incorrect. /* For BEx, the VF's permanent mac queried from card is incorrect.
* Query the mac configued by the PF using if_handle * Query the mac configued by the PF using if_handle
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment