diff options
author | Matias Elo <matias.elo@nokia.com> | 2016-02-03 12:01:10 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-02-08 20:45:25 +0300 |
commit | c9384dea9e2adbebbc35622736589261d6e90f3a (patch) | |
tree | 5c87b935e8b2cdaa0bc2c14194487f5a5f591cc5 /platform | |
parent | c18ec6f698c899eb02efad02fba4efce808430c7 (diff) |
linux-generic: netmap: fix MTU size
This is a bug fix for netmat pktio MTU size. Valid packets
were being dropped in netmap_send() due to not taking into
account the ethernet header length.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/pktio/netmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index e406f6930..73c4bdee5 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -318,9 +318,10 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, pktio_entry_t *pktio_entry, } pkt_nm->sockfd = sockfd; - /* Use either interface MTU or netmap buffer size as MTU, whichever is - * smaller. */ - mtu = mtu_get_fd(pktio_entry->s.pkt_nm.sockfd, pktio_entry->s.name); + /* Use either interface MTU (+ ethernet header length) or netmap buffer + * size as MTU, whichever is smaller. */ + mtu = mtu_get_fd(pktio_entry->s.pkt_nm.sockfd, pktio_entry->s.name) + + ODPH_ETHHDR_LEN; if (mtu < 0) { ODP_ERR("Unable to read interface MTU\n"); goto error; |