#define DSAF_DUMP_REGS_NUM 504
#define DSAF_STATIC_NUM 28
-#define DSAF_STATS_READ(p, offset) (*((u64 *)((u64)(p) + (offset))))
+#define DSAF_STATS_READ(p, offset) (*((u64 *)((u8 *)(p) + (offset))))
enum hal_dsaf_mode {
HRD_DSAF_NO_DSAF_MODE = 0x0,
static inline void *hns_dsaf_dev_priv(const struct dsaf_device *dsaf_dev)
{
- return (void *)((u64)dsaf_dev + sizeof(*dsaf_dev));
+ return (void *)((u8 *)dsaf_dev + sizeof(*dsaf_dev));
}
struct dsaf_drv_tbl_tcam_key {
dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_L_REG,
(u32)dma);
dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG,
- (u32)(dma >> 32));
-
+ (u32)((dma >> 31) >> 1));
dsaf_write_dev(q, RCB_RING_RX_RING_BD_LEN_REG,
bd_size_type);
dsaf_write_dev(q, RCB_RING_RX_RING_BD_NUM_REG,
dsaf_write_dev(q, RCB_RING_TX_RING_BASEADDR_L_REG,
(u32)dma);
dsaf_write_dev(q, RCB_RING_TX_RING_BASEADDR_H_REG,
- (u32)(dma >> 32));
-
+ (u32)((dma >> 31) >> 1));
dsaf_write_dev(q, RCB_RING_TX_RING_BD_LEN_REG,
bd_size_type);
dsaf_write_dev(q, RCB_RING_TX_RING_BD_NUM_REG,
#define NIC_TX_CLEAN_MAX_NUM 256
#define NIC_RX_CLEAN_MAX_NUM 64
-#define RCB_ERR_PRINT_CYCLE 1000
-
#define RCB_IRQ_NOT_INITED 0
#define RCB_IRQ_INITED 1
if (unlikely((!desc->rx.pkt_len) ||
hnae_get_bit(bnum_flag, HNS_RXD_DROP_B))) {
- if (!(ring->stats.err_pkt_len % RCB_ERR_PRINT_CYCLE))
- netdev_dbg(ndev,
- "pkt_len(%u),drop(%u),%#llx,%#llx\n",
- le16_to_cpu(desc->rx.pkt_len),
- hnae_get_bit(bnum_flag, HNS_RXD_DROP_B),
- ((u64 *)desc)[0], ((u64 *)desc)[1]);
ring->stats.err_pkt_len++;
dev_kfree_skb_any(skb);
return -EFAULT;
}
if (unlikely(hnae_get_bit(bnum_flag, HNS_RXD_L2E_B))) {
- if (!(ring->stats.l2_err % RCB_ERR_PRINT_CYCLE))
- netdev_dbg(ndev, "L2 check err,%#llx,%#llx\n",
- ((u64 *)desc)[0], ((u64 *)desc)[1]);
ring->stats.l2_err++;
dev_kfree_skb_any(skb);
return -EFAULT;
if (unlikely(hnae_get_bit(bnum_flag, HNS_RXD_L3E_B) ||
hnae_get_bit(bnum_flag, HNS_RXD_L4E_B))) {
- if (!(ring->stats.l3l4_csum_err % RCB_ERR_PRINT_CYCLE))
- netdev_dbg(ndev,
- "check err(%#x),%#llx,%#llx\n",
- hnae_get_bit(bnum_flag, HNS_RXD_L3E_B) |
- hnae_get_bit(bnum_flag, HNS_RXD_L4E_B),
- ((u64 *)desc)[0], ((u64 *)desc)[1]);
ring->stats.l3l4_csum_err++;
return 0;
}