From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: Paul Durrant <Paul.Durrant@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Wei Liu <wei.liu2@citrix.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] xennet_start_xmit assumptions
Date: Thu, 19 Jan 2017 06:37:00 -0500 [thread overview]
Message-ID: <20170119113700.GD22018@oracle.com> (raw)
In-Reply-To: <22c048f35d3845158b225d51dde33bf7@AMSPEX02CL03.citrite.net>
On (01/19/17 11:31), Paul Durrant wrote:
> Sowmini,
>
> Yeah, it would be useful to verify any change fixes the particular
> issue you're seeing so please share the program. For the non-empty
> non-linear case I'd hope that catching this and doing a pull of some
> sensible amount of header (which might coincide with the least amount
> that netback expects to see in the first frag) would be enough.
> I can take a shot at a patch for this in the next few days; I'll add
> your 'Reported-by' so you should get cc-ed.
Sounds good, here is the test program (very basic, no error checks!).
I think you can probably massage the pf_packet code to send down a
purely non-linear skb, I can take a look at what this involves and
get back to you.
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
int main(int argc, char *argv[])
{
struct ifreq ifr;
int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
struct sockaddr_ll sll;
int fd;
struct msghdr msg;
bzero(&ifr, sizeof (ifr));
strncpy(ifr.ifr_name, argv[1], sizeof(ifr.ifr_name));
ioctl(sockfd, SIOCGIFHWADDR, &ifr);
bzero(&sll, sizeof (sll));
sll.sll_family = PF_PACKET;
sll.sll_halen = ETH_ALEN;
sll.sll_ifindex = if_nametoindex(argv[1]);
memcpy(sll.sll_addr, (struct sockaddr *)&(ifr.ifr_hwaddr), ETH_ALEN);
fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
bind(fd, (struct sockaddr *)&sll, sizeof(sll));
bzero(&msg, sizeof (msg));
msg.msg_name = (void *)&sll;
msg.msg_namelen = sizeof (struct sockaddr_ll);
sendmsg(fd, &msg, 0);
fprintf(stderr, "sent!\n");
}
next prev parent reply other threads:[~2017-01-19 11:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 15:31 xennet_start_xmit assumptions Sowmini Varadhan
2017-01-18 19:25 ` Konrad Rzeszutek Wilk
2017-01-18 19:25 ` [Xen-devel] " Konrad Rzeszutek Wilk
2017-01-19 9:36 ` Paul Durrant
2017-01-19 11:14 ` Sowmini Varadhan
2017-01-19 11:14 ` [Xen-devel] " Sowmini Varadhan
2017-01-19 11:31 ` Paul Durrant
2017-01-19 11:37 ` Sowmini Varadhan [this message]
2017-01-19 11:37 ` Sowmini Varadhan
2017-01-19 16:37 ` David Miller
2017-01-19 18:47 ` Sowmini Varadhan
2017-01-19 22:41 ` [Xen-devel] " Sowmini Varadhan
2017-01-20 19:30 ` David Miller
2017-01-20 20:03 ` Sowmini Varadhan
2017-01-20 20:03 ` [Xen-devel] " Sowmini Varadhan
2017-01-20 19:30 ` David Miller
2017-01-19 22:41 ` Sowmini Varadhan
2017-01-25 15:06 ` Paul Durrant
2017-01-25 15:06 ` [Xen-devel] " Paul Durrant
2017-01-25 15:45 ` Sowmini Varadhan
2017-01-25 15:45 ` Sowmini Varadhan
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=20170119113700.GD22018@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=Paul.Durrant@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.