treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / ethernet / huawei / hinic / hinic_rx.h
blob507dcbae90858c02afc7137d4de4f28e2ce7608a
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Huawei HiNIC PCI Express Linux driver
4 * Copyright(c) 2017 Huawei Technologies Co., Ltd
5 */
7 #ifndef HINIC_RX_H
8 #define HINIC_RX_H
10 #include <linux/types.h>
11 #include <linux/netdevice.h>
12 #include <linux/u64_stats_sync.h>
13 #include <linux/interrupt.h>
15 #include "hinic_hw_qp.h"
17 #define HINIC_RX_CSUM_OFFLOAD_EN 0xFFF
18 #define HINIC_RX_CSUM_HW_CHECK_NONE BIT(7)
19 #define HINIC_RX_CSUM_IPSU_OTHER_ERR BIT(8)
21 struct hinic_rxq_stats {
22 u64 pkts;
23 u64 bytes;
24 u64 errors;
25 u64 csum_errors;
26 u64 other_errors;
27 u64 alloc_skb_err;
28 struct u64_stats_sync syncp;
31 struct hinic_rxq {
32 struct net_device *netdev;
33 struct hinic_rq *rq;
35 struct hinic_rxq_stats rxq_stats;
37 char *irq_name;
38 u16 buf_len;
39 u32 rx_buff_shift;
41 struct napi_struct napi;
44 void hinic_rxq_clean_stats(struct hinic_rxq *rxq);
46 void hinic_rxq_get_stats(struct hinic_rxq *rxq, struct hinic_rxq_stats *stats);
48 int hinic_init_rxq(struct hinic_rxq *rxq, struct hinic_rq *rq,
49 struct net_device *netdev);
51 void hinic_clean_rxq(struct hinic_rxq *rxq);
53 #endif