| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2015 Cavium, Inc. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | - * under the terms of version 2 of the GNU General Public License |
|---|
| 6 | | - * as published by the Free Software Foundation. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | |
|---|
| 9 | 6 | #include <linux/pci.h> |
|---|
| .. | .. |
|---|
| 59 | 56 | dmem->q_len = q_len; |
|---|
| 60 | 57 | dmem->size = (desc_size * q_len) + align_bytes; |
|---|
| 61 | 58 | /* Save address, need it while freeing */ |
|---|
| 62 | | - dmem->unalign_base = dma_zalloc_coherent(&nic->pdev->dev, dmem->size, |
|---|
| 59 | + dmem->unalign_base = dma_alloc_coherent(&nic->pdev->dev, dmem->size, |
|---|
| 63 | 60 | &dmem->dma, GFP_KERNEL); |
|---|
| 64 | 61 | if (!dmem->unalign_base) |
|---|
| 65 | 62 | return -ENOMEM; |
|---|
| .. | .. |
|---|
| 463 | 460 | } |
|---|
| 464 | 461 | |
|---|
| 465 | 462 | /* In Softirq context, alloc rcv buffers in atomic mode */ |
|---|
| 466 | | -void nicvf_rbdr_task(unsigned long data) |
|---|
| 463 | +void nicvf_rbdr_task(struct tasklet_struct *t) |
|---|
| 467 | 464 | { |
|---|
| 468 | | - struct nicvf *nic = (struct nicvf *)data; |
|---|
| 465 | + struct nicvf *nic = from_tasklet(nic, t, rbdr_task); |
|---|
| 469 | 466 | |
|---|
| 470 | 467 | nicvf_refill_rbdr(nic, GFP_ATOMIC); |
|---|
| 471 | 468 | if (nic->rb_alloc_fail) { |
|---|
| .. | .. |
|---|
| 1182 | 1179 | void nicvf_sq_free_used_descs(struct net_device *netdev, struct snd_queue *sq, |
|---|
| 1183 | 1180 | int qidx) |
|---|
| 1184 | 1181 | { |
|---|
| 1185 | | - u64 head, tail; |
|---|
| 1182 | + u64 head; |
|---|
| 1186 | 1183 | struct sk_buff *skb; |
|---|
| 1187 | 1184 | struct nicvf *nic = netdev_priv(netdev); |
|---|
| 1188 | 1185 | struct sq_hdr_subdesc *hdr; |
|---|
| 1189 | 1186 | |
|---|
| 1190 | 1187 | head = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_HEAD, qidx) >> 4; |
|---|
| 1191 | | - tail = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_TAIL, qidx) >> 4; |
|---|
| 1192 | 1188 | while (sq->head != head) { |
|---|
| 1193 | 1189 | hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, sq->head); |
|---|
| 1194 | 1190 | if (hdr->subdesc_type != SQ_DESC_TYPE_HEADER) { |
|---|
| .. | .. |
|---|
| 1493 | 1489 | int seg_subdescs = 0, desc_cnt = 0; |
|---|
| 1494 | 1490 | int seg_len, total_len, data_left; |
|---|
| 1495 | 1491 | int hdr_qentry = qentry; |
|---|
| 1496 | | - int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
|---|
| 1492 | + int hdr_len; |
|---|
| 1497 | 1493 | |
|---|
| 1498 | | - tso_start(skb, &tso); |
|---|
| 1494 | + hdr_len = tso_start(skb, &tso); |
|---|
| 1495 | + |
|---|
| 1499 | 1496 | total_len = skb->len - hdr_len; |
|---|
| 1500 | 1497 | while (total_len > 0) { |
|---|
| 1501 | 1498 | char *hdr; |
|---|
| .. | .. |
|---|
| 1591 | 1588 | goto doorbell; |
|---|
| 1592 | 1589 | |
|---|
| 1593 | 1590 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
|---|
| 1594 | | - const struct skb_frag_struct *frag; |
|---|
| 1595 | | - |
|---|
| 1596 | | - frag = &skb_shinfo(skb)->frags[i]; |
|---|
| 1591 | + const skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
|---|
| 1597 | 1592 | |
|---|
| 1598 | 1593 | qentry = nicvf_get_nxt_sqentry(sq, qentry); |
|---|
| 1599 | 1594 | size = skb_frag_size(frag); |
|---|
| 1600 | 1595 | dma_addr = dma_map_page_attrs(&nic->pdev->dev, |
|---|
| 1601 | 1596 | skb_frag_page(frag), |
|---|
| 1602 | | - frag->page_offset, size, |
|---|
| 1597 | + skb_frag_off(frag), size, |
|---|
| 1603 | 1598 | DMA_TO_DEVICE, |
|---|
| 1604 | 1599 | DMA_ATTR_SKIP_CPU_SYNC); |
|---|
| 1605 | 1600 | if (dma_mapping_error(&nic->pdev->dev, dma_addr)) { |
|---|