Commit 49f5ed42 authored by chas williams - CONTRACTOR's avatar chas williams - CONTRACTOR Committed by David S. Miller

atm: eliminate atm_guess_pdu2truesize()

Signed-off-by: default avatarChas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 021ac8d3
...@@ -1320,8 +1320,8 @@ static void rx_dle_intr(struct atm_dev *dev) ...@@ -1320,8 +1320,8 @@ static void rx_dle_intr(struct atm_dev *dev)
if (ia_vcc == NULL) if (ia_vcc == NULL)
{ {
atomic_inc(&vcc->stats->rx_err); atomic_inc(&vcc->stats->rx_err);
atm_return(vcc, skb->truesize);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
atm_return(vcc, atm_guess_pdu2truesize(len));
goto INCR_DLE; goto INCR_DLE;
} }
// get real pkt length pwang_test // get real pkt length pwang_test
...@@ -1334,8 +1334,8 @@ static void rx_dle_intr(struct atm_dev *dev) ...@@ -1334,8 +1334,8 @@ static void rx_dle_intr(struct atm_dev *dev)
atomic_inc(&vcc->stats->rx_err); atomic_inc(&vcc->stats->rx_err);
IF_ERR(printk("rx_dle_intr: Bad AAL5 trailer %d (skb len %d)", IF_ERR(printk("rx_dle_intr: Bad AAL5 trailer %d (skb len %d)",
length, skb->len);) length, skb->len);)
atm_return(vcc, skb->truesize);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
atm_return(vcc, atm_guess_pdu2truesize(len));
goto INCR_DLE; goto INCR_DLE;
} }
skb_trim(skb, length); skb_trim(skb, length);
......
...@@ -445,16 +445,6 @@ void vcc_insert_socket(struct sock *sk); ...@@ -445,16 +445,6 @@ void vcc_insert_socket(struct sock *sk);
void atm_dev_release_vccs(struct atm_dev *dev); void atm_dev_release_vccs(struct atm_dev *dev);
/*
* This is approximately the algorithm used by alloc_skb.
*
*/
static inline int atm_guess_pdu2truesize(int size)
{
return SKB_TRUESIZE(size);
}
static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
{ {
......
...@@ -26,7 +26,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc, int pdu_size, ...@@ -26,7 +26,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc, int pdu_size,
gfp_t gfp_flags) gfp_t gfp_flags)
{ {
struct sock *sk = sk_atm(vcc); struct sock *sk = sk_atm(vcc);
int guess = atm_guess_pdu2truesize(pdu_size); int guess = SKB_TRUESIZE(pdu_size);
atm_force_charge(vcc, guess); atm_force_charge(vcc, guess);
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) { if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment