Skip to content

Commit

Permalink
Merge "- Use the right vlan and vrf when flushing fragments after the…
Browse files Browse the repository at this point in the history
… first fragment arrives - Fix error with using && for bitwise AND - Avoid blocking interrupts when handling fragments as dev_queue_xmit requires that interrupts should not be blocked when packets are transmitted."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Sep 7, 2015
2 parents b7d439c + 21ebb41 commit 675fa2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 4 additions & 2 deletions dp-core/vr_fragment.c
Expand Up @@ -299,7 +299,7 @@ vr_fragment_assembler(struct vr_fragment **head_p,
}

if (vr_ip_fragment_tail(ip)) {
frag->f_expected = ((ntohs(ip->ip_frag_off) && 0x1FFF) * 8) +
frag->f_expected = ((ntohs(ip->ip_frag_off) & 0x1FFF) * 8) +
ntohs(ip->ip_len) - (ip->ip_hl * 4) ;
}
frag->f_received += (ntohs(ip->ip_len) - (ip->ip_hl * 4));
Expand Down Expand Up @@ -349,8 +349,10 @@ vr_fragment_assembler(struct vr_fragment **head_p,

if (frag->f_port_info_valid) {
while ((fqe = frag->f_qe)) {
memset(&fmd, 0, sizeof(fmd));
vr_init_forwarding_md(&fmd);
pnode = &fqe->fqe_pnode;
fmd.fmd_vlan = pnode->pl_vlan;
fmd.fmd_dvrf = pnode->pl_vrf;
vr_flow_flush_pnode(router, pnode, NULL, &fmd);
frag->f_qe = fqe->fqe_next;
vr_fragment_queue_element_free(fqe, VP_DROP_CLONED_ORIGINAL);
Expand Down
2 changes: 1 addition & 1 deletion dp-core/vr_proto_ip.c
Expand Up @@ -820,7 +820,7 @@ vr_inet_fragment_flow(struct vrouter *router, unsigned short vrf,

frag->f_received += (ntohs(ip->ip_len) - (ip->ip_hl * 4));
if (vr_ip_fragment_tail(ip)) {
frag->f_expected = ((ntohs(ip->ip_frag_off) && 0x1FFF) * 8) +
frag->f_expected = ((ntohs(ip->ip_frag_off) & 0x1FFF) * 8) +
ntohs(ip->ip_len) - (ip->ip_hl * 4) ;
}

Expand Down
10 changes: 4 additions & 6 deletions linux/vr_fragment_assembler.c
Expand Up @@ -53,7 +53,6 @@ static void
vr_linux_fragment_assembler(struct work_struct *work)
{
uint32_t hash, index;
unsigned long flags;

struct vr_packet *pkt;
struct vr_linux_fragment_bucket *vfb;
Expand Down Expand Up @@ -89,9 +88,9 @@ vr_linux_fragment_assembler(struct work_struct *work)
index = (hash % VR_LINUX_ASSEMBLER_BUCKETS);
vfb = &vr_linux_assembler_table[index];

spin_lock_irqsave(&vfb->vfb_lock, flags);
spin_lock_bh(&vfb->vfb_lock);
vr_fragment_assembler(&vfb->vfb_frag_list, tail);
spin_unlock_irqrestore(&vfb->vfb_lock, flags);
spin_unlock_bh(&vfb->vfb_lock);
}

tail = tail_n;
Expand Down Expand Up @@ -126,17 +125,16 @@ static void
vr_linux_assembler_table_scan(void *arg)
{
unsigned int i, j, scanned = 0;
unsigned long flags;

struct vr_linux_fragment_bucket *vfb;

i = vr_linux_assembler_scan_index;
for (j = 0; j < VR_LINUX_ASSEMBLER_BUCKETS; j++) {
vfb = &vr_linux_assembler_table[(i + j) % VR_LINUX_ASSEMBLER_BUCKETS];
spin_lock_irqsave(&vfb->vfb_lock, flags);
spin_lock_bh(&vfb->vfb_lock);
if (vfb->vfb_frag_list)
scanned += vr_assembler_table_scan(&vfb->vfb_frag_list);
spin_unlock_irqrestore(&vfb->vfb_lock, flags);
spin_unlock_bh(&vfb->vfb_lock);
if (scanned > vr_linux_assembler_scan_thresh) {
j++;
break;
Expand Down

0 comments on commit 675fa2e

Please sign in to comment.