DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mcnamara, John" <john.mcnamara@intel.com>
To: Tero Aho <tero.aho@coriant.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface	properties
Date: Tue, 28 Apr 2015 13:49:53 +0000	[thread overview]
Message-ID: <B27915DBBA3421428155699D51E4CFE2F16E40@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <1425044560-23397-2-git-send-email-tero.aho@coriant.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tero Aho
> Sent: Friday, February 27, 2015 1:43 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface
> properties
> 
> These changes set pcap interface mac address to the real underlying
> interface address instead of the default one. Also real interface link
> status, speed and duplex are reported when eth_link_update is called for
> the pcap interface.
> 
> Signed-off-by: Tero Aho <tero.aho@coriant.com>

> ...
> +               /* get link status, speed and duplex from the underlying interface */
> +
> +               strncpy(ifr.ifr_name, internals->if_name,
> sizeof(ifr.ifr_name)-1);
> +               ifr.ifr_name[sizeof(ifr.ifr_name)-1] = 0;
> +               if (!ioctl(internals->if_fd, SIOCGIFFLAGS, &ifr))
> +                       dev->data->dev_link.link_status = (ifr.ifr_flags
> + & IFF_UP) ? 1 : 0;
> +
> +               cmd.cmd = ETHTOOL_GSET;
> +               ifr.ifr_data = (void *)&cmd;
> +               if (!ioctl(internals->if_fd, SIOCETHTOOL, &ifr)) {
> +                       dev->data->dev_link.link_speed =
> ethtool_cmd_speed(&cmd);


Hi Tero,

I can see the benefit of setting the link status and speed etc. but this method seems a little fragile. What if there isn't an underlying interface, or all the interfaces are already bound to DPDK? Also I don't think the ethtool calls will work on FreeBSD as is.

So overall, I think this is a nack for this part of the patch. Perhaps a better approach would be to provide a function so that the calling application can set the parameters instead.

John

  reply	other threads:[~2015-04-28 13:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 13:42 [dpdk-dev] [PATCH 0/3] pcap pmd improvements Tero Aho
2015-02-27 13:42 ` [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface properties Tero Aho
2015-04-28 13:49   ` Mcnamara, John [this message]
2015-02-27 13:42 ` [dpdk-dev] [PATCH 2/3] pcap: add support for jumbo frames Tero Aho
2015-04-28 13:52   ` Mcnamara, John
2015-06-10  9:08   ` [dpdk-dev] [dpdk-dev,2/3] " Maxim Uvarov
2015-06-10  9:43     ` Mcnamara, John
2015-02-27 13:42 ` [dpdk-dev] [PATCH 3/3] pcap: add byte and error counters into statistics Tero Aho
2015-04-28 14:00   ` Mcnamara, John
2015-02-27 13:50 ` [dpdk-dev] [PATCH 0/3] pcap pmd improvements Thomas Monjalon
2015-04-28 10:09 ` Thomas Monjalon
2015-04-28 12:09   ` Mcnamara, John
2015-04-29  8:29     ` Nicolas Pernas Maradei
2015-04-28 12:27 ` Mcnamara, John
2015-04-29  0:30 [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface properties Nicolás Pernas Maradei

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=B27915DBBA3421428155699D51E4CFE2F16E40@IRSMSX103.ger.corp.intel.com \
    --to=john.mcnamara@intel.com \
    --cc=dev@dpdk.org \
    --cc=tero.aho@coriant.com \
    /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;
as well as URLs for NNTP newsgroup(s).