Netdev List
 help / color / mirror / Atom feed
From: Shawn Bohrer <sbohrer@rgmadvisors.com>
To: netdev@vger.kernel.org
Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>, jackm@mellanox.co.il
Subject: mlx4_en drops packets on multicast join
Date: Tue, 20 Sep 2011 17:10:46 -0500	[thread overview]
Message-ID: <20110920221046.GC2119@BohrerMBP.rgmadvisors.com> (raw)

Hello,

I've found that using mlx4_en 1.5.4.1 available in the 3.0 kernel that
my Mellanox Technologies MT26428 will drop packets on a multicast
socket if another process does a bunch of multicast joins.  The same
behavior also occurs in the OFED 1.5.3 driver but not in the OFED 1.5.2
driver or older versions.

I've found that this only happens on sockets receiving multicast data,
and does not happen on a normal UDP socket.  When the packets are
dropped I do not see any indication of the drops in the driver or
kernel counters but only see the drops via the packet sequence
numbers.  I've also found that if the device is put in promiscuous
mode it will not drop packets.  As a secondary issue the device also
drops packets when leaving promiscuous mode though that appears to be
a different issue.

You can reproduce the issue using the iperf multicast benchmark, and
the sample program below.  For example:


server $ iperf -s -u -B 239.0.0.0 -i 1

client $ iperf -u -c 239.0.0.0 -l 16 -b 10M

# While benchmark is running
server $ ./multicast_join



/* sample multicast_join program */

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <time.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>


#define INTERFACE "10.8.16.21"
#define PORT 12345

main(int argc, char *argv[])
{
     struct sockaddr_in addr;
     int fd, i;
     struct ip_mreq mreq;
     char group[64];

     u_int yes=1;

     if ((fd=socket(AF_INET,SOCK_DGRAM,0)) < 0) {
	  perror("socket");
	  exit(1);
     }


    if (setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(yes)) < 0) {
       perror("Reusing ADDR failed");
       exit(1);
     }

     memset(&addr,0,sizeof(addr));
     addr.sin_family=AF_INET;
     addr.sin_addr.s_addr=htonl(INADDR_ANY);
     addr.sin_port=htons(PORT);

     /* bind to receive address */
     if (bind(fd,(struct sockaddr *) &addr,sizeof(addr)) < 0) {
	  perror("bind");
	  exit(1);
     }

     for (i = 1; i < 150; ++i) {
	 sprintf(group, "239.0.0.%d", i);
	 printf("%s\n", group);
	 mreq.imr_multiaddr.s_addr=inet_addr(group);
	 mreq.imr_interface.s_addr=inet_addr(INTERFACE);
	 if (setsockopt(fd,IPPROTO_IP,IP_ADD_MEMBERSHIP,&mreq,sizeof(mreq)) < 0) {
	      perror("setsockopt");
	      exit(1);
	 }
     }
}


---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

                 reply	other threads:[~2011-09-20 22:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110920221046.GC2119@BohrerMBP.rgmadvisors.com \
    --to=sbohrer@rgmadvisors.com \
    --cc=jackm@mellanox.co.il \
    --cc=netdev@vger.kernel.org \
    --cc=yevgenyp@mellanox.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox