Changeset 3595

Show
Ignore:
Timestamp:
05/03/08 05:49:05 (8 months ago)
Author:
mentor
Message:

Remove the skb_copy call from ieee80211_input. However, create a copied SKB for each call to ieee80211_input when we are sending to all VAPs. Effectively, this means that we are using the SKB from the ath_buf except when ieee80211_input is called multiple times.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • madwifi/trunk/ath/if_ath.c

    r3594 r3595  
    68506850                } else { 
    68516851                        struct ieee80211vap *vap; 
     6852                        struct sk_buff *tskb; 
    68526853                        /* Create a new SKB copy for each VAP except the last 
    68536854                         * one, which gets the original SKB. */ 
    68546855                        TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { 
     6856                                if (vap == TAILQ_LAST(&ic->ic_vaps, 
     6857                                                        ieee80211vap_headtype)) 
     6858                                        tskb = skb; 
     6859                                else 
     6860                                        tskb = skb_copy(skb, GFP_ATOMIC); 
     6861 
     6862                                if (!tskb) 
     6863                                        /* XXX: Brilliant OOM handling. */ 
     6864                                        vap->iv_devstats.tx_dropped++; 
     6865                                else 
    68556866                                        type = ieee80211_input(vap, NULL, skb, 
    68566867                                                        rs->rs_rssi, bf->bf_tsf); 
  • madwifi/trunk/net80211/ieee80211_input.c

    r3594 r3595  
    196196int 
    197197ieee80211_input(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null, 
    198         struct sk_buff *original_skb, int rssi, u_int64_t rtsf) 
     198        struct sk_buff *skb, int rssi, u_int64_t rtsf) 
    199199{ 
    200200#define HAS_SEQ(type)   ((type & 0x4) == 0) 
     
    205205        struct ieee80211_key *key; 
    206206        struct ether_header *eh; 
    207         struct sk_buff *skb = NULL; 
    208207#ifdef ATH_SUPERG_FF 
    209208        struct llc *llc; 
     
    221220                ni = ieee80211_ref_node(vap->iv_bss); 
    222221        } 
    223         KASSERT(original_skb != NULL, ("null skb")); 
     222        KASSERT(skb != NULL, ("null skb")); 
    224223        KASSERT(ni != NULL, ("null node")); 
    225224        ni->ni_inact = ni->ni_inact_reload; 
     
    231230        if (vap->iv_opmode == IEEE80211_M_MONITOR) 
    232231                goto out; 
    233         if (original_skb->len < sizeof(struct ieee80211_frame_min)) { 
     232        if (skb->len < sizeof(struct ieee80211_frame_min)) { 
    234233                IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, 
    235234                        ni->ni_macaddr, NULL, 
    236                         "too short (1): len %u", original_skb->len); 
     235                        "too short (1): len %u", skb->len); 
    237236                vap->iv_stats.is_rx_tooshort++; 
    238237                goto out; 
    239238        } 
    240         /* Copy the SKB... we assume somewhere in this driver that we 'own' 
    241          * the skbuff passed into hard start and we do a lot of messing with it 
    242          * but bridges under some cases will not clone for the first pass of skb 
    243          * to a bridge port, but will then clone for subsequent ones.  This is  
    244          * odd behavior but it means that if we have trashed the skb we are given 
    245          * then other ports get clones of the residual garbage. */ 
    246         if ((skb = skb_copy(original_skb, GFP_ATOMIC)) == NULL) { 
    247                 vap->iv_devstats.tx_dropped++; 
    248                 original_skb = NULL; /* protect caller's skb */ 
    249                 goto out; 
    250         } 
    251         ieee80211_skb_copy_noderef(original_skb, skb); 
    252         original_skb = NULL; /* protect caller's skb */ 
    253239 
    254240        /* Bit of a cheat here, we use a pointer for a 3-address 
     
    854840        vap->iv_devstats.rx_errors++; 
    855841out: 
    856         if (skb != NULL) 
    857                 ieee80211_dev_kfree_skb(&skb); /* This is a copy! */ 
     842        ieee80211_dev_kfree_skb(&skb); 
    858843        if (ni_or_null == NULL) 
    859844                ieee80211_unref_node(&ni);