Thread (11 messages) flat view 11 messages, 4 authors, 2016-07-11

Re: [PATCH net-next 4/4] net/mlx4_core: Add an option to configure SVLAN TPID

From: Or Gerlitz <hidden>
Date: 2016-07-07 19:38:26

On Wed, Jul 6, 2016 at 3:29 PM, Tariq Toukan [off-list ref] wrote:
From: Moshe Shemesh <redacted>

Expose mlx4_config_svlan_tpid, that checks for feature support
in device capabilities and sets the Service Tag TPID accordingly.
I Googled for service tag TPID and I understand this is what we can
vlan protcol, correct? any reason to call it differently?

quoted hunk ↗ jump to hunk
@@ -2286,6 +2291,7 @@ struct mlx4_config_dev {
 #define MLX4_VXLAN_UDP_DPORT (1 << 0)
 #define MLX4_ROCE_V2_UDP_DPORT BIT(3)
 #define MLX4_DISABLE_RX_PORT BIT(18)
+#define MLX4_SVLAN_TPID BIT(20)

 static int mlx4_CONFIG_DEV_set(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev)
 {
@@ -2372,6 +2378,8 @@ int mlx4_config_dev_retrieval(struct mlx4_dev *dev,

        params->vxlan_udp_dport = be16_to_cpu(config_dev.vxlan_udp_dport);

+       params->svlan_tpid = be16_to_cpu(config_dev.svlan_tpid);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(mlx4_config_dev_retrieval);
@@ -2414,6 +2422,21 @@ int mlx4_config_roce_v2_port(struct mlx4_dev *dev, u16 udp_port)
 }
 EXPORT_SYMBOL_GPL(mlx4_config_roce_v2_port);

+int mlx4_config_svlan_tpid(struct mlx4_dev *dev, __be16 svlan_tpid)
+{
+       struct mlx4_config_dev config_dev;
+
+       if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_SVLAN_TPID))
+               return -ENOTSUPP;
+
+       memset(&config_dev, 0, sizeof(config_dev));
+       config_dev.update_flags    = cpu_to_be32(MLX4_SVLAN_TPID);
+       config_dev.svlan_tpid = svlan_tpid;
+
+       return mlx4_CONFIG_DEV_set(dev, &config_dev);
+}
+EXPORT_SYMBOL_GPL(mlx4_config_svlan_tpid);
dead code? I don't see any invocation of this helper on the patch, if
it's on earlier patches of the series it means you broke bisection...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help