From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Nathan Hartwell
<nathan.hartwell-YP+SxaqqoVo2oU8LL9ROB9BPR1lH4CV8@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] rxe_cfg: Fix parsing of ethtool / ifconfig
Date: Wed, 18 Oct 2017 17:24:54 +0300 [thread overview]
Message-ID: <20171018142454.GR2106@mtr-leonro.local> (raw)
In-Reply-To: <CALvXFTdij1WaFL2A05MJBcngn5eJ=ahxwRU64bS_VsCjvnE1XQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2235 bytes --]
Moni ?????
Thanks
On Wed, Oct 11, 2017 at 01:00:24PM -0600, Nathan Hartwell wrote:
> rxe_cfg does not always parse the output of ethtool and ifconfig correctly.
>
> Fix two items:
> 1) Parsing of ethtool's link speed field to always output a link speed.
> 2) Parsing of ifconfig's IP address / MTU fields with newer builds of
> ifconfig that have a slightly different output format than in the
> past.
>
> Signed-off-by: Nathan Hartwell <nathan.hartwell-YP+SxaqqoVo2oU8LL9ROB9BPR1lH4CV8@public.gmane.org>
>
> --------------------------------------------------------------------------------
>
> diff --git a/providers/rxe/rxe_cfg.in b/providers/rxe/rxe_cfg.in
> index 0a8583d..8429b28 100755
> --- a/providers/rxe/rxe_cfg.in
> +++ b/providers/rxe/rxe_cfg.in
> @@ -180,9 +180,9 @@ sub get_dev_info {
> if ($fields[0] =~ "Link detected") {
> $link_state{$eth} = $fields[1];
> }
> - }
> - elsif ($line =~ "10000baseT") {
> - $link_speed{$eth} = "10GigE";
> + elsif ($fields[0] =~ "Speed") {
> + $link_speed{$eth} = $fields[1];
> + }
> }
> }
>
> @@ -197,6 +197,11 @@ sub get_dev_info {
> @fields = split(/\s+/, $line);
> $ipv4_addr{$eth} = $fields[0];
> }
> + elsif ($line =~ /inet /) {
> + $line =~ s/^\s+inet //g;
> + @fields = split(/\s+/, $line);
> + $ipv4_addr{$eth} = $fields[0];
> + }
>
> # get ethernet mtu
> if ($line =~ /MTU:/) {
> @@ -204,6 +209,11 @@ sub get_dev_info {
> @fields = split(/\s+/, $line);
> $eth_mtu{$eth} = $fields[0];
> }
> + elsif ($line =~ /mtu /) {
> + $line =~ s/^.*mtu //g;
> + @fields = split(/\s+/, $line);
> + $eth_mtu{$eth} = $fields[0];
> + }
> }
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-10-18 14:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 19:00 [PATCH] rxe_cfg: Fix parsing of ethtool / ifconfig Nathan Hartwell
[not found] ` <CALvXFTdij1WaFL2A05MJBcngn5eJ=ahxwRU64bS_VsCjvnE1XQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-16 4:50 ` Leon Romanovsky
[not found] ` <20171016045054.GZ2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-16 15:31 ` Nathan Hartwell
2017-10-18 14:24 ` Leon Romanovsky [this message]
[not found] ` <20171018142454.GR2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-18 14:45 ` Moni Shoua
[not found] ` <CAG9sBKMa2nYkjWy37DxbcmMriPtwKFHb2gxn6MYT=YJwa=3E2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-18 15:03 ` Bart Van Assche
[not found] ` <96dc09fb-14a8-a9ea-58ba-fedba2dc5194-Sjgp3cTcYWE@public.gmane.org>
2017-10-18 15:15 ` Moni Shoua
[not found] ` <CAG9sBKNhKNBDhZ=ywQ8xSTDHpmCzeshkRHEiEeQhkpdE_1CuNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-18 16:12 ` Nathan Hartwell
[not found] ` <CALvXFTfBZYTMzJnbrG2feHkZa6m3OZcZEDqQVN_hSTx+1f_i5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-19 7:37 ` Moni Shoua
2017-10-23 15:40 ` Jason Gunthorpe
[not found] ` <20171023154043.GD11952-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-10-24 15:26 ` Moni Shoua
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=20171018142454.GR2106@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=nathan.hartwell-YP+SxaqqoVo2oU8LL9ROB9BPR1lH4CV8@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox