Skip to content

Commit e0e3121

Browse files
Alexander Duyckdavem330
authored andcommitted
cxgb: Use napi_alloc_skb instead of netdev_alloc_skb_ip_align
In order to use napi_alloc_skb I needed to pass a pointer to struct adapter instead of struct pci_dev. This allowed me to access &adapter->napi. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 67fd893 commit e0e3121

File tree

1 file changed

+6
-5
lines changed
  • drivers/net/ethernet/chelsio/cxgb

1 file changed

+6
-5
lines changed

drivers/net/ethernet/chelsio/cxgb/sge.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ MODULE_PARM_DESC(copybreak, "Receive copy threshold");
10251025

10261026
/**
10271027
* get_packet - return the next ingress packet buffer
1028-
* @pdev: the PCI device that received the packet
1028+
* @adapter: the adapter that received the packet
10291029
* @fl: the SGE free list holding the packet
10301030
* @len: the actual packet length, excluding any SGE padding
10311031
*
@@ -1037,14 +1037,15 @@ MODULE_PARM_DESC(copybreak, "Receive copy threshold");
10371037
* threshold and the packet is too big to copy, or (b) the packet should
10381038
* be copied but there is no memory for the copy.
10391039
*/
1040-
static inline struct sk_buff *get_packet(struct pci_dev *pdev,
1040+
static inline struct sk_buff *get_packet(struct adapter *adapter,
10411041
struct freelQ *fl, unsigned int len)
10421042
{
1043-
struct sk_buff *skb;
10441043
const struct freelQ_ce *ce = &fl->centries[fl->cidx];
1044+
struct pci_dev *pdev = adapter->pdev;
1045+
struct sk_buff *skb;
10451046

10461047
if (len < copybreak) {
1047-
skb = netdev_alloc_skb_ip_align(NULL, len);
1048+
skb = napi_alloc_skb(&adapter->napi, len);
10481049
if (!skb)
10491050
goto use_orig_buf;
10501051

@@ -1357,7 +1358,7 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
13571358
struct sge_port_stats *st;
13581359
struct net_device *dev;
13591360

1360-
skb = get_packet(adapter->pdev, fl, len - sge->rx_pkt_pad);
1361+
skb = get_packet(adapter, fl, len - sge->rx_pkt_pad);
13611362
if (unlikely(!skb)) {
13621363
sge->stats.rx_drops++;
13631364
return;

0 commit comments

Comments
 (0)