On 26 July 2018 at 16:01, gyanesh patra <pgyanesh.pa...@gmail.com> wrote:
> Hi, > Here is the output for the debug messages as advised: > For this code: > -------------- > 541 ODP_DBG("MTU: %" PRIu32 "\n", mtu); > > 542 ODP_DBG("NM buf_size: %" PRIu32 "\n", buf_size); > > 543 pkt_nm->mtu = (mtu < buf_size) ? mtu : buf_size; > > Output: > --------- > netmap interface: eth5 > num_rx_desc: 0 > num_tx_desc: 0 > pktio/netmap.c:541:netmap_open():MTU: 1514 > pktio/netmap.c:542:netmap_open():NM buf_size: 2048 > pktio/netmap.c:567:netmap_open():netmap pktio eth5 does not support > statistics counters > odp_packet_io.c:295:odp_pktio_open():interface: eth5, driver: netmap > > ===== > For this code: > -------------- > 839 if (odp_likely(ring->slot[slot_id].len <= mtu)) { > > 840 slot_tbl[num_rx].buf = buf; > > 841 slot_tbl[num_rx].len = ring->slot[slot_id].len; > > 842 ODP_DBG("dropped oversized packet %d > %d\n",ring->slot[slot_id].len, mtu); > 843 num_rx++; > > 844 } > > Output: > -------- > pktio/netmap.c:842:netmap_recv_desc():dropped oversized packet 60 1514 > pktio/netmap.c:842:netmap_recv_desc():dropped oversized packet 60 1514 > > Are packets dropped or you just see this message? if (odp_likely(ring->slot[slot_id].len <= mtu)) { slot_tbl[num_rx].buf = buf; slot_tbl[num_rx].len = ring->slot[slot_id].len; ODP_DBG("dropped oversized packet\n"); num_rx++; } num_rx is increasing then packet wrapped into odp: if (num_rx) { return netmap_pkt_to_odp(pktio_entry, pkt_table, slot_tbl, num_rx, ts); it looks like message just confusing. Packet is less then mtu. > If anything else is required, i can get those details too. > > Thanks, > P Gyanesh Kumar Patra > > > On Thu, Jul 26, 2018 at 3:36 AM Elo, Matias (Nokia - FI/Espoo) < > matias....@nokia.com> wrote: > >> >> >> > On 25 Jul 2018, at 17:11, Maxim Uvarov <maxim.uva...@linaro.org> wrote: >> > >> > For quick look it looks like mtu is not set correctly on open(). Can >> you try this patch: >> > >> > diff --git a/platform/linux-generic/pktio/netmap.c >> b/platform/linux-generic/pktio/netmap.c >> > index 0da2b7a..d4db0af 100644 >> > --- a/platform/linux-generic/pktio/netmap.c >> > +++ b/platform/linux-generic/pktio/netmap.c >> > @@ -539,6 +539,7 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, >> pktio_entry_t *pktio_entry, >> > goto error; >> > } >> > pkt_nm->mtu = (mtu < buf_size) ? mtu : buf_size; >> > + pkt_priv(pktio_entry)->mtu = pkt_nm->mtu; >> >> >> pkt_netmap_t *pkt_nm = pkt_priv(pktio_entry), so this is unnecessary. >> >> >> >> >> >> >> >> Is this a know issue or am i missing something? >> >> >> >> >> As far as I can see the problem is caused by reading interface MTU >> incorrectly or netmap using unusually small buffers (assuming moongen sends >> packets smaller than MTU). The following patch should help debug the issue. >> >> -Matias >> >> diff --git a/platform/linux-generic/pktio/netmap.c >> b/platform/linux-generic/pktio/netmap.c >> index 0da2b7afd..3e0a17542 100644 >> --- a/platform/linux-generic/pktio/netmap.c >> +++ b/platform/linux-generic/pktio/netmap.c >> @@ -538,6 +538,10 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, >> pktio_entry_t *pktio_entry, >> ODP_ERR("Unable to read interface MTU\n"); >> goto error; >> } >> + >> + ODP_DBG("MTU: %" PRIu32 "\n", mtu); >> + ODP_DBG("NM buf_size: %" PRIu32 "\n", buf_size); >> + >> pkt_nm->mtu = (mtu < buf_size) ? mtu : buf_size; >> >> /* Check if RSS is supported. If not, set 'max_input_queues' to >> 1. */ >> >> >>