ipv6 netevent: Remove old_neigh from netevent_redirect.
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Mon, 14 Jan 2013 09:28:27 +0000 (09:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Jan 2013 20:04:59 +0000 (15:04 -0500)
The only user is cxgb3 driver.

old_neigh is used to check device change, but it must not happen
on redirect.  In this sense, we can remove old_neigh argument.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
include/net/netevent.h
net/ipv6/route.c

index 91d02eb51b8bb2c98c34ce92f9be33c5ecc8e973..4232767862b5857c33d324095e9d6ba1c2d0cc18 100644 (file)
@@ -64,9 +64,8 @@ static const unsigned int MAX_ATIDS = 64 * 1024;
 static const unsigned int ATID_BASE = 0x10000;
 
 static void cxgb_neigh_update(struct neighbour *neigh);
-static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh,
-                         struct dst_entry *new, struct neighbour *new_neigh,
-                         const void *daddr);
+static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new,
+                         struct neighbour *neigh, const void *daddr);
 
 static inline int offload_activated(struct t3cdev *tdev)
 {
@@ -970,10 +969,9 @@ static int nb_callback(struct notifier_block *self, unsigned long event,
        }
        case (NETEVENT_REDIRECT):{
                struct netevent_redirect *nr = ctx;
-               cxgb_redirect(nr->old, nr->old_neigh,
-                             nr->new, nr->new_neigh,
+               cxgb_redirect(nr->old, nr->new, nr->neigh,
                              nr->daddr);
-               cxgb_neigh_update(nr->new_neigh);
+               cxgb_neigh_update(nr->neigh);
                break;
        }
        default:
@@ -1109,11 +1107,11 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e)
        tdev->send(tdev, skb);
 }
 
-static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh,
-                         struct dst_entry *new, struct neighbour *new_neigh,
+static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new,
+                         struct neighbour *neigh,
                          const void *daddr)
 {
-       struct net_device *olddev, *newdev;
+       struct net_device *dev;
        struct tid_info *ti;
        struct t3cdev *tdev;
        u32 tid;
@@ -1121,26 +1119,15 @@ static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh,
        struct l2t_entry *e;
        struct t3c_tid_entry *te;
 
-       olddev = old_neigh->dev;
-       newdev = new_neigh->dev;
+       dev = neigh->dev;
 
-       if (!is_offloading(olddev))
-               return;
-       if (!is_offloading(newdev)) {
-               pr_warn("%s: Redirect to non-offload device ignored\n",
-                       __func__);
+       if (!is_offloading(dev))
                return;
-       }
-       tdev = dev2t3cdev(olddev);
+       tdev = dev2t3cdev(dev);
        BUG_ON(!tdev);
-       if (tdev != dev2t3cdev(newdev)) {
-               pr_warn("%s: Redirect to different offload device ignored\n",
-                       __func__);
-               return;
-       }
 
        /* Add new L2T entry */
-       e = t3_l2t_get(tdev, new, newdev, daddr);
+       e = t3_l2t_get(tdev, new, dev, daddr);
        if (!e) {
                pr_err("%s: couldn't allocate new l2t entry!\n", __func__);
                return;
index 3ce4988c9c08a96c0837407bd7c092c043a0309b..fe630dde35c3f3688d30e1e33a5fb5d06393bba6 100644 (file)
@@ -16,9 +16,8 @@ struct neighbour;
 
 struct netevent_redirect {
        struct dst_entry *old;
-       struct neighbour *old_neigh;
        struct dst_entry *new;
-       struct neighbour *new_neigh;
+       struct neighbour *neigh;
        const void *daddr;
 };
 
index 34f392f050c15beaad14f7e3116855e88a8a4f45..7c34c01b515b7ac370f8021ba6f5ec4c654e9e41 100644 (file)
@@ -1803,10 +1803,9 @@ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_bu
                goto out;
 
        netevent.old = &rt->dst;
-       netevent.old_neigh = old_neigh;
        netevent.new = &nrt->dst;
-       netevent.new_neigh = neigh;
        netevent.daddr = &msg->dest;
+       netevent.neigh = neigh;
        call_netevent_notifiers(NETEVENT_REDIRECT, &netevent);
 
        if (rt->rt6i_flags & RTF_CACHE) {