2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

netdev: Send ofpbuf directly to netdev.

DPDK netdev need to access ofpbuf while sending buffer. Following
patch changes netdev_send accordingly.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@redhat.com>
This commit is contained in:
Pravin
2014-03-20 10:56:51 -07:00
committed by Pravin B Shelar
parent df1e5a3bc7
commit 40d26f04b2
7 changed files with 37 additions and 18 deletions

View File

@@ -818,9 +818,11 @@ netdev_dummy_rx_drain(struct netdev_rx *rx_)
}
static int
netdev_dummy_send(struct netdev *netdev, const void *buffer, size_t size)
netdev_dummy_send(struct netdev *netdev, struct ofpbuf *pkt, bool may_steal)
{
struct netdev_dummy *dev = netdev_dummy_cast(netdev);
const void *buffer = pkt->data;
size_t size = pkt->size;
if (size < ETH_HEADER_LEN) {
return EMSGSIZE;
@@ -855,6 +857,9 @@ netdev_dummy_send(struct netdev *netdev, const void *buffer, size_t size)
}
ovs_mutex_unlock(&dev->mutex);
if (may_steal) {
ofpbuf_delete(pkt);
}
return 0;
}