From: "Sean Hefty" <sean.hefty@intel.com>
To: "Hefty, Sean" <sean.hefty@intel.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: openib-general@openib.org
Subject: [PATCH 3/5] export of ip_dev_find as part of Infiniband connection abstraction
Date: Fri, 3 Mar 2006 13:14:23 -0800 [thread overview]
Message-ID: <ORSMSX4013SOlbpH71y00000016@orsmsx401.amr.corp.intel.com> (raw)
In-Reply-To: <ORSMSX401X3cf3ednHM0000009a@orsmsx401.amr.corp.intel.com>
I wanted to make doubly sure that this didn't get lost in the patch series, but
ip_dev_find() is re-exported. The use is shown below.
- Sean
>+int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
>+{
>+ struct net_device *dev;
>+ u32 ip = ((struct sockaddr_in *) addr)->sin_addr.s_addr;
>+ int ret;
>+
>+ dev = ip_dev_find(ip);
>+ if (!dev)
>+ return -EADDRNOTAVAIL;
>+
>+ ret = copy_addr(dev_addr, dev, NULL);
>+ dev_put(dev);
>+ return ret;
>+}
{snip}
>+static int addr_resolve_local(struct sockaddr_in *src_in,
>+ struct sockaddr_in *dst_in,
>+ struct rdma_dev_addr *addr)
>+{
>+ struct net_device *dev;
>+ u32 src_ip = src_in->sin_addr.s_addr;
>+ u32 dst_ip = dst_in->sin_addr.s_addr;
>+ int ret;
>+
>+ dev = ip_dev_find(dst_ip);
>+ if (!dev)
>+ return -EADDRNOTAVAIL;
>+
>+ if (!src_ip) {
>+ src_in->sin_family = dst_in->sin_family;
>+ src_in->sin_addr.s_addr = dst_ip;
>+ ret = copy_addr(addr, dev, dev->dev_addr);
>+ } else {
>+ ret = rdma_translate_ip((struct sockaddr *)src_in, addr);
>+ if (!ret)
>+ memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
>+ }
>+
>+ dev_put(dev);
>+ return ret;
>+}
{snip}
>diff -uprN -X linux-2.6.git/Documentation/dontdiff
>linux-2.6.git/net/ipv4/fib_frontend.c
>linux-2.6.ib/net/ipv4/fib_frontend.c
>--- linux-2.6.git/net/ipv4/fib_frontend.c 2006-01-16 10:28:29.000000000
-0800
>+++ linux-2.6.ib/net/ipv4/fib_frontend.c 2006-01-16 16:14:24.000000000
-0800
>@@ -666,4 +666,5 @@ void __init ip_fib_init(void)
> }
>
> EXPORT_SYMBOL(inet_addr_type);
>+EXPORT_SYMBOL(ip_dev_find);
> EXPORT_SYMBOL(ip_rt_ioctl);
next prev parent reply other threads:[~2006-03-03 21:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-01 20:03 [PATCH 0/5] Infiniband: connection abstraction Sean Hefty
2006-02-01 20:07 ` [PATCH 1/5] " Sean Hefty
2006-02-01 20:10 ` [PATCH 2/5] " Sean Hefty
2006-02-01 20:15 ` [PATCH 3/5] " Sean Hefty
2006-03-03 21:14 ` Sean Hefty [this message]
2006-02-01 20:18 ` [PATCH 4/5] " Sean Hefty
2006-02-01 20:19 ` [PATCH 5/5] " Sean Hefty
2006-03-03 21:13 ` [PATCH 0/5] " Sean Hefty
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=ORSMSX4013SOlbpH71y00000016@orsmsx401.amr.corp.intel.com \
--to=sean.hefty@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=openib-general@openib.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