mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-27 10:32:40 +07:00
c6b36bdd04
Spectrum systems have a configurable limit on how far into the packet they
parse. By default, the limit is 96 bytes.
An IPv6 PTP packet is layered as Ethernet/IPv6/UDP (14+40+8 bytes), and
sequence ID of a PTP event is only available 32 bytes into payload, for a
total of 94 bytes. When an additional 802.1q header is present as
well (such as when ptp4l is running on a VLAN port), the parsing limit is
exceeded. Such packets are not recognized as PTP, and are not timestamped.
Therefore generalize the current VXLAN-specific parsing depth setting to
allow reference-counted requests from other modules as well. Keep it in the
VXLAN module, because the MPRS register also configures UDP destination
port number used for VXLAN, and is thus closely tied to the VXLAN code
anyway.
Then invoke the new interfaces from both VXLAN (in obvious places), as well
as from PTP code, when the (global) timestamping configuration changes from
disabled to enabled or vice versa.
Fixes: 8748642751
("mlxsw: spectrum: PTP: Support SIOCGHWTSTAMP, SIOCSHWTSTAMP ioctls")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
55 lines
1.6 KiB
C
55 lines
1.6 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
|
|
/* Copyright (c) 2018 Mellanox Technologies. All rights reserved */
|
|
|
|
#ifndef _MLXSW_SPECTRUM_NVE_H
|
|
#define _MLXSW_SPECTRUM_NVE_H
|
|
|
|
#include <linux/netlink.h>
|
|
#include <linux/rhashtable.h>
|
|
|
|
#include "spectrum.h"
|
|
|
|
struct mlxsw_sp_nve_config {
|
|
enum mlxsw_sp_nve_type type;
|
|
u8 ttl;
|
|
u8 learning_en:1;
|
|
__be16 udp_dport;
|
|
__be32 flowlabel;
|
|
u32 ul_tb_id;
|
|
enum mlxsw_sp_l3proto ul_proto;
|
|
union mlxsw_sp_l3addr ul_sip;
|
|
};
|
|
|
|
struct mlxsw_sp_nve {
|
|
struct mlxsw_sp_nve_config config;
|
|
struct rhashtable mc_list_ht;
|
|
struct mlxsw_sp *mlxsw_sp;
|
|
const struct mlxsw_sp_nve_ops **nve_ops_arr;
|
|
unsigned int num_nve_tunnels; /* Protected by RTNL */
|
|
unsigned int num_max_mc_entries[MLXSW_SP_L3_PROTO_MAX];
|
|
u32 tunnel_index;
|
|
u16 ul_rif_index; /* Reserved for Spectrum */
|
|
unsigned int inc_parsing_depth_refs;
|
|
};
|
|
|
|
struct mlxsw_sp_nve_ops {
|
|
enum mlxsw_sp_nve_type type;
|
|
bool (*can_offload)(const struct mlxsw_sp_nve *nve,
|
|
const struct net_device *dev,
|
|
struct netlink_ext_ack *extack);
|
|
void (*nve_config)(const struct mlxsw_sp_nve *nve,
|
|
const struct net_device *dev,
|
|
struct mlxsw_sp_nve_config *config);
|
|
int (*init)(struct mlxsw_sp_nve *nve,
|
|
const struct mlxsw_sp_nve_config *config);
|
|
void (*fini)(struct mlxsw_sp_nve *nve);
|
|
int (*fdb_replay)(const struct net_device *nve_dev, __be32 vni,
|
|
struct netlink_ext_ack *extack);
|
|
void (*fdb_clear_offload)(const struct net_device *nve_dev, __be32 vni);
|
|
};
|
|
|
|
extern const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops;
|
|
extern const struct mlxsw_sp_nve_ops mlxsw_sp2_nve_vxlan_ops;
|
|
|
|
#endif
|