Thread (15 messages) flat view 15 messages, 7 authors, 2021-12-11

Re: [PATCH net-next 2/2] net: stmmac: add tc flower filter for EtherType matching

From: Kurt Kanzenbach <hidden>
Date: 2021-12-10 10:11:51
Also in: netdev
Subsystem: networking drivers, stmmac ethernet driver, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Chevallier, Linus Torvalds

On Thu Dec 09 2021, Ong Boon Leong wrote:
This patch adds basic support for EtherType RX frame steering for
LLDP and PTP using the hardware offload capabilities.

Signed-off-by: Ong Boon Leong <redacted>
[snip]
+	if (match.mask->n_proto) {
+		__be16 etype = ntohs(match.key->n_proto);
n_proto is be16. The ntohs() call will produce an u16.

Delta patch below.

Thanks,
Kurt
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 35ff7c835018..d64e42308eb6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -182,7 +182,7 @@ enum stmmac_rfs_type {
 
 struct stmmac_rfs_entry {
        unsigned long cookie;
-       __be16 etype;
+       u16 etype;
        int in_use;
        int type;
        int idx;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index cb7400943bb0..afa918185cf7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -759,7 +759,7 @@ static int tc_add_ethtype_flow(struct stmmac_priv *priv,
        flow_rule_match_basic(rule, &match);
 
        if (match.mask->n_proto) {
-               __be16 etype = ntohs(match.key->n_proto);
+               u16 etype = ntohs(match.key->n_proto);
 
                if (match.mask->n_proto != ETHER_TYPE_FULL_MASK) {
                        netdev_err(priv->dev, "Only full mask is supported for EthType filter");
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help