|
@@ -2583,7 +2583,48 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp, u32 frags_needed)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-static struct be_tx_compl_info *be_tx_compl_get(struct be_tx_obj *txo)
|
|
|
|
|
|
+static inline void be_update_tx_err(struct be_tx_obj *txo, u8 status)
|
|
|
|
+{
|
|
|
|
+ switch (status) {
|
|
|
|
+ case BE_TX_COMP_HDR_PARSE_ERR:
|
|
|
|
+ tx_stats(txo)->tx_hdr_parse_err++;
|
|
|
|
+ break;
|
|
|
|
+ case BE_TX_COMP_NDMA_ERR:
|
|
|
|
+ tx_stats(txo)->tx_dma_err++;
|
|
|
|
+ break;
|
|
|
|
+ case BE_TX_COMP_ACL_ERR:
|
|
|
|
+ tx_stats(txo)->tx_spoof_check_err++;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void lancer_update_tx_err(struct be_tx_obj *txo, u8 status)
|
|
|
|
+{
|
|
|
|
+ switch (status) {
|
|
|
|
+ case LANCER_TX_COMP_LSO_ERR:
|
|
|
|
+ tx_stats(txo)->tx_tso_err++;
|
|
|
|
+ break;
|
|
|
|
+ case LANCER_TX_COMP_HSW_DROP_MAC_ERR:
|
|
|
|
+ case LANCER_TX_COMP_HSW_DROP_VLAN_ERR:
|
|
|
|
+ tx_stats(txo)->tx_spoof_check_err++;
|
|
|
|
+ break;
|
|
|
|
+ case LANCER_TX_COMP_QINQ_ERR:
|
|
|
|
+ tx_stats(txo)->tx_qinq_err++;
|
|
|
|
+ break;
|
|
|
|
+ case LANCER_TX_COMP_PARITY_ERR:
|
|
|
|
+ tx_stats(txo)->tx_internal_parity_err++;
|
|
|
|
+ break;
|
|
|
|
+ case LANCER_TX_COMP_DMA_ERR:
|
|
|
|
+ tx_stats(txo)->tx_dma_err++;
|
|
|
|
+ break;
|
|
|
|
+ case LANCER_TX_COMP_SGE_ERR:
|
|
|
|
+ tx_stats(txo)->tx_sge_err++;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static struct be_tx_compl_info *be_tx_compl_get(struct be_adapter *adapter,
|
|
|
|
+ struct be_tx_obj *txo)
|
|
{
|
|
{
|
|
struct be_queue_info *tx_cq = &txo->cq;
|
|
struct be_queue_info *tx_cq = &txo->cq;
|
|
struct be_tx_compl_info *txcp = &txo->txcp;
|
|
struct be_tx_compl_info *txcp = &txo->txcp;
|
|
@@ -2599,6 +2640,24 @@ static struct be_tx_compl_info *be_tx_compl_get(struct be_tx_obj *txo)
|
|
txcp->status = GET_TX_COMPL_BITS(status, compl);
|
|
txcp->status = GET_TX_COMPL_BITS(status, compl);
|
|
txcp->end_index = GET_TX_COMPL_BITS(wrb_index, compl);
|
|
txcp->end_index = GET_TX_COMPL_BITS(wrb_index, compl);
|
|
|
|
|
|
|
|
+ if (txcp->status) {
|
|
|
|
+ if (lancer_chip(adapter)) {
|
|
|
|
+ lancer_update_tx_err(txo, txcp->status);
|
|
|
|
+ /* Reset the adapter incase of TSO,
|
|
|
|
+ * SGE or Parity error
|
|
|
|
+ */
|
|
|
|
+ if (txcp->status == LANCER_TX_COMP_LSO_ERR ||
|
|
|
|
+ txcp->status == LANCER_TX_COMP_PARITY_ERR ||
|
|
|
|
+ txcp->status == LANCER_TX_COMP_SGE_ERR)
|
|
|
|
+ be_set_error(adapter, BE_ERROR_TX);
|
|
|
|
+ } else {
|
|
|
|
+ be_update_tx_err(txo, txcp->status);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (be_check_error(adapter, BE_ERROR_TX))
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
compl->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] = 0;
|
|
compl->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] = 0;
|
|
queue_tail_inc(tx_cq);
|
|
queue_tail_inc(tx_cq);
|
|
return txcp;
|
|
return txcp;
|
|
@@ -2741,7 +2800,7 @@ static void be_tx_compl_clean(struct be_adapter *adapter)
|
|
cmpl = 0;
|
|
cmpl = 0;
|
|
num_wrbs = 0;
|
|
num_wrbs = 0;
|
|
txq = &txo->q;
|
|
txq = &txo->q;
|
|
- while ((txcp = be_tx_compl_get(txo))) {
|
|
|
|
|
|
+ while ((txcp = be_tx_compl_get(adapter, txo))) {
|
|
num_wrbs +=
|
|
num_wrbs +=
|
|
be_tx_compl_process(adapter, txo,
|
|
be_tx_compl_process(adapter, txo,
|
|
txcp->end_index);
|
|
txcp->end_index);
|
|
@@ -3120,42 +3179,6 @@ loop_continue:
|
|
return work_done;
|
|
return work_done;
|
|
}
|
|
}
|
|
|
|
|
|
-static inline void be_update_tx_err(struct be_tx_obj *txo, u8 status)
|
|
|
|
-{
|
|
|
|
- switch (status) {
|
|
|
|
- case BE_TX_COMP_HDR_PARSE_ERR:
|
|
|
|
- tx_stats(txo)->tx_hdr_parse_err++;
|
|
|
|
- break;
|
|
|
|
- case BE_TX_COMP_NDMA_ERR:
|
|
|
|
- tx_stats(txo)->tx_dma_err++;
|
|
|
|
- break;
|
|
|
|
- case BE_TX_COMP_ACL_ERR:
|
|
|
|
- tx_stats(txo)->tx_spoof_check_err++;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static inline void lancer_update_tx_err(struct be_tx_obj *txo, u8 status)
|
|
|
|
-{
|
|
|
|
- switch (status) {
|
|
|
|
- case LANCER_TX_COMP_LSO_ERR:
|
|
|
|
- tx_stats(txo)->tx_tso_err++;
|
|
|
|
- break;
|
|
|
|
- case LANCER_TX_COMP_HSW_DROP_MAC_ERR:
|
|
|
|
- case LANCER_TX_COMP_HSW_DROP_VLAN_ERR:
|
|
|
|
- tx_stats(txo)->tx_spoof_check_err++;
|
|
|
|
- break;
|
|
|
|
- case LANCER_TX_COMP_QINQ_ERR:
|
|
|
|
- tx_stats(txo)->tx_qinq_err++;
|
|
|
|
- break;
|
|
|
|
- case LANCER_TX_COMP_PARITY_ERR:
|
|
|
|
- tx_stats(txo)->tx_internal_parity_err++;
|
|
|
|
- break;
|
|
|
|
- case LANCER_TX_COMP_DMA_ERR:
|
|
|
|
- tx_stats(txo)->tx_dma_err++;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
|
|
static void be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
|
|
static void be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
|
|
int idx)
|
|
int idx)
|
|
@@ -3163,16 +3186,9 @@ static void be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
|
|
int num_wrbs = 0, work_done = 0;
|
|
int num_wrbs = 0, work_done = 0;
|
|
struct be_tx_compl_info *txcp;
|
|
struct be_tx_compl_info *txcp;
|
|
|
|
|
|
- while ((txcp = be_tx_compl_get(txo))) {
|
|
|
|
|
|
+ while ((txcp = be_tx_compl_get(adapter, txo))) {
|
|
num_wrbs += be_tx_compl_process(adapter, txo, txcp->end_index);
|
|
num_wrbs += be_tx_compl_process(adapter, txo, txcp->end_index);
|
|
work_done++;
|
|
work_done++;
|
|
-
|
|
|
|
- if (txcp->status) {
|
|
|
|
- if (lancer_chip(adapter))
|
|
|
|
- lancer_update_tx_err(txo, txcp->status);
|
|
|
|
- else
|
|
|
|
- be_update_tx_err(txo, txcp->status);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (work_done) {
|
|
if (work_done) {
|
|
@@ -5104,9 +5120,12 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
|
|
features &= ~NETIF_F_TSO6;
|
|
features &= ~NETIF_F_TSO6;
|
|
|
|
|
|
/* Lancer cannot handle the packet with MSS less than 256.
|
|
/* Lancer cannot handle the packet with MSS less than 256.
|
|
|
|
+ * Also it can't handle a TSO packet with a single segment
|
|
* Disable the GSO support in such cases
|
|
* Disable the GSO support in such cases
|
|
*/
|
|
*/
|
|
- if (lancer_chip(adapter) && skb_shinfo(skb)->gso_size < 256)
|
|
|
|
|
|
+ if (lancer_chip(adapter) &&
|
|
|
|
+ (skb_shinfo(skb)->gso_size < 256 ||
|
|
|
|
+ skb_shinfo(skb)->gso_segs == 1))
|
|
features &= ~NETIF_F_GSO_MASK;
|
|
features &= ~NETIF_F_GSO_MASK;
|
|
}
|
|
}
|
|
|
|
|