aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSritej Velaga <sritej.velaga@qlogic.com>2013-04-18 15:49:52 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-19 17:53:56 -0400
commitae721f3ab0d9234219edbc7858cf9c5ceda42df2 (patch)
tree4c102e3b0e2c3512515fe5c9164e140d92291e22 /drivers/net
parentb79d4a8dfd1b3a8387788b070ac2f856fb3a0877 (diff)
qlge: Fix receive path to drop error frames
o Fix the driver to drop error frames in the receive path o Update error counter which was not getting incremented Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com> Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/qlogic/qlge/qlge_main.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index b13ab544a7eb..8033555e53c2 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -1434,11 +1434,13 @@ map_error:
1434} 1434}
1435 1435
1436/* Categorizing receive firmware frame errors */ 1436/* Categorizing receive firmware frame errors */
1437static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err) 1437static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err,
1438 struct rx_ring *rx_ring)
1438{ 1439{
1439 struct nic_stats *stats = &qdev->nic_stats; 1440 struct nic_stats *stats = &qdev->nic_stats;
1440 1441
1441 stats->rx_err_count++; 1442 stats->rx_err_count++;
1443 rx_ring->rx_errors++;
1442 1444
1443 switch (rx_err & IB_MAC_IOCB_RSP_ERR_MASK) { 1445 switch (rx_err & IB_MAC_IOCB_RSP_ERR_MASK) {
1444 case IB_MAC_IOCB_RSP_ERR_CODE_ERR: 1446 case IB_MAC_IOCB_RSP_ERR_CODE_ERR:
@@ -1474,6 +1476,12 @@ static void ql_process_mac_rx_gro_page(struct ql_adapter *qdev,
1474 struct bq_desc *lbq_desc = ql_get_curr_lchunk(qdev, rx_ring); 1476 struct bq_desc *lbq_desc = ql_get_curr_lchunk(qdev, rx_ring);
1475 struct napi_struct *napi = &rx_ring->napi; 1477 struct napi_struct *napi = &rx_ring->napi;
1476 1478
1479 /* Frame error, so drop the packet. */
1480 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1481 ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1482 put_page(lbq_desc->p.pg_chunk.page);
1483 return;
1484 }
1477 napi->dev = qdev->ndev; 1485 napi->dev = qdev->ndev;
1478 1486
1479 skb = napi_get_frags(napi); 1487 skb = napi_get_frags(napi);
@@ -1529,6 +1537,12 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev,
1529 addr = lbq_desc->p.pg_chunk.va; 1537 addr = lbq_desc->p.pg_chunk.va;
1530 prefetch(addr); 1538 prefetch(addr);
1531 1539
1540 /* Frame error, so drop the packet. */
1541 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1542 ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1543 goto err_out;
1544 }
1545
1532 /* The max framesize filter on this chip is set higher than 1546 /* The max framesize filter on this chip is set higher than
1533 * MTU since FCoE uses 2k frames. 1547 * MTU since FCoE uses 2k frames.
1534 */ 1548 */
@@ -1614,6 +1628,13 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev,
1614 memcpy(skb_put(new_skb, length), skb->data, length); 1628 memcpy(skb_put(new_skb, length), skb->data, length);
1615 skb = new_skb; 1629 skb = new_skb;
1616 1630
1631 /* Frame error, so drop the packet. */
1632 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1633 ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1634 dev_kfree_skb_any(skb);
1635 return;
1636 }
1637
1617 /* loopback self test for ethtool */ 1638 /* loopback self test for ethtool */
1618 if (test_bit(QL_SELFTEST, &qdev->flags)) { 1639 if (test_bit(QL_SELFTEST, &qdev->flags)) {
1619 ql_check_lb_frame(qdev, skb); 1640 ql_check_lb_frame(qdev, skb);
@@ -1919,6 +1940,13 @@ static void ql_process_mac_split_rx_intr(struct ql_adapter *qdev,
1919 return; 1940 return;
1920 } 1941 }
1921 1942
1943 /* Frame error, so drop the packet. */
1944 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1945 ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1946 dev_kfree_skb_any(skb);
1947 return;
1948 }
1949
1922 /* The max framesize filter on this chip is set higher than 1950 /* The max framesize filter on this chip is set higher than
1923 * MTU since FCoE uses 2k frames. 1951 * MTU since FCoE uses 2k frames.
1924 */ 1952 */
@@ -2000,12 +2028,6 @@ static unsigned long ql_process_mac_rx_intr(struct ql_adapter *qdev,
2000 2028
2001 QL_DUMP_IB_MAC_RSP(ib_mac_rsp); 2029 QL_DUMP_IB_MAC_RSP(ib_mac_rsp);
2002 2030
2003 /* Frame error, so drop the packet. */
2004 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
2005 ql_categorize_rx_err(qdev, ib_mac_rsp->flags2);
2006 return (unsigned long)length;
2007 }
2008
2009 if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { 2031 if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) {
2010 /* The data and headers are split into 2032 /* The data and headers are split into
2011 * separate buffers. 2033 * separate buffers.