net: hns3: remove RXD_VLD check in hns3_handle_bdinfo
authorYunsheng Lin <linyunsheng@huawei.com>
Fri, 28 Jun 2019 11:50:17 +0000 (19:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jun 2019 16:39:49 +0000 (09:39 -0700)
The HNS3_RXD_VLD_B bit has already been checked in hns3_add_frag
or hns3_handle_rx_bd before calling hns3_handle_bdinfo, so when
hns3_handle_bdinfo is called, the HNS3_RXD_VLD_B bit is always
set, which makes the checking in hns3_handle_bdinfo unnecessary.

This patch removes the RXD_VLD_B checking in hns3_handle_bdinfo.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

index 37f28bdaf950023f385be5140cc3dc412d7e4633..ab5a339cf261e7a5df88a38058755683dd853fc9 100644 (file)
@@ -1490,9 +1490,7 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
                        start = u64_stats_fetch_begin_irq(&ring->syncp);
                        rx_bytes += ring->stats.rx_bytes;
                        rx_pkts += ring->stats.rx_pkts;
-                       rx_drop += ring->stats.non_vld_descs;
                        rx_drop += ring->stats.l2_err;
-                       rx_errors += ring->stats.non_vld_descs;
                        rx_errors += ring->stats.l2_err;
                        rx_errors += ring->stats.l3l4_csum_err;
                        rx_crc_errors += ring->stats.l2_err;
@@ -2769,14 +2767,6 @@ static int hns3_handle_bdinfo(struct hns3_enet_ring *ring, struct sk_buff *skb)
                                               vlan_tag);
        }
 
-       if (unlikely(!(bd_base_info & BIT(HNS3_RXD_VLD_B)))) {
-               u64_stats_update_begin(&ring->syncp);
-               ring->stats.non_vld_descs++;
-               u64_stats_update_end(&ring->syncp);
-
-               return -EINVAL;
-       }
-
        if (unlikely(!desc->rx.pkt_len || (l234info & (BIT(HNS3_RXD_TRUNCAT_B) |
                                  BIT(HNS3_RXD_L2E_B))))) {
                u64_stats_update_begin(&ring->syncp);
index dd0064079aed56f632b2289d5fb6e03a3b6ffa29..a2b73d6aa2f305aad3ebb155117cf9864cc575ae 100644 (file)
@@ -384,7 +384,6 @@ struct ring_stats {
                        u64 rx_err_cnt;
                        u64 reuse_pg_cnt;
                        u64 err_pkt_len;
-                       u64 non_vld_descs;
                        u64 err_bd_num;
                        u64 l2_err;
                        u64 l3l4_csum_err;
index 16034afc43f95e79627564ca3bf3c8c6dd76dec4..5bff98a9b0dc30f631face83a2722586fce17378 100644 (file)
@@ -44,7 +44,6 @@ static const struct hns3_stats hns3_rxq_stats[] = {
        HNS3_TQP_STAT("errors", rx_err_cnt),
        HNS3_TQP_STAT("reuse_pg_cnt", reuse_pg_cnt),
        HNS3_TQP_STAT("err_pkt_len", err_pkt_len),
-       HNS3_TQP_STAT("non_vld_descs", non_vld_descs),
        HNS3_TQP_STAT("err_bd_num", err_bd_num),
        HNS3_TQP_STAT("l2_err", l2_err),
        HNS3_TQP_STAT("l3l4_csum_err", l3l4_csum_err),