Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Harsha M <h.mahadeva@chelsio.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, bharat@chelsio.com
Subject: Re: [PATCH net v1] cxgb4: flower: fix 802.1ad VLAN TPID matching in tc flower filters
Date: Mon, 29 Jun 2026 18:44:17 -0700	[thread overview]
Message-ID: <20260629184417.31b21223@kernel.org> (raw)
In-Reply-To: <20260626134848.91281-1-h.mahadeva@chelsio.com>

On Fri, 26 Jun 2026 19:18:22 +0530 Harsha M wrote:
> +		if (be16_to_cpu(match.key->vlan_tpid) == ETH_P_8021AD) {

nit: put the byteswap on the constant to let the compiler do it a build
time

> +			struct adapter *adap = netdev2adap(dev);
> +			u32 ovlan_reg, ctl_reg, val, port_id;
> +
> +			if (!adap) {
> +				netdev_err(dev, "%s: adap not found\n", __func__);
> +				return;
> +			}
> +
> +			val = (be16_to_cpu(match.mask->vlan_tpid) << 16) |

Looks like this is changing a per-port register. Presumably the mask
must be the same for all filters. Why not enforce that mask is ~0 and
program a constant?

> +			      be16_to_cpu(match.key->vlan_tpid);

you compared tpid to ETH_P_8021AD above, why not use the constant?

> +			port_id = netdev2pinfo(dev)->port_id;
> +			fs->val.ovlan = vlan_tci;
> +			fs->mask.ovlan = vlan_tci_mask;
> +			fs->val.ovlan_vld = 1;
> +			fs->mask.ovlan_vld = 1;
> +			ovlan_reg = PORT_REG(port_id, MPS_PORT_RX_OVLAN0_A);
> +			ctl_reg = PORT_REG(port_id, MPS_PORT_RX_CTL_A);
> +			t4_write_reg(adap, ovlan_reg, val);
> +			val = t4_read_reg(adap, ctl_reg);
> +			t4_write_reg(adap, ctl_reg, val | 1);
> +			t4_tp_wr_bits_indirect(adap, TP_INGRESS_CONFIG_A, 1U << 9, 0);
-- 
pw-bot: cr

      reply	other threads:[~2026-06-30  1:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 13:48 [PATCH net v1] cxgb4: flower: fix 802.1ad VLAN TPID matching in tc flower filters Harsha M
2026-06-30  1:44 ` Jakub Kicinski [this message]

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=20260629184417.31b21223@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bharat@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=h.mahadeva@chelsio.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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