IB/IPoIB: Add destination address when re-queue packet
am: bb4a21dcb6
Change-Id: Iec2af2c31a8e5a58a0e5c6e3cafe6813de39073f
This commit is contained in:
commit
8d4558285a
1 changed files with 17 additions and 13 deletions
|
@ -626,6 +626,14 @@ void ipoib_mark_paths_invalid(struct net_device *dev)
|
||||||
spin_unlock_irq(&priv->lock);
|
spin_unlock_irq(&priv->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void push_pseudo_header(struct sk_buff *skb, const char *daddr)
|
||||||
|
{
|
||||||
|
struct ipoib_pseudo_header *phdr;
|
||||||
|
|
||||||
|
phdr = (struct ipoib_pseudo_header *)skb_push(skb, sizeof(*phdr));
|
||||||
|
memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
|
||||||
|
}
|
||||||
|
|
||||||
void ipoib_flush_paths(struct net_device *dev)
|
void ipoib_flush_paths(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct ipoib_dev_priv *priv = netdev_priv(dev);
|
struct ipoib_dev_priv *priv = netdev_priv(dev);
|
||||||
|
@ -850,8 +858,7 @@ static void neigh_add_path(struct sk_buff *skb, u8 *daddr,
|
||||||
}
|
}
|
||||||
if (skb_queue_len(&neigh->queue) <
|
if (skb_queue_len(&neigh->queue) <
|
||||||
IPOIB_MAX_PATH_REC_QUEUE) {
|
IPOIB_MAX_PATH_REC_QUEUE) {
|
||||||
/* put pseudoheader back on for next time */
|
push_pseudo_header(skb, neigh->daddr);
|
||||||
skb_push(skb, IPOIB_PSEUDO_LEN);
|
|
||||||
__skb_queue_tail(&neigh->queue, skb);
|
__skb_queue_tail(&neigh->queue, skb);
|
||||||
} else {
|
} else {
|
||||||
ipoib_warn(priv, "queue length limit %d. Packet drop.\n",
|
ipoib_warn(priv, "queue length limit %d. Packet drop.\n",
|
||||||
|
@ -869,10 +876,12 @@ static void neigh_add_path(struct sk_buff *skb, u8 *daddr,
|
||||||
|
|
||||||
if (!path->query && path_rec_start(dev, path))
|
if (!path->query && path_rec_start(dev, path))
|
||||||
goto err_path;
|
goto err_path;
|
||||||
if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE)
|
if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
|
||||||
|
push_pseudo_header(skb, neigh->daddr);
|
||||||
__skb_queue_tail(&neigh->queue, skb);
|
__skb_queue_tail(&neigh->queue, skb);
|
||||||
else
|
} else {
|
||||||
goto err_drop;
|
goto err_drop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
@ -908,8 +917,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
|
||||||
}
|
}
|
||||||
if (path) {
|
if (path) {
|
||||||
if (skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
|
if (skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
|
||||||
/* put pseudoheader back on for next time */
|
push_pseudo_header(skb, phdr->hwaddr);
|
||||||
skb_push(skb, IPOIB_PSEUDO_LEN);
|
|
||||||
__skb_queue_tail(&path->queue, skb);
|
__skb_queue_tail(&path->queue, skb);
|
||||||
} else {
|
} else {
|
||||||
++dev->stats.tx_dropped;
|
++dev->stats.tx_dropped;
|
||||||
|
@ -941,8 +949,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
|
||||||
return;
|
return;
|
||||||
} else if ((path->query || !path_rec_start(dev, path)) &&
|
} else if ((path->query || !path_rec_start(dev, path)) &&
|
||||||
skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
|
skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
|
||||||
/* put pseudoheader back on for next time */
|
push_pseudo_header(skb, phdr->hwaddr);
|
||||||
skb_push(skb, IPOIB_PSEUDO_LEN);
|
|
||||||
__skb_queue_tail(&path->queue, skb);
|
__skb_queue_tail(&path->queue, skb);
|
||||||
} else {
|
} else {
|
||||||
++dev->stats.tx_dropped;
|
++dev->stats.tx_dropped;
|
||||||
|
@ -1023,8 +1030,7 @@ send_using_neigh:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
|
if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
|
||||||
/* put pseudoheader back on for next time */
|
push_pseudo_header(skb, phdr->hwaddr);
|
||||||
skb_push(skb, sizeof(*phdr));
|
|
||||||
spin_lock_irqsave(&priv->lock, flags);
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
__skb_queue_tail(&neigh->queue, skb);
|
__skb_queue_tail(&neigh->queue, skb);
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
@ -1056,7 +1062,6 @@ static int ipoib_hard_header(struct sk_buff *skb,
|
||||||
unsigned short type,
|
unsigned short type,
|
||||||
const void *daddr, const void *saddr, unsigned len)
|
const void *daddr, const void *saddr, unsigned len)
|
||||||
{
|
{
|
||||||
struct ipoib_pseudo_header *phdr;
|
|
||||||
struct ipoib_header *header;
|
struct ipoib_header *header;
|
||||||
|
|
||||||
header = (struct ipoib_header *) skb_push(skb, sizeof *header);
|
header = (struct ipoib_header *) skb_push(skb, sizeof *header);
|
||||||
|
@ -1069,8 +1074,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
|
||||||
* destination address into skb hard header so we can figure out where
|
* destination address into skb hard header so we can figure out where
|
||||||
* to send the packet later.
|
* to send the packet later.
|
||||||
*/
|
*/
|
||||||
phdr = (struct ipoib_pseudo_header *) skb_push(skb, sizeof(*phdr));
|
push_pseudo_header(skb, daddr);
|
||||||
memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
|
|
||||||
|
|
||||||
return IPOIB_HARD_LEN;
|
return IPOIB_HARD_LEN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue