From patchwork Tue Aug 19 17:22:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 35646 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A17302034C for ; Tue, 19 Aug 2014 17:22:21 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wn1sf43848991obc.2 for ; Tue, 19 Aug 2014 10:22:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:message-id:to:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=glpRfymq5cdzMp/T1e3hIIbVJQ56poVWJzP649muEF4=; b=EIWloIR8CNSCc+7dBxQhHQ/8/jMBeG9/PXxqIaiP9ahx9mQeEBpRGrXo8+iy3TZPvy LZuKnYmM3iK353Zpz3P85JK+U2eP9Nd5qV0rRlfQ1O2zmmJPWxizl+ULZuYrPbAEOR4V ifAPuqLjLcxSAI3w4ZSV94P3d45J42qJh4COmcd/qAKBGszn3MEwSaIairmBIBcVLSxP 4xqyRHV2wSau5SHPLd5rWrm9X5Cy7Bu1hmwgOskIRiAzgt7u1cQnhEIDA7/jZMn563/B vFb5DjtmJUo6TVtOGxWLAsn4QwdKFcKnXehFSkLfQtjuPkn9sl6P4jVNX7+UbA51A6ZS 4lGg== X-Gm-Message-State: ALoCoQlEoKRj+xfnwYciXLPHK2pbYLfDuUXslPv8UbQ0QWb9O9HzttH0Q3HEj+YwK1Ys6Os8i7Wp X-Received: by 10.182.28.102 with SMTP id a6mr4722429obh.44.1408468941266; Tue, 19 Aug 2014 10:22:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.83 with SMTP id p77ls2889263qga.97.gmail; Tue, 19 Aug 2014 10:22:21 -0700 (PDT) X-Received: by 10.52.135.133 with SMTP id ps5mr14223486vdb.33.1408468941161; Tue, 19 Aug 2014 10:22:21 -0700 (PDT) Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com [2607:f8b0:400c:c03::22d]) by mx.google.com with ESMTPS id ir5si9204195vcb.82.2014.08.19.10.22.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 10:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22d as permitted sender) client-ip=2607:f8b0:400c:c03::22d; Received: by mail-vc0-f173.google.com with SMTP id hy10so7729738vcb.4 for ; Tue, 19 Aug 2014 10:22:21 -0700 (PDT) X-Received: by 10.220.187.134 with SMTP id cw6mr809222vcb.71.1408468941072; Tue, 19 Aug 2014 10:22:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp256943vcb; Tue, 19 Aug 2014 10:22:20 -0700 (PDT) X-Received: by 10.140.83.242 with SMTP id j105mr58556497qgd.38.1408468940571; Tue, 19 Aug 2014 10:22:20 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id f19si29875249qaq.68.2014.08.19.10.22.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 10:22:19 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XJn6u-0001ys-EF; Tue, 19 Aug 2014 17:22:16 +0000 Received: from rcdn-iport-4.cisco.com ([173.37.86.75]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XJn6k-0001yG-V1 for lng-odp@lists.linaro.org; Tue, 19 Aug 2014 17:22:07 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak4HANuG81OtJA2L/2dsb2JhbABZgw20EQGeQIQoFneEMYEONEIEiF2cfqQIF49phDYFsUWDeSGCfgEBAQ X-IronPort-AV: E=Sophos;i="5.01,896,1400025600"; d="scan'208";a="348774835" Received: from alln-core-6.cisco.com ([173.36.13.139]) by rcdn-iport-4.cisco.com with ESMTP; 19 Aug 2014 17:22:01 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id s7JHM0eL023700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 19 Aug 2014 17:22:01 GMT Received: from cpp-rtpbld-55.cisco.com (localhost.localdomain [127.0.0.1]) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8) with ESMTP id s7JHM0av014097 for ; Tue, 19 Aug 2014 13:22:00 -0400 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id s7JHM0xV014096 for lng-odp@lists.linaro.org; Tue, 19 Aug 2014 13:22:00 -0400 Date: Tue, 19 Aug 2014 13:22:00 -0400 From: robking@cisco.com Message-Id: <201408191722.s7JHM0xV014096@cpp-rtpbld-55.cisco.com> To: lng-odp@lists.linaro.org Subject: [lng-odp] test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Original-Sender: robking@cisco.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22d as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@cisco.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Here is the diff I mentioned that I'm using to make progress on Cisco DP. diff --git a/platform/linux-generic/include/api/odp_pktio_socket.h b/platform/linux-generic/include/api/odp_pktio_socket.h index deeeeed..99f5904 100644 --- a/platform/linux-generic/include/api/odp_pktio_socket.h +++ b/platform/linux-generic/include/api/odp_pktio_socket.h @@ -16,6 +16,7 @@ extern "C" { typedef struct { odp_pktio_type_t type; int fanout; + int headroom; } socket_params_t; #ifdef __cplusplus diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index f991806..cc965a3 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -80,7 +80,7 @@ int setup_pkt_sock(pkt_sock_t * const pkt_sock, const char *netdev, odp_buffer_pool_t pool); int setup_pkt_sock_mmap(pkt_sock_mmap_t * const pkt_sock, const char *netdev, - odp_buffer_pool_t pool, int fanout); + odp_buffer_pool_t pool, socket_params_t *sock_params); /** * Close a packet socket diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 33ade10..3682c78 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -220,7 +220,7 @@ odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool, break; case ODP_PKTIO_TYPE_SOCKET_MMAP: res = setup_pkt_sock_mmap(&pktio_entry->s.pkt_sock_mmap, dev, - pool, params->sock_params.fanout); + pool, ¶ms->sock_params); if (res == -1) { close_pkt_sock_mmap(&pktio_entry->s.pkt_sock_mmap); free_pktio_entry(id); diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index d44c333..49652a0 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -34,8 +34,8 @@ #include #include -#include #include +#include #include #include @@ -760,7 +760,7 @@ static int mmap_store_hw_addr(pkt_sock_mmap_t * const pkt_sock, * ODP_PACKET_SOCKET_MMAP: */ int setup_pkt_sock_mmap(pkt_sock_mmap_t * const pkt_sock, const char *netdev, - odp_buffer_pool_t pool, int fanout) + odp_buffer_pool_t pool, socket_params_t *sock_params) { odp_packet_t pkt; uint8_t *pkt_buf; @@ -781,6 +781,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t * const pkt_sock, const char *netdev, l2_hdr = ETHBUF_ALIGN(pkt_buf); /* Store eth buffer offset for pkt buffers from this pool */ pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; + pkt_sock->frame_offset += sock_params->headroom; odp_packet_free(pkt); @@ -815,7 +816,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t * const pkt_sock, const char *netdev, return -1; } - if (fanout) { + if (sock_params->fanout) { ret = set_pkt_sock_fanout_mmap(pkt_sock, if_idx); if (ret != 0) return -1;