DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Alfredo Cardigliano <cardigliano@ntop.org>,
	John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>
Cc: dev@dpdk.org, Raslan Darawsheh <rasland@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH v5 11/17] net/ionic: add Rx filters support
Date: Mon, 20 Jan 2020 16:57:36 +0000	[thread overview]
Message-ID: <8afe9e83-5b0c-62e2-d31b-83d499e88f11@intel.com> (raw)
In-Reply-To: <20200119155356.20403-12-cardigliano@ntop.org>

On 1/19/2020 3:53 PM, Alfredo Cardigliano wrote:
> Add support for managing RX filters based on MAC and VLAN.
> Hardware cannot provide the list of filters, thus we keep
> a local list.
> Add support for promisc and allmulticast modes.
> 
> Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
> Reviewed-by: Shannon Nelson <snelson@pensando.io>

<...>

> +int
> +ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id,
> +		uint16_t rxq_index, struct ionic_admin_ctx *ctx)
> +{
> +	struct ionic_rx_filter *f;
> +	uint32_t key;
> +
> +	f = rte_zmalloc("ionic", sizeof(*f), 0);
> +
> +	if (!f)
> +		return -ENOMEM;
> +
> +	f->flow_id = flow_id;
> +	f->filter_id = ctx->comp.rx_filter_add.filter_id;
> +	f->rxq_index = rxq_index;
> +	memcpy(&f->cmd, &ctx->cmd, sizeof(f->cmd));
> +
> +	switch (f->cmd.match) {
> +	case IONIC_RX_FILTER_MATCH_VLAN:
> +		key = f->cmd.vlan.vlan & IONIC_RX_FILTER_HLISTS_MASK;
> +		break;
> +	case IONIC_RX_FILTER_MATCH_MAC:
> +		key = *(uint32_t *)f->cmd.mac.addr &
> +			IONIC_RX_FILTER_HLISTS_MASK;

Raslan reported a build error on this line [1] with gcc 5.4-6ubuntu. I will
update the code as [2] please verify the result in next-net.

@Raslan, I can't re-procude the warning, can you please re-test the next-net
after change?

[1]
 /tmp/dpdk/drivers/net/ionic/ionic_rx_filter.c: In function 'ionic_rx_filter_save':
 /tmp/dpdk/drivers/net/ionic/ionic_rx_filter.c:85:3: error: dereferencing
type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
    key = *(uint32_t *)f->cmd.mac.addr &
    ^

[2]
 diff --git a/drivers/net/ionic/ionic_rx_filter.c
b/drivers/net/ionic/ionic_rx_filter.c
 index 00b5cee49..f75b81a27 100644
 --- a/drivers/net/ionic/ionic_rx_filter.c
 +++ b/drivers/net/ionic/ionic_rx_filter.c
 @@ -82,8 +82,8 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id,
                 key = f->cmd.vlan.vlan & IONIC_RX_FILTER_HLISTS_MASK;
                 break;
         case IONIC_RX_FILTER_MATCH_MAC:
 -               key = *(uint32_t *)f->cmd.mac.addr &
 -                       IONIC_RX_FILTER_HLISTS_MASK;
 +               memcpy(&key, f->cmd.mac.addr, sizeof(key));
 +               key &= IONIC_RX_FILTER_HLISTS_MASK;
                 break;
         case IONIC_RX_FILTER_MATCH_MAC_VLAN:
                 key = f->cmd.mac_vlan.vlan & IONIC_RX_FILTER_HLISTS_MASK;

  reply	other threads:[~2020-01-20 16:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-19 15:53 [dpdk-dev] [PATCH v5 00/17] Introduces net/ionic PMD Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 01/17] net/ionic: add skeleton Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 02/17] net/ionic: add hardware structures definitions Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 03/17] net/ionic: add log Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 04/17] net/ionic: register and initialize the adapter Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 05/17] net/ionic: add port management commands Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 06/17] net/ionic: add basic lif support Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 07/17] net/ionic: add doorbells Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 08/17] net/ionic: add adminq support Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 09/17] net/ionic: add notifyq support Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 10/17] net/ionic: add basic port operations Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 11/17] net/ionic: add Rx filters support Alfredo Cardigliano
2020-01-20 16:57   ` Ferruh Yigit [this message]
2020-01-21  7:43     ` Raslan Darawsheh
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 12/17] net/ionic: add Flow Control support Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 13/17] net/ionic: add Rx and Tx handling Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 14/17] net/ionic: add RSS support Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 15/17] net/ionic: add stats Alfredo Cardigliano
2020-01-20 12:10   ` Ferruh Yigit
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 16/17] net/ionic: add Tx checksum support Alfredo Cardigliano
2020-01-19 15:53 ` [dpdk-dev] [PATCH v5 17/17] net/ionic: read Fw version Alfredo Cardigliano
2020-01-20 13:05 ` [dpdk-dev] [PATCH v5 00/17] Introduces net/ionic PMD Ferruh Yigit
2020-01-20 13:38   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8afe9e83-5b0c-62e2-d31b-83d499e88f11@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=cardigliano@ntop.org \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=rasland@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).