From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 47567F04 for ; Wed, 20 Sep 2017 12:00:00 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id e64so1945211wmi.2 for ; Wed, 20 Sep 2017 03:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-transfer-encoding:mime-version; bh=mBJoJuhpDhphAMQd/wZUO7pbig02Gi9CSFVrR84DByo=; b=NGhdLRYijiByrJmrgE6RvIcwBgke0fZ9gIDqn/l3x4JQ/omi/xX3kLIraGZR0sO3FH H2f4qkpa5TYAxYw0u+1t87N9+ZetXgO26dZCQztTTbPu5cONocdwxHIWPQ0mSa8n0qfj kDXukiBjhLfC1nXVwfItTXkdPW8YmjycP1sRnDa9yaJI32+epxhx7+5fL1z13E5HabTP mrjy+e24jRuTQNVt+EhDtuEKxSr6Og13CRMQscdYXDeI4lxWm1Ft6EAjq3aiNkoYgZZ/ gBn4k2/bEdnGrWdSpfXWHG08MR/VMzP/5tBPzSK5fn/6ipaGAASNSG3MEGg/RTk96aj9 Vu7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=mBJoJuhpDhphAMQd/wZUO7pbig02Gi9CSFVrR84DByo=; b=H76QFTNvLeNAEcTrRJkTTNjogrzo1M1viC1mvi7hu5JeDF/kNGHjOZBneaeQhDnUAE f64aOgQ1wxyp+82jia97VBCPaunD3OgIdC1byHR4N4QsZGUp6bLEPmvWO6RdX9QOByTj Bz4c3obD0IcNq/nfCnYKZO7BQ6WVnD4kdB+nYwB8mFmLVFYQ2RhTMEJR7288Blc/KiDn N+fjN0evRsRjY+t2Z0VAGUsGQYMlheEZYbsmH8R0eTnyQkBuvw0AjpENczz53WKYRb/K IuJ5LrVopmenSr2IETZo0Ten0unbRZtCjxsmg8oK8AwfAe0tKlUuQn2m9810ibGX8CO0 xuTg== X-Gm-Message-State: AHPjjUiYezV7OR7S5jE4icR0hI05wC0nLA/baOsy2ow2d72xxIB+OVPp uFMFiEvIUAP1sthyrZn9Ysc= X-Google-Smtp-Source: AOwi7QCges8GvFWQJsSG7vFZ1155f1aU9W7l8pdd+L6bmbdVd9ef9UVt4V6wZr34jKFaKGd0D6R5FA== X-Received: by 10.80.143.226 with SMTP id y89mr4125323edy.21.1505901600047; Wed, 20 Sep 2017 03:00:00 -0700 (PDT) Received: from localhost ([213.251.34.151]) by smtp.gmail.com with ESMTPSA id t5sm737788edh.32.2017.09.20.02.59.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Sep 2017 02:59:59 -0700 (PDT) Message-ID: <1505901597.16471.0.camel@gmail.com> From: Luca Boccassi To: Chas Williams <3chas3@gmail.com>, dev@dpdk.org Cc: linville@tuxdriver.com, "Charles (Chas) Williams" , Chas Williams Date: Wed, 20 Sep 2017 10:59:57 +0100 In-Reply-To: <20170919214545.7549-1-3chas3@gmail.com> References: <20170919212131.7006-1-3chas3@gmail.com> <20170919214545.7549-1-3chas3@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/af_packet: make bypass configurable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2017 10:00:00 -0000 On Tue, 2017-09-19 at 17:45 -0400, Chas Williams wrote: > From: "Charles (Chas) Williams" >=20 > In certain situations, low speed interfaces, it may be desirable to > have the flow control provided by the kernel queueing disciplines. >=20 > Signed-off-by: Chas Williams > --- > =C2=A0drivers/net/af_packet/rte_eth_af_packet.c | 22 +++++++++++++++++-- > --- > =C2=A01 file changed, 17 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/af_packet/rte_eth_af_packet.c > b/drivers/net/af_packet/rte_eth_af_packet.c > index 7aa26e5..e3858fa 100644 > --- a/drivers/net/af_packet/rte_eth_af_packet.c > +++ b/drivers/net/af_packet/rte_eth_af_packet.c > @@ -59,6 +59,7 @@ > =C2=A0#define ETH_AF_PACKET_BLOCKSIZE_ARG "blocksz" > =C2=A0#define ETH_AF_PACKET_FRAMESIZE_ARG "framesz" > =C2=A0#define ETH_AF_PACKET_FRAMECOUNT_ARG "framecnt" > +#define ETH_AF_PACKET_BYPASS_ARG "bypass" > =C2=A0 > =C2=A0#define DFLT_BLOCK_SIZE (1 << 12) > =C2=A0#define DFLT_FRAME_SIZE (1 << 11) > @@ -115,6 +116,7 @@ static const char *valid_arguments[] =3D { > =C2=A0 ETH_AF_PACKET_BLOCKSIZE_ARG, > =C2=A0 ETH_AF_PACKET_FRAMESIZE_ARG, > =C2=A0 ETH_AF_PACKET_FRAMECOUNT_ARG, > + ETH_AF_PACKET_BYPASS_ARG, > =C2=A0 NULL > =C2=A0}; > =C2=A0 > @@ -559,6 +561,7 @@ rte_pmd_init_internals(struct rte_vdev_device > *dev, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uns= igned int blockcnt, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uns= igned int framesize, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uns= igned int framecnt, > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0unsigned int bypass, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0str= uct pmd_internals **internals, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0str= uct rte_eth_dev **eth_dev, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0str= uct rte_kvargs *kvlist) > @@ -580,9 +583,6 @@ rte_pmd_init_internals(struct rte_vdev_device > *dev, > =C2=A0#if defined(PACKET_FANOUT) > =C2=A0 int fanout_arg; > =C2=A0#endif > -#if defined(PACKET_QDISC_BYPASS) > - int bypass; > -#endif > =C2=A0 > =C2=A0 for (k_idx =3D 0; k_idx < kvlist->count; k_idx++) { > =C2=A0 pair =3D &kvlist->pairs[k_idx]; > @@ -698,7 +698,6 @@ rte_pmd_init_internals(struct rte_vdev_device > *dev, > =C2=A0 } > =C2=A0 > =C2=A0#if defined(PACKET_QDISC_BYPASS) > - bypass =3D 1; > =C2=A0 rc =3D setsockopt(qsockfd, SOL_PACKET, > PACKET_QDISC_BYPASS, > =C2=A0 &bypass, sizeof(bypass)); > =C2=A0 if (rc =3D=3D -1) { > @@ -851,6 +850,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev, > =C2=A0 unsigned int framesize =3D DFLT_FRAME_SIZE; > =C2=A0 unsigned int framecount =3D DFLT_FRAME_COUNT; > =C2=A0 unsigned int qpairs =3D 1; > + unsigned int bypass =3D 1; > =C2=A0 > =C2=A0 /* do some parameter checking */ > =C2=A0 if (*sockfd < 0) > @@ -902,6 +902,16 @@ rte_eth_from_packet(struct rte_vdev_device *dev, > =C2=A0 } > =C2=A0 continue; > =C2=A0 } > + if (strstr(pair->key, ETH_AF_PACKET_BYPASS_ARG) !=3D > NULL) { > + bypass =3D atoi(pair->value); > + if (bypass > 2) { > + RTE_LOG(ERR, PMD, > + "%s: invalid bypass > value\n", > + name); > + return -1; > + } > + continue; > + } > =C2=A0 } > =C2=A0 > =C2=A0 if (framesize > blocksize) { > @@ -927,6 +937,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev, > =C2=A0 if (rte_pmd_init_internals(dev, *sockfd, qpairs, > =C2=A0 =C2=A0=C2=A0=C2=A0blocksize, blockcount, > =C2=A0 =C2=A0=C2=A0=C2=A0framesize, framecount, > + =C2=A0=C2=A0=C2=A0bypass, > =C2=A0 =C2=A0=C2=A0=C2=A0&internals, ð_dev, > =C2=A0 =C2=A0=C2=A0=C2=A0kvlist) < 0) > =C2=A0 return -1; > @@ -1021,4 +1032,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_packet, > =C2=A0 "qpairs=3D " > =C2=A0 "blocksz=3D " > =C2=A0 "framesz=3D " > - "framecnt=3D"); > + "framecnt=3D " > + "bypass=3D"); Acked-by: Luca Boccassi --=20 Kind regards, Luca Boccassi