Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=877364e60edeea06efa8ceb9d29201f195af8a47
Commit:     877364e60edeea06efa8ceb9d29201f195af8a47
Parent:     02f1c89d6e36507476f78108a3dcc78538be460b
Author:     Brice Goglin <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 7 22:09:08 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Jan 8 23:30:18 2008 -0800

    [LRO] Fix lro_mgr->features checks
    
    lro_mgr->features contains a bitmask of LRO_F_* values which are
    defined as power of two, not as bit indexes.
    They must be checked with x&LRO_F_FOO, not with test_bit(LRO_F_FOO,&x).
    
    Signed-off-by: Brice Goglin <[EMAIL PROTECTED]>
    Acked-by: Andrew Gallatin <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/inet_lro.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 9a96c27..4a4d49f 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -310,7 +310,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
        skb_shinfo(lro_desc->parent)->gso_size = lro_desc->mss;
 
        if (lro_desc->vgrp) {
-               if (test_bit(LRO_F_NAPI, &lro_mgr->features))
+               if (lro_mgr->features & LRO_F_NAPI)
                        vlan_hwaccel_receive_skb(lro_desc->parent,
                                                 lro_desc->vgrp,
                                                 lro_desc->vlan_tag);
@@ -320,7 +320,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
                                        lro_desc->vlan_tag);
 
        } else {
-               if (test_bit(LRO_F_NAPI, &lro_mgr->features))
+               if (lro_mgr->features & LRO_F_NAPI)
                        netif_receive_skb(lro_desc->parent);
                else
                        netif_rx(lro_desc->parent);
@@ -352,7 +352,7 @@ static int __lro_proc_skb(struct net_lro_mgr *lro_mgr, 
struct sk_buff *skb,
                goto out;
 
        if ((skb->protocol == htons(ETH_P_8021Q))
-           && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features))
+           && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
                vlan_hdr_len = VLAN_HLEN;
 
        if (!lro_desc->active) { /* start new lro session */
@@ -474,7 +474,7 @@ static struct sk_buff *__lro_proc_segment(struct 
net_lro_mgr *lro_mgr,
                        goto out;
 
                if ((skb->protocol == htons(ETH_P_8021Q))
-                   && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features))
+                   && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
                        vlan_hdr_len = VLAN_HLEN;
 
                iph = (void *)(skb->data + vlan_hdr_len);
@@ -516,7 +516,7 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
                     void *priv)
 {
        if (__lro_proc_skb(lro_mgr, skb, NULL, 0, priv)) {
-               if (test_bit(LRO_F_NAPI, &lro_mgr->features))
+               if (lro_mgr->features & LRO_F_NAPI)
                        netif_receive_skb(skb);
                else
                        netif_rx(skb);
@@ -531,7 +531,7 @@ void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr 
*lro_mgr,
                                  void *priv)
 {
        if (__lro_proc_skb(lro_mgr, skb, vgrp, vlan_tag, priv)) {
-               if (test_bit(LRO_F_NAPI, &lro_mgr->features))
+               if (lro_mgr->features & LRO_F_NAPI)
                        vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
                else
                        vlan_hwaccel_rx(skb, vgrp, vlan_tag);
@@ -550,7 +550,7 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
        if (!skb)
                return;
 
-       if (test_bit(LRO_F_NAPI, &lro_mgr->features))
+       if (lro_mgr->features & LRO_F_NAPI)
                netif_receive_skb(skb);
        else
                netif_rx(skb);
@@ -570,7 +570,7 @@ void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr 
*lro_mgr,
        if (!skb)
                return;
 
-       if (test_bit(LRO_F_NAPI, &lro_mgr->features))
+       if (lro_mgr->features & LRO_F_NAPI)
                vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
        else
                vlan_hwaccel_rx(skb, vgrp, vlan_tag);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to