diff options
author | Roland Dreier <rolandd@cisco.com> | 2005-10-28 15:30:34 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2005-10-28 15:30:34 -0700 |
commit | 1993d683f39f77ddb46a662d7146247877d50b8f (patch) | |
tree | 608391d9daa25e13b70cc11d6b99f800a7079050 /drivers/infiniband/ulp/ipoib/ipoib.h | |
parent | cb0f0910f4b41772a6771bdb4fb2d419b27bcd77 (diff) | |
download | lwn-1993d683f39f77ddb46a662d7146247877d50b8f.tar.gz lwn-1993d683f39f77ddb46a662d7146247877d50b8f.zip |
[IPoIB] Drop RX packets when out of memory
Change the way IPoIB handles RX packets when it can't allocate a new
receive skbuff. If the allocation of a new receive skb fails, we now
drop the packet we just received and repost the original receive skb.
This means that the receive ring always stays full and we don't have
to monkey around with trying to schedule a refill task for later.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib.h')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 6b14bd1c60a0..c994a916a58a 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h @@ -100,7 +100,12 @@ struct ipoib_pseudoheader { struct ipoib_mcast; -struct ipoib_buf { +struct ipoib_rx_buf { + struct sk_buff *skb; + dma_addr_t mapping; +}; + +struct ipoib_tx_buf { struct sk_buff *skb; DECLARE_PCI_UNMAP_ADDR(mapping) }; @@ -150,14 +155,14 @@ struct ipoib_dev_priv { unsigned int admin_mtu; unsigned int mcast_mtu; - struct ipoib_buf *rx_ring; + struct ipoib_rx_buf *rx_ring; - spinlock_t tx_lock; - struct ipoib_buf *tx_ring; - unsigned tx_head; - unsigned tx_tail; - struct ib_sge tx_sge; - struct ib_send_wr tx_wr; + spinlock_t tx_lock; + struct ipoib_tx_buf *tx_ring; + unsigned tx_head; + unsigned tx_tail; + struct ib_sge tx_sge; + struct ib_send_wr tx_wr; struct ib_wc ibwc[IPOIB_NUM_WC]; |