From: Stephen Hemminger <stephen@networkplumber.org>
To: Vipin Varghese <vipin.varghese@intel.com>
Cc: dev@dpdk.org, ferruh.yigit@intel.com, pascal.mazon@6wind.com
Subject: Re: [dpdk-dev] [PATCH v2] net/tap: allow user MAC to be passed as args
Date: Mon, 12 Mar 2018 10:33:17 -0700 [thread overview]
Message-ID: <20180312103317.01739678@xeon-e3> (raw)
In-Reply-To: <1520886094-28319-1-git-send-email-vipin.varghese@intel.com>
On Tue, 13 Mar 2018 01:51:34 +0530
Vipin Varghese <vipin.varghese@intel.com> wrote:
> +static int parse_user_mac(struct ether_addr *user_mac,
> + const char *value)
> +{
> + unsigned int index = 0;
> + char mac_temp[strlen(ETH_TAP_USR_MAC_FMT) + 1], *mac_byte = NULL;
> +
> + if (user_mac == NULL || value == NULL)
> + return 0;
> +
> + snprintf(mac_temp, sizeof(mac_temp), "%s", value);
> + mac_byte = strtok(mac_temp, ":");
> +
> + while ((mac_byte != NULL) &&
> + (strlen(mac_byte) <= 2) &&
> + (strlen(mac_byte) == strspn(mac_byte,
> + ETH_TAP_CMP_MAC_FMT))) {
> + user_mac->addr_bytes[index++] = strtoul(mac_byte, NULL, 16);
> + mac_byte = strtok(NULL, ":");
> + }
> +
> + return index;
> +}
We need rte_ether_aton or better yet replace the DPDK custom definition of
"struct ether_addr" with the with the one from Linux/BSD <netinet/ether.h>
There is no value in having a private version of all these routines...
next prev parent reply other threads:[~2018-03-12 17:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 18:22 [dpdk-dev] [PATCH] " Vipin Varghese
2018-02-02 9:16 ` Pascal Mazon
2018-02-02 9:49 ` Varghese, Vipin
2018-02-05 8:23 ` Varghese, Vipin
2018-02-05 15:54 ` [dpdk-dev] [PATCH v2] " Pascal Mazon
2018-02-05 15:58 ` Varghese, Vipin
2018-02-05 18:13 ` Varghese, Vipin
2018-02-05 18:42 ` Ferruh Yigit
2018-02-12 14:44 ` [dpdk-dev] [PATCH v1] " Vipin Varghese
2018-02-22 11:52 ` Pascal Mazon
2018-03-06 16:41 ` Ferruh Yigit
2018-03-07 9:44 ` Varghese, Vipin
2018-03-12 20:21 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
2018-03-12 15:08 ` Ferruh Yigit
2018-03-12 15:38 ` Varghese, Vipin
2018-03-12 17:33 ` Stephen Hemminger [this message]
2018-03-12 21:53 ` [dpdk-dev] [PATCH v3] " Vipin Varghese
2018-03-12 17:45 ` Ferruh Yigit
2018-03-16 14:22 ` Ferruh Yigit
-- strict thread matches above, loose matches on Subject: below --
2017-11-30 19:49 [dpdk-dev] [PATCH v1] net/tap: allow user mac " Vipin Varghese
2017-12-21 16:01 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
2018-01-16 11:32 ` Ferruh Yigit
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=20180312103317.01739678@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=pascal.mazon@6wind.com \
--cc=vipin.varghese@intel.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).